Print Page | Close Window

Dont let toolbar hide in customize dialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=717
Printed Date: 25 December 2024 at 9:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dont let toolbar hide in customize dialog
Posted By: Ark42
Subject: Dont let toolbar hide in customize dialog
Date 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...




Replies:
Posted By: Oleg
Date Posted: 12 May 2004 at 12:07am
Thank you for good suggestion. added in source too.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 12 May 2004 at 12:32am
IsCloseable/SetCloseable methods added

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Ark42
Date 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.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net