ToolBar Problem
Hi,
In a dialog based application, there are a number of pop-menus.
I really want to set toolbars for them. How to setting these toolbars for dialog-based application?
Thanks in advance!
# 1 Re: ToolBar Problem
There examples in Code guru itself if you would care to look under
toolbar
http://www.dev-archive.com/dialog/toolbars.shtml
http://www.dev-archive.com/dialog/PlacingAToolbarOnADlg.shtml
http://www.dev-archive.com/dialog/dlgtoolbar.shtml
http://www.dev-archive.com/dialog/tbdlg_ok.shtml
regards
Prem
# 2 Re: ToolBar Problem
Embed a CToolBar member( say m_wndToolbar ) in Ur dialog class. And also add toolbar template to the dialog resource( say IDR_TOOLBAR1 ). The following code will insert the toolbar to the dialog.
if ( !m_wndToolbar.Create(this ) || !m_wndToolbar.LoadToolBar( IDR_TOOLBAR1 ) )
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolbar.MoveWindow( CRect( 0, 0, 300, 30 ) );
# 3 Re: ToolBar Problem
Thanks for the anwsers!
I am not clearly understand about the relationship bewteen the Menu ID and the toolbar.
In addtion, what are the differences of the toolbar and the functional push-button?
Thanks,
# 4 Re: ToolBar Problem
It is not necessary to have a relationship between menu-IDs and toolbar buttons. But if we provide same id of a menu item to a toolbar item then the same function will be called whether u click the menu or toolbar button.
we can provide the same program functionality either by using push buttons or toolbar. The use of either one is a sole option of the programmer. But in programmatically it is much easier to use toolbar rather than using push buttons in UI issues.
# 5 Re: ToolBar Problem
Ok, i understand. Where can i set the id of the single toolbar in order to find the responding function ot the
toolbar according to its ID?