Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Dont let toolbar hide in customize dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dont let toolbar hide in customize dialog

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: Dont let toolbar hide in customize dialog
    Posted: 11 May 2004 at 9:21pm

When I set pToolBar->SetContextMenuPresent(FALSE); the purpose as far as I can tell is so that you can't right click and hide the toolbar.  I have a toolbar (thats on a docking pane) that I don't want hidable, movable, or anything.  All is fine except that you can right click other toolbars and pick Customize and uncheck the box and cause the toolbar to be hidden.

I added
void SetCustomizeHidable(BOOL bHidable);
just under SetContextMenuPresent in XTPToolBar.h

and then
AFX_INLINE void CXTPToolBar::SetCustomizeHidable(BOOL bHidable) {
    m_bCustomizeHidable = bHidable;
}
in the same file under the inline for SetContextMenuPresent

Then, in XTPCommandBar.h I added the line
BOOL m_bCustomizeHidable;                // TRUE if the command bar is able to be hidden via customize dialog
Just under the BOOL m_bContextMenuPresent

And also
m_bCustomizeHidable = TRUE;
in the CXTPCommandBar constructor in XTPCommandBar.cpp

Finally, I changed the line in XTPCustomizeToolbarsPage.cpp inside of CXTPCustomizeToolbarsPage::OnChkChange from
if (pToolBar->GetType() == xtpBarTypeMenuBar)
to
if (pToolBar->GetType() == xtpBarTypeMenuBar || !pToolBar->m_bCustomizeHidable)

and now I can easily call pToolBar->SetCustomizeHidable(FALSE); and have this toolbar not be uncheckable, but still be customizeable.

Please add this or something similar to future versions...



Edited by Ark42
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2004 at 12:07am
Thank you for good suggestion. added in source too.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2004 at 12:32am
IsCloseable/SetCloseable methods added
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2004 at 12:29am

I just tried this SetClosable but the toolbar still shows up in the toolbar list (view -> toolbars) and lets you close/add it from there. I think it should be removed from that list together, just like it is from the right-click list of toolbars.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.297 seconds.