CreateToolBar ( icons$,x,y,width,height,group[,style] )
Parameters
|
icons$ - path to a horizontal BMP icon strip; an empty string selects the built-in runtime strip x,y - position of the toolbar's top-left corner within the group's client area width,height - size of the toolbar group - window or gadget group that owns the toolbar style (optional) - 0 (default); other values are reserved |
Description
|
Creates a native toolbar gadget from an icon strip and returns its handle. Requires Extended language mode. A toolbar is a row of native icon buttons. Its buttons can come from a horizontal icon strip - the same BMP strips BlitzPlus used - with one square icon per button. Pass an empty path to use the embedded, transparent, DPI-aware runtime strip with standard New, Open, Save, Cut, Copy, and Paste icons, which is what the world editor shell does. Clicking a button posts a gadget-action event ($401) with the button's zero-based index in EventData and the toolbar in EventSource. Add hover tips with SetToolBarTips (one comma-separated string), and grey out unavailable commands with DisableToolBarItem / EnableToolBarItem by the same index. Icon strips are copied into the toolbar, so a strip loaded with LoadIconStrip can be freed straight afterwards. Pin the toolbar across the top of the window with SetGadgetLayout toolbar,1,1,1,0. See it working in the world editor shell sample. See also: SetToolBarTips, EnableToolBarItem, DisableToolBarItem, LoadIconStrip, SetGadgetIconStrip, FreeIconStrip. |
Index