Professional UI Solutions
Site Map   /  Register
 
 

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.

Forums » Prof-UIS Tech Support » multiple button size in CExtToolControlBar Collapse All
Subject Author Date
delu qiu Jun 23, 2006 - 2:07 PM

Hi,

I want to create a toolbar consist of buttons with multiple size, for example, the left five buttons use 72*48, and right two buttons use 43*32.

Is it possible?



Thanks

Technical Support Jun 24, 2006 - 12:52 PM

Here is how to create a toolbar with buttons of custom size.

1) create two toolbar resources, the first one with 72x48 icons and the second with 43x32 icons;
2) update the command manager from both toolbar resources:

g_CmdManager->UpdateFromToolBar( strCommandProfileName, ID_TOOLBAR_WITH_72x48_ICONS );
g_CmdManager->UpdateFromToolBar( strCommandProfileName, ID_TOOLBAR_WITH_43x32_ICONS );
3) create a toolbar and assign an array of commands with icons of different size:
UINT arrCommandIDs[] = { ID_CMD1, ID_CMD2, ID_CMD3, };
pToolBar->Create( . . . )
pToolBar->SetButtons( arrCommandIDs, sizeof(arrCommandIDs)/sizeof(arrCommandIDs[0]) );
pToolBar->InitContentExpandButton();
The CExtToolControlBar::SetButtons() and CExtToolControlBar::InitContentExpandButton() methods are used here instead of the CExtToolControlBar::LoadToolBar() method. Please note, the arrCommandIDs array should contain command identifiers which are used in toolbar resources.

As a result, you will get the CExtToolControlBar window buttons centered vertically when the toolbar is docked horizontally or floating. The buttons will be centered horizontally when the toolbar is docked vertically.