![]() |
Programmatic creation of toolbars |
Post Reply ![]() |
Author | |
aznodak ![]() Newbie ![]() Joined: 26 July 2005 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
start from Help :) see CXTPControl, CXTPControls, CXTPCommandBar:
something like:
pToolBar->GetControls()->Add(xtpControlButton, Id);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
akur ![]() Senior Member ![]() Joined: 16 May 2006 Status: Offline Points: 139 |
![]() ![]() ![]() ![]() ![]() |
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. ![]() |
|
![]() |
|
Sstar9 ![]() Newbie ![]() Joined: 25 August 2006 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
For the Programmatically generated CommandBar, is there any way we could programmtically add a Seperator in between the Controls?
|
|
Sharing makes life better
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
pButton->SetBeginGroup(TRUE);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sstar9 ![]() Newbie ![]() Joined: 25 August 2006 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
Thank you.. Oleg
|
|
Sharing makes life better
|
|
![]() |
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 |