SandBar
Friday, November 02, 2007, 11:33 PM | Home Products How to Buy Store Support Corporate |
Getting Started | Working with ToolBars | Working with Menus Getting Started The first step in working with SandBar is to drop an instance of SandBarManager on to your form. When you have added the SandBar library to your toolbar, you will see four components - SandBarManager, ToolBar, MenuBar and FlatComboBox. Typically the only one you will use directly is SandBarManager. The other controls are available for use in a standalone state but will have reduced functionality. Figure 1: The default SandBar layout, when the SandBarManager is first dropped on to your form. When a SandBarManager is dropped on to a form, a default layout of toolbar containers, a toolbar and a menubar is created. The menubar features common top-level menu items such as File, Edit, View etc. The toolbar is empty. A minimum sandbar layout consists of the manager, and four containers. One container is docked to each side of your form. When a container doesn't contain any toolbars it has a zero width or height, so you won't see it. However, these containers are very important to the layout and should never be deleted. If you have an existing win32 menu layout on your form when you create the SandBarManager, the designer will offer to convert it for you. Since it isn't recommended to use the two types of menu together, you should typically answer Yes to this question. The designer will generate a SandBar menu layout equivalent to your existing menu system, copy the names of the components and bind the same events but will not delete the original. Occasionally you will need to select a container, for example to paste a toolbar in to it from the clipboard at design time. Doing this when it contains no toolbars is not immediately obvious since it is not visible. To do this, select it in the dropdown above the property grid. You will see a small selection rectangle appear at the side of your form. You will need to click on this rectangle to restore focus to the designer before it will accept keystrokes. If you wish to remove a SandBar layout from your form, it is recommended that you simply select the manager and delete it. It will dispose of all the related components automatically. The same applies for copying a layout to the clipboard - if you copy the manager, all the components that make up the layout will be copied too. |