which class should be use instead of CToolBar |
Post Reply |
Author | |
himanshu
Groupie Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Posted: 04 January 2008 at 1:48am |
Hi
I have one class derived from CToolBar.
i am creating an object of that class using "new" wherein i create toolbar using CreateEx method.
Afterward i insert a button into it using
CToolBarCtrl *ctoolbarctrl = NULL;
ctoolbarctrl = &(this->GetToolBarCtrl());
ctoolbarctrl->InsertButton
Now i want to relace this CToolBar class with CXTPCommandBar class
but problem with this is it doesnot support GetToolBarCtrl and some other methods.
Which class should i use instead CToolBar which will support CToolBArCtrl functionalities in my application and i will be able to create new toolbar and menubar.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
See our samples.
We don't have toolbars that support CToolBarCtrl - we create all toolbars from CWnd.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
himanshu
Groupie Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
|
hi
thanks for your quick response
In the example i saw code something like this
CXTPToolBar* pToolBar = (CXTPToolBar*)pCommandBars->Add(str,xtpBarTop);
if (!pToolBar1 || !pToolBar1->LoadToolBar(IDR_MAINFRAME))
{TRACE0("Failed to create toolbar\n");
return ;
}
Here IDR_MAINFRAME is the toolbar id which contains the require buttons.
In my application i am inserting the buttoninfo run time one button at a time .How to support such arrangement.
Could you suggest the example name.
Thanks in advance
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Try this:
pToolBar->GetControls()->Add(xtpControlButton, ID_EDIT_COPY);
see methods of CXTPControls class.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
himanshu
Groupie Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
|
hi
thanks there
If the below added id need to be attched with some string which will act as tooltip for that button how could i attach that
I am not using resource file for loading the string
Some hardcoded strings need to be attached to the button ids.
Could u suggest something
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
CXTPControl* pButton = pToolBar->GetControls()->Add(xtpControlButton, ID_EDIT_COPY);
pButton->SetCaption(,,,);
pButton->SetTooltip(..);
pButton->SetDescription(...);
etc.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
himanshu
Groupie Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
|
if same tooltip need to be set on statusbar which method is used
if i have an HBITMAP type how will i set this to the button
thanks
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
wndStatubar.GetPane(i)->SetTooltip(..);
to set icons call pCommandBars->GetImageManager()->SetIcons(...);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |