Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Customization questions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Customization questions

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


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Topic: Customization questions
    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...






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: 29 September 2008 at 3:49am
Hi,
 
Call EnableCustomize only after all menus/toolbars will be created - it will create "original" state of commandbars.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2008 at 8:59am
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?
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: 29 September 2008 at 2:42pm

Hi,

Yes you need fill DesignerControls. In Customization event or just in initialization code.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2008 at 3:00pm

Originally posted by oleg oleg wrote:

Hi,
Yes you need fill DesignerControls. In Customization event or just in initialization code.
I thought I was filling in the DesignerControls collection in 'initialization code'.    
// ------------------------------------    
// 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);
Back to Top
strider View Drop Down
Groupie
Groupie


Joined: 16 April 2008
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote strider Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2008 at 10:55am

I am having the same problem.  Do we need to clone the control, or just add the original one?

ActiveX 13.2.1

Strider
Back to Top
dajya View Drop Down
Newbie
Newbie


Joined: 15 August 2008
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajya Quote  Post ReplyReply Direct Link To This Post Posted: 09 November 2008 at 9:12pm

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?

Back to Top
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2008 at 9:11am
Originally posted by strider strider wrote:

I am having the same problem.  Do we need to clone the control, or just add the original one?



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

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: 20 November 2008 at 9:23am
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
Back to Top
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2008 at 1:06pm
Originally posted by oleg oleg wrote:

Hi,
You can't add same control to toolbar and designers controls. Create it again : pDesignerControls->Add(xtpControlButton, etc)

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

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