Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CommandBar text and expanded button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBar text and expanded button

 Post Reply Post Reply
Author
Message
kanlaw View Drop Down
Groupie
Groupie


Joined: 03 August 2004
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanlaw Quote  Post ReplyReply Direct Link To This Post Topic: CommandBar text and expanded button
    Posted: 31 August 2004 at 11:20pm

1. I make a commandbar with style of text under button, the text will disappear when button is in the expanded bar. Could I keep the text at this situation. (pic for your reference)

2. The expanded bar includes all the buttons that can not be displayed at the same line command bars, Could I limit just include itself button.

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: 05 September 2004 at 3:10am

1 and 2. You must create custome commandbars class:

class CCommandBars : public CXTPCommandBars
{
 DECLARE_DYNCREATE(CCommandBars)

 virtual void GetHiddenControls (CXTPToolBar* pToolBar, CXTPCommandBar* pExpandBar);
};

IMPLEMENT_DYNCREATE(CCommandBars, CXTPCommandBars)

void CCommandBars::GetHiddenControls(CXTPToolBar* pToolBar, CXTPCommandBar* pExpandBar)
{
 if (pToolBar->IsTextBelowIcons())
  pExpandBar->ShowTextBelowIcons();
 
  
 for (int i = 0; i < pToolBar->GetControls()->GetCount(); i++)
 {
  CXTPControl* pControl = pToolBar->GetControl(i);
  
  if (pControl->GetHideFlags() == xtpHideWrap)
  {
   CXTPControl* pControlClone = pExpandBar->GetControls()->AddClone(pControl);
   pControlClone->SetHideFlags(0);
   pControlClone->SetBeginGroup(FALSE);
  }
 }  
}
and apply it:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

...

// Initialize the command bars
    if (!InitCommandBars(RUNTIME_CLASS(CCommandBars)))
        return -1;
...

 

ps. be sure CXTPCommandBars::GetHiddenControls is virtual (see XTPCommandBars.h)

it was changed only in 9.10. If it is not so, add "virtual" keyword manually.

 

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
kanlaw View Drop Down
Groupie
Groupie


Joined: 03 August 2004
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanlaw Quote  Post ReplyReply Direct Link To This Post Posted: 06 September 2004 at 2:58am
Thanks
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.219 seconds.