Print Page | Close Window

Toolbars in a pane

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=3603
Printed Date: 07 July 2025 at 2:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbars in a pane
Posted By: yoavo
Subject: Toolbars in a pane
Date Posted: 06 February 2006 at 1:02am

Hi,

Is there a way to insert a toolbar to a pane, and the toolbar will support customization ?

(In the "Advanced" sample I couldnt add/remove commands to the toolbars of the panes).

Yoav.

 




Replies:
Posted By: AliRafiee
Date Posted: 06 February 2006 at 2:22pm

Go back to the Advanced example. Load up DockingFrame.cpp

First comment out the line: (in OnCreate method)

pCommandBar->GetCommandBarOptions()->bShowExapndButton Always = FALSE;

this alone will get the customize drop down button do dispaly.

Next add the following line to Message map

ON_COMMAND(XTP_ID_CUSTOMIZE, OnCustomize)

and the method

void CDockingFrame::OnCustomize()
{
   // get a pointer to the command bars object.
 CXTPCommandBars* pCommandBars = GetCommandBars();
 if (pCommandBars == NULL)
  return;

 // instanciate the customize dialog
 CXTPCustomizeSheet dlg(pCommandBars);

 // add the options page to the customize dialog.
 CXTPCustomizeOptionsPage pageOptions(&dlg);
 dlg.AddPage(&pageOptions);

 // add the commands page to the customize dialog.
 CXTPCustomizeCommandsPage* pPageCommands = dlg.GetCommandsPage();
 pPageCommands->AddCategories(IDR_ADVANCTYPE);

 // initialize the commands page page.
 pPageCommands->InsertAllCommandsCategory();
 pPageCommands->InsertBuiltInMenus(IDR_ADVANCTYPE);
 pPageCommands->InsertNewMenuCategory();

 // display the customize dialog.
 dlg.DoModal();
}

Don't forget to add

afx_msg void OnCustomize();

to the class definition.

Now the Docking Frame on the right hand side has the customize.

Good luck

Ali Rafiee




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