![]() |
Prevent menubar from moving. |
Post Reply ![]() |
Author | |
larryp ![]() Groupie ![]() Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
![]() ![]() ![]() ![]() ![]() Posted: 23 February 2005 at 10:24pm |
First, I would like to say that so far I am impressed with the CodeJock library. Great job.
Is there an easy way to prevent the toolbar from moving? My program performs recording of data and during recording I need to disable the moving of the menubar and all toolbars. I saw a previous post where someone described how to create a class derived from CXTPToolBar and passed as the third parameter to Add. This allows me to catch the mouse click events to prevent moving the toolbars, but what about the menubar? Larry |
|
![]() |
|
larryp ![]() Groupie ![]() Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
![]() ![]() ![]() ![]() ![]() |
I figured out how to do it, so I will post the answer for someone who may need it in the future.
1) Create a class derived from CXTPMenuBar class CLockMenuBar: public CXTPMenuBar { public: CLockMenuBar(); DECLARE_MESSAGE_MAP() DECLARE_XTP_COMMANDBAR(CLockMenuBar) afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); }; 2) GetCommandBars()->SetMenuBarClass (RUNTIME_CLASS(CLockMenuBar)); GetCommandBars()->SetMenu( _T(strCaption), IDR_MAINFRAME); 3) Implement the class methods as defined above to process the events according to a flag which is set when toolbars need to be locked. Larry |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
pMenBar->EnableDocking(xtpFlagStretched); PToolBar1->EnableDocking(xtpFlagHideWrap); ...
seems it will be easy ;) Edited by oleg |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |