Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - which class should be use instead of CToolBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

which class should be use instead of CToolBar

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


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post Topic: which class should be use instead of CToolBar
    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.
 
 
 
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: 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
Back to Top
himanshu View Drop Down
Groupie
Groupie


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post 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
 
 
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: 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
Back to Top
himanshu View Drop Down
Groupie
Groupie


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
himanshu View Drop Down
Groupie
Groupie


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post 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
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: 08 January 2008 at 1:55am
wndStatubar.GetPane(i)->SetTooltip(..);
 
to set icons call pCommandBars->GetImageManager()->SetIcons(...);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.172 seconds.