|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
tera t
|
Mar 5, 2007 - 5:30 PM
|
Hi
I want to do processing totally similar to the following samples in CExtControlToolBar.
Thank You
-------------------------------------------------------------------
struct stToolBarInfo { int btnId; // int imgIdx; // int strId; // };
#define XXX_TBAR_BUTTON_NUM 4 const stToolBarInfo cstTBarInfo[XXX_TBAR_BUTTON_NUM] = { {ID_BUTTON_1,0,IDS_BUTTON_1}, {ID_BUTTON_2,1,IDS_BUTTON_2}, {ID_BUTTON_3,2,IDS_BUTTON_3}, {ID_BUTTON_4,3,IDS_BUTTON_4} };
CToolBar m_wndToolBar;
int XXX::Load() {
m_wndToolBar.ModifyStyle(0,TBSTYLE_LIST); m_wndToolBar.LoadBitmap(IDB_XXX_TBAR_IMG); m_wndToolBar.SetButtons(NULL,XXX_TBAR_BUTTON_NUM); m_wndToolBar.SetBarStyle( m_wndToolBar.GetBarStyle() &~CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM &~CBRS_BORDER_RIGHT &~CBRS_BORDER_LEFT );
for(int i=0;i<XXX_TBAR_BUTTON_NUM;i++){ m_wndToolBar.SetButtonInfo(i,cstTBarInfo[i].btId,TBBS_BUTTON,cstTBarInfo[i].imgIdx); CString str(_T("")); str.LoadString(cstTBarInfo[i].strId); m_wndToolBar.SetButtonText(i,(LPCTSTR)str); } }
|
|
Technical Support
|
Mar 6, 2007 - 7:47 AM
|
In Prof-UIS, each toolbar button knows only its command identifier. All other information about the button (its icon, text, tooltip text and status tip text) is stored in the CExtCmdItem object associated with this button. These CExtCmdItem objects in turn are stored in the global g_CmdManager . So you should get/allocate the needed CExtCmdItem command description object first using g_CmdManager->CmdGetPtr() /g_CmdManager->CmdAllocPtr() and then modify its CExtCmdItem::m_*** properties.
|
|