![]() |
How to make a CXTPToolBar non-movable? |
Post Reply
|
| Author | |
wssdev
Groupie
Joined: 04 May 2010 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Topic: How to make a CXTPToolBar non-movable?Posted: 18 June 2010 at 11:30am |
|
Is there a way to make a CXTPToolBar non-movable/non-draggable/non-floating? I want to put it in the top-left corner of the main frame window and to make it stay there (by not having a gripper and not reacting to moust draggining). Here's how I create it: int MyFrameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CXTPFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPToolBar* myToolbar = static_cast<CXTPToolBar*>(pCommandBars->Add(_T("MyToolbar"), xtpBarTop)); // How to make it non-movable, non-draggable, non-floating..? myToolbar->? Thanks in advance! |
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 June 2010 at 9:01am |
|
pCommandBar->SetFlags(0, xtpFlagFloating|xtpFlagAlignTop|xtpFlagAlignLeft|xtpFlagAlignRight|xtpFlagAlignBottom);
pCommandBar->SetShowGripper(FALSE); (where pCommandBar is a CXTPCommandBar*) The SetFlags call disables floating and limits docking to the top section. Specifying removal of xtpFlagAlignTop prevents the user from dragging the menu bar up and down within the top docking area. The SetShowGripper call removes the gripper, visually indicating to the user that the bar is fixed. Also, it seems that the absence of the gripper gives the menu bar its own row. Also can use: pCommandBar->EnableDocking(0); |
|
![]() |
|
wssdev
Groupie
Joined: 04 May 2010 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 June 2010 at 9:24am |
|
EnableDocking(0) is what I tried after writing this message, and it did do the trick. However, I prefer your approach using setFlags(). It feels somewhat safer because it removes only relevant flags. Also, I'm using an older XTP version (10.30) that does not have SetShowGripper() so I ended up calling pToolBar->ModifyBarStyle(CBRS_GRIPPER, 0); Thanks for your help! ▼ ▲ |
|
![]() |
|
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 |