Copy item data when CXTPControlComboBox cloned? |
Post Reply |
Author | |
franji1
Groupie Joined: 28 June 2005 Status: Offline Points: 70 |
Post Options
Thanks(0)
Posted: 01 September 2015 at 7:01pm |
Whenever a toolbar that contains a CXTPControlComboBox is "customized", the next time it loads, the list contains all the text but all the item data is still 0.
The CXTPControlComboBox is "Copy"ed during a clone process, and the text is obviously copied, but the item data is not. What is the proper mechanism to set the item data when the original CXTPControlComboBox is copied? |
|
franji1
Groupie Joined: 28 June 2005 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I found that the modified toolbars are serialized, and that it's actually the default behavior of the CXTPControlComboBoxList to just serialize the item text, not the item data.
This is DEFINITLY the CORRECT behavior. HOWEVER, what would be the proper mechanism to override this behavior, and also serialize the ItemData, along with the item text? Again, this is dealing with a customized toolbar (e.g. removed the Help button from the end) that also contains a CXTPControlComboBox. So because the toolbar was "customized", it serialized the combo box (in addition to all the other controls in that toolbar), but without the item data. So when I shut down and re-run the software, when it loads the customized toolbar, the combo box is there and looks fine, but when I select something, the item data for every item is 0, so ALL the entries behave like the "zeroth" entry. |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
Not sure if this will help in your case but we subclass some controls and override DoPropExchange(CXTPPropExchange* pPX) and save/read our data for customization purposes.
Also, I recently modified some code that used a CXTPControlComboBox derived class and I had to override the Copy method. Failing to do so caused me to loose data when the user right-clicked the control and ran "Add To QAT". I needed the extra data associated with the entries in order to generate image icons for the entries and didn't think about the Copy method until someone showed me the images were missing when the put the control on the QAT. I never thought about testing that :( |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |