Print Page | Close Window

which class should be use instead of CToolBar

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=9216
Printed Date: 27 September 2024 at 2:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: which class should be use instead of CToolBar
Posted By: himanshu
Subject: which class should be use instead of CToolBar
Date 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.
 
 
 



Replies:
Posted By: Oleg
Date Posted: 04 January 2008 at 2:10am
Hello,
 
See our samples.
We don't have toolbars that support CToolBarCtrl - we create all toolbars from CWnd.


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


Posted By: himanshu
Date Posted: 04 January 2008 at 2:21am
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
 
 


Posted By: Oleg
Date Posted: 04 January 2008 at 2:56am
Hi,
 
Try this:
 
pToolBar->GetControls()->Add(xtpControlButton, ID_EDIT_COPY);
 
see methods of CXTPControls class.


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


Posted By: himanshu
Date Posted: 07 January 2008 at 1:29am
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


Posted By: Oleg
Date Posted: 07 January 2008 at 3:10am
Hi,
 
CXTPControl* pButton = pToolBar->GetControls()->Add(xtpControlButton, ID_EDIT_COPY);
pButton->SetCaption(,,,);
pButton->SetTooltip(..);
pButton->SetDescription(...);
etc.


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


Posted By: himanshu
Date Posted: 07 January 2008 at 4:38am
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


Posted By: Oleg
Date Posted: 08 January 2008 at 1:55am
wndStatubar.GetPane(i)->SetTooltip(..);
 
to set icons call pCommandBars->GetImageManager()->SetIcons(...);


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



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