hToolbar = WinXNewToolbar (wButton, hButton, nButtons, hBmpButtons, hBmpGray, hBmpHot, rgbTrans, tooltips, customisable)
Creates a new toolbar, using button images from bitmaps.
Parameter | Description |
---|---|
wButton | The width of a button image in pixels |
hButton | The height of a button image in pixels |
nButtons | The number of button images |
hBmpButtons | A bitmap containing the button images, arrange in a row with no gaps between each image. |
hBmpGray | Same as hBmpButtons, except that these are the images to display when the buttons are disabled. If this parameter is 0, grayed versions of the buttons are generated automatically from hBmpButtons. |
hBmpHot | Same as hBmpButtons, except that these are the images to display when the mouse moves over the buttons. If this parameter is 0, hBmpButtons is used instead. |
rgbTrans | The transparent colour. Where ever this colour occurs in any of the bitmaps, it will be replaced with transparency. Note that toolbars do not support alpha blending. |
toolTips | $$TRUE to enable tooltips, $$FALSE to disable them |
customisable | NOT IMPLEMENTED, SET TO $$FALSE |
The handle to the toolbar on success or 0 on fail
hBmpGray and hBmpHot are optional. If you don't want to specify them explicitly, use 0 for these parameters. If you do not specify bitmaps for these parameters, WinX will generate default images. The images in hBmpButtons do not have to appear in the same order as the buttons on the toolbar will. You are also allowed to include images that will not be used for any buttons. It is very important that the hBmpGray and hBmpHot bitmaps are consistant with the hBmpButtons bitmap, i.e. the image for the first button must be in the same position in hBmpGray and hBmpHot as it is in hBmpButtons and the image for the second button must be in the same position in hBmpGray and hBmpHot as it is in hBmpButtons etc.
wButton, hButton and nButtons refer to the button images, the actual size of the buttons on the toolbar is usually several pixels larger. The actual number of buttons on the toolbar is independant of nButtons, which represents the number of images in the bitmap.
'load the bitmap containing the images hBmpMain = LoadImageA (0, &"toolbar.bmp", $$IMAGE_BITMAP, 0,0, $$LR_LOADFROMFILE) 'this function creates a toolbar, notice that we only need to specify the main bitmap, 'the others are automatically generated if we don't supply them. hToolbar = WinXNewToolbar (32, 32, 7, hBmpMain, 0, 0, 0x00FF00FF, $$TRUE, $$FALSE) |
WinXNewToolbarUsingIls
WinXToolbar_AddButton
WinXSetWindowToolbar