Customization questions |
Post Reply |
Author | |
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
Posted: 26 September 2008 at 5:31pm |
Hello,
Is there a white paper or tutorial that discusses runtime user Customization of toolbars and menus? In C++, I am doing this: pCommandBars->EnableCustomization(VARIANT_TRUE); pControl = pControls->Add(xtpControlButton, M_FILE_NEW, ""); pControl->PutDescriptionText(_bstr_t("Create a new document")); pDesignerControls->AddControl(pControl); When I click on the arrow to open the Customization dialog, I see this: Why are the command items greyed out? And the Customize dialog -- how do I populate it: Thanks for any advice... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Call EnableCustomize only after all menus/toolbars will be created - it will create "original" state of commandbars.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Thanks for the reply.
The items in the Add/Remove dialog are now active. However, there are no commands in the Customize/Actions tab. When I create the toolbars, I add the controls to the DesignerControls collection: pControl = pControls->Add(xtpControlButton, M_FILE_NEW, ""); pControl->PutDescriptionText(_bstr_t("Create a new document")); pDesignerControls->AddControl(pControl); Or does the DesignerControls collection have to get populated in the Customization event handler? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Yes you need fill DesignerControls. In Customization event or just in initialization code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
// ------------------------------------ // Create Standard Toolbar // ------------------------------------ ICommandBarPtr pToolbar = g_spCommandBars->Add(_bstr_t("WhammyBar"), xtpBarTop); pToolbar->PutBarID(ID_MAIN_TOOLBAR); pDesignerControls = g_spCommandBars->GetDesignerControls(); pControls = pToolbar->GetControls(); pControl = pControls->Add(xtpControlButton, M_FILE_NEW, ""); pControl->PutDescriptionText(_bstr_t("Create a new document")); pDesignerControls->AddControl(pControl); |
|
strider
Groupie Joined: 16 April 2008 Location: United States Status: Offline Points: 26 |
Post Options
Thanks(0)
|
I am having the same problem. Do we need to clone the control, or just add the original one? |
|
ActiveX 13.2.1
Strider |
|
dajya
Newbie Joined: 15 August 2008 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
I also have a same problem. To fix it, i already scanned the sample code supported by extoolkit. And i found out some clue. whenever i implement custom control or popuped control on the toolbar, then whole custom menu related to this toolbar turned disabled or grayed. Is it bugs? or did i commit any mistake? |
|
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
The information in the help file suggests you can add an existing control: AddControl Method Adds an existing command bar control to the collection. Has anyone made any progress on this problem? |
|
Xtreme CommandBars ActiveX v 12.1.0
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You can't add same control to toolbar and designers controls. Create it again : pDesignerControls->Add(xtpControlButton, etc)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
What is AddControl() for, and how would you use it? Is there an easy way to clone a control? CommandBarControl->Copy() needs a CommandBar for its first param. |
|
Xtreme CommandBars ActiveX v 12.1.0
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |