Print Page | Close Window

Programmatic creation of toolbars

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=4773
Printed Date: 24 June 2024 at 9:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Programmatic creation of toolbars
Posted By: aznodak
Subject: Programmatic creation of toolbars
Date Posted: 10 August 2006 at 12:50am

I need to dynamically create a toolbar programmatically without using the apps resource. The user should not be able to modify the toolbar.

The filenames of the toolbar images will be in an simple ascii config file. I need to tie notification of a toolbar button being activated to a unique id I will create on the fly. One function needs to catch all button activation and extract the unique id. Won't know how many buttons will be created until the config file is loaded.

There are so many classes to dig through, so far I have not found anything that directly addresses what I need to do.
 
Any hints on where to start?



Replies:
Posted By: Oleg
Date Posted: 14 August 2006 at 9:13am
Hi,
 
start from Help :) see CXTPControl, CXTPControls, CXTPCommandBar:
 
something like:
 
pToolBar->GetControls()->Add(xtpControlButton, Id);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: akur
Date Posted: 08 September 2006 at 1:39am
I went through this too in the past, maybe this will help you e.g. to create a toolbar in a CXTPDialog.

Creating the toolbar:
    CXTPToolbar *pToolbar = GetCommandBars()->Add(_T("Your Toolbar Name"), xtpBarTop);

Adding a button to this toolbar:
    CXTPControl *pButton = new CXTPControlButton();
    pButton->SetID(nYourButtonID);
    pButton->SetCustomIcon(hYourIconHandle);
    pButton->SetCaption(strYourCaptionText);
    pButton->SetTooltip(strYourTooltipText);
    // Insert button to toolbar:
    pToolbar->GetControls()->Add(pButton);


Hope this helps.



Posted By: Sstar9
Date Posted: 11 September 2006 at 9:43pm

For the Programmatically generated CommandBar, is there any way we could programmtically add a Seperator in between the Controls?

 

 



-------------
Sharing makes life better


Posted By: Oleg
Date Posted: 12 September 2006 at 12:27am
Hi,
pButton->SetBeginGroup(TRUE);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Sstar9
Date Posted: 12 September 2006 at 1:49am
Thank you.. Oleg

-------------
Sharing makes life better



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