Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Toolbars in a pane
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbars in a pane

 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: Toolbars in a pane
    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.

 

Back to Top
AliRafiee View Drop Down
Groupie
Groupie


Joined: 06 May 2004
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote AliRafiee Quote  Post ReplyReply Direct Link To This Post 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

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.094 seconds.