Proper way to subclass CXTPToolBar with member var |
Post Reply |
Author | |
cuisinart
Groupie Joined: 31 January 2012 Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 12 March 2012 at 2:44pm |
Hello, I have created a subclassed toolbar that adds its own CXTPControls in its OnCreate section, in order to keep this tidy and somewhat separate from MainFrm (no message processing in MainFrm from this toolbar). It stores pointers to its controls as member variables, and handles LButtonDown clicks and HScrolls from user input. Also, it's dyn declared with the macros DECLARE_XTP_COMMANDBAR and IMPLEMENT_XTP_COMMANDBAR as mentioned on this forum. All seems to go well, except when loading toolbar states, the codejock framework somehow duplicates and destroys the created controls that the member variables point to. I read on the forum that the Copy member function needs to be over-ridden, so I did this but it is never called. For now, my solution has been to remove all controls and re-create them after the toolbar state has been loaded, so the controls are valid and the toolbar position is loaded from the last state. However this isn't optimal.. What is the proper way to subclass a self-contained CXTPToolBar with new member variables (pointers to its self-created controls) without adding a bunch of message handlers to CMainFrame?
|
|
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 |