Toolbars


Toolbars are rows of icons displayed at the top of a window. At this stage, WinX only supports one toolbar and it cannot be customized. I plan to add support for multiple toolbars, rebar containers and toolbar customisation is later releases.

The most complex issue with toolbars is dealing with the images. You have two options. You can create a bitmap containing the images for each button lined up side by side, or you can create an image list. If you want to use standard icons in your toolbar, you'll have to create an image list. The bitmap approach is simpler because WinX can do much of the work for you. To create a toolbar from bitmaps, use the WinXNewToolbar function. To create a toolbar from image lists, use the WinXNewToolbarUsingIls function.

Each button in a toolbar needs 3 sets of images: the button images are displayed whenever the other images aren't, the grayed images are displayed whenever the buttons are disabled and the hot images are displayed when the mouse cursor is on top of the buttons. If you are using the WinXNewToolbar function, you only need to specify the button images. WinX will generate the grayed and hot images automatically. If you are using image lists you can specify the same image list for different sets of images.

To add buttons to a toolbar, use the WinXToolbar_AddButton function. You can also add toggle buttons (which toggled from pressed to unpressed when the user clicks them) using the WinXToolbar_AddToggleButton function; and seperators (which serve no purpose other than to seperate groups of controls) with the WinXToolbar_AddSeperator.

You can add other controls to a toolbar using the WinXToolbar_AddControl function.

Related Links

WinXNewToolbar
WinXNewToolbarUsingIls
WinXToolbar_AddButton
WinXToolbar_AddToggleButton
WinXToolbar_AddSeperator
WinXToolbar_AddControl