Print Page | Close Window

CXTPToolBar question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=771
Printed Date: 23 May 2024 at 2:14am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPToolBar question
Posted By: yoavo
Subject: CXTPToolBar question
Date Posted: 23 May 2004 at 8:12am

Hi,

Is there a way to remove from CXTPToolBar the "Toolbar Options" button (The button which pops the "Add or Remove Buttons" menu) ??

thanks, Yoav.




Replies:
Posted By: Oleg
Date Posted: 01 June 2004 at 3:59am
pCommandBars->GetCommandBarsOptions()->bShowExpandButt onAlways  = FALSE;

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


Posted By: Kenneth
Date Posted: 02 June 2004 at 12:56pm
How about being able to turn it off for a selected toolbar?  Say I create an CXTPControlCustom animation bar and want to be able to turn it off.


Posted By: Oleg
Date Posted: 03 June 2004 at 12:52am

You can override CXTPToolBar:

class CToolBoxBar : public CXTPToolBar
{
public:
 DECLARE_XTP_COMMANDBAR(CToolBoxBar)

 CSize CalcDockingLayout(int nLength, DWORD dwMode, int nWidth);

}

 

IMPLEMENT_XTP_COMMANDBAR(CToolBoxBar, CXTPToolBar)

 

CSize CToolBoxBar::CalcDockingLayout(int nLength, DWORD dwMode, int nWidth)
{
 GetCommandBars()->GetCommandBarsOptions()->bShow ExpandButtonAlways = FALSE;
 CSize sz = CXTPToolBar::CalcDockingLayout(nLength, dwMode, nWidth);
 GetCommandBars()->GetCommandBarsOptions()->bShow ExpandButtonAlways = TRUE;

 return sz;
}

 

usage:

 CXTPToolBar* pToolBox = (CXTPToolBar*)
        pCommandBars->Add(_T("ToolBox"), xtpBarLeft, RUNTIME_CLASS(CToolBoxBar));

but you must make CXTPToolBar::CalcDockingLayout virtual (in next version it will be)



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


Posted By: Kenneth
Date Posted: 11 June 2004 at 12:45pm
Ok, I was able to remove the expand button.  However if I move the resulting CXTPToolBar to the right side of the window, it stops from what appears to be the width of the ExpandButton, form the right side of the window.    In contrast, if I move a toolbar with the ExpandButton visible, the toolbar will be flush with the right side of the window.


Posted By: Kenneth
Date Posted: 24 June 2004 at 9:04am
I guess the lack of response means it cannot be done.  Is this a Microsoft shortcoming or a codejock shortcoming?


Posted By: Kenneth
Date Posted: 25 June 2004 at 11:27am

This problem can be seen in the ToolKitPro examples, CommonControls when you add the following to the MainFrm OnCreate function:

 GetCommandBars()->GetCommandBarsOptions()->bShow ExpandButtonAlways = FALSE;

Try to move the Animation, slider and the one with the words "Opened Documents" toolbars to the far right of the window and you can see it will stop exactly one dropdown button width from the right side.



Posted By: Kenneth
Date Posted: 29 June 2004 at 9:18pm
Found the problem in the codejock software and fixed it.



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