Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPToolBar question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPToolBar question

 Post Reply Post Reply
Author
Message
yoavo View Drop Down
Senior Member
Senior Member


Joined: 29 February 2004
Location: Israel
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote yoavo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPToolBar question
    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.

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: 01 June 2004 at 3:59am
pCommandBars->GetCommandBarsOptions()->bShowExpandButt onAlways  = FALSE;
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post Posted: 29 June 2004 at 9:18pm
Found the problem in the codejock software and fixed it.
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.188 seconds.