Print Page | Close Window

CommandBar text and expanded button

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=1121
Printed Date: 31 October 2024 at 9:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBar text and expanded button
Posted By: kanlaw
Subject: CommandBar text and expanded button
Date 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.




Replies:
Posted By: Oleg
Date 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


Posted By: kanlaw
Date Posted: 06 September 2004 at 2:58am
Thanks



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