Serious issue with the CCustomGridService


Author: Ian Schraeder Asked: 2 years 1 month 23 days 13 hours 32 minutes ago Viewed: 547 times Activity: 2 years 1 month 20 days 19 hours 20 minutes ago

0

Hello, I created a subclass of CCustomDrawGrid using the CCustomGridService, and there is an issue where pushing an arrow key crashes the program giving the "vector subscript out of range" error. On the ProcessKeyLeft function, this is caused by line 740 of CustomGridService.cpp, by the command "m_pControl->ActivateCell(m_pControl->m_sSelectTo.X, m_pControl->m_sSelectTo.Y, this);" I am unable to solve this issue in a subclass by overriding the functions due to how they are setup but would like to maintain the rest of the functionality of the service with some slight modification. This does not appear to be an issue with any standard grids and I cannot seem to solve the issue. Any help would be appreciated.


Commenting out line 736 makes line 743 error. — by Ian Schraeder at Feb 6, 2022, 3:39:34 AM

add comment


1

Answered by Support at Feb 7, 2022, 9:11:39 AM

Hello. Extending widgets might not be a good idea unless it's a trivial extend which only changes default properties. You may spend a lot of time trying to understand how widget works and finally get to a conclusion you cannot achieve all you need because of private properties and methods you have no access to. The better choice is to begin widget from scratch (from CControl class) as described in Programming Guide. You may also copy standard widget source code to your new widget. At least in this case you will have full control over the code and will be able to change private methods.


Alright. I'll keep this in mind. — by Ian Schraeder at Feb 8, 2022, 9:41:46 PM

add comment