- Buttons
Buttons are all around us in the computer world and in the real one, too. A button is used to invoke a command or, much less often, show a window.
Table 12.1. Do's and Don'ts of Buttons
| Do | Don't |
|---|
- Use GetPreferredSize and ResizeToPreferred to reduce your work
- Avoid using one button for opposite functions without appropriate feedback
- Leave sufficient padding around them
|
- Make them too small or ridiculously large -- like 100 pixels square for the word 'OK' when the font size is 10 point.
- Leave them blank
- Show a menu with one
- Use them for labels
- Change the label font
|
- Checkboxes
Checkboxes are like a light switch with a label attached to it. Aside from turning an option on or off, they can also be used for quickly choosing multiple selections in a list of choices.
Table 12.2. Do's and Don'ts of Checkboxes
| Do | Don't |
|---|
- Label checkboxes so that the user understands ahead of time what clicking on it will do.
- Use care in calculating bounding boxes
- Carefully choose label text
|
- Use them for choosing one item from a list. Use a group of radio buttons instead.
- Use a checkbox in place of a button
- Use a list of checkboxes as a progress indicator
|
- Radio Buttons
Radio buttons are used to choose an exclusive choice from a list of choices. They can also be used to turn an option on or off if you have plenty of space.
Table 12.3. Do's and Don'ts of Radio Buttons
| Do | Don't |
|---|
- Label radio buttons so that the user understands ahead of time what clicking on one will do.
- Use care in calculating bounding boxes
- Set a default value
- Carefully choose label text
|
- Use them individually or use them the same way as checkboxes
- Use more than 5 or 6 in a group
|
- Control Groups
Control groups, namely, the BBox class, are often abused because they are not well-understood. Control groups are for visually associating different controls which work together for a common function. Unfortunately, they are most often used just for fluff.
Table 12.4. Do's and Don'ts of Control Groups
| Do | Don't |
|---|
- Label control group
- Use control groups when there are lots of controls in window
|
- Use a control group to label a single control
- Nest control groups
- Use a control group around all controls in a window
- Mix control group border styles
|
- Sliders
Sliders are a good way to allow a user to choose a value that must be within a certain range, especially if the effect isn't exactly concrete or the value has no meaning to the user. Good uses for sliders include setting volume, mouse acceleration, and movie playback position.
Table 12.5. Do's and Don'ts of Sliders
| Do | Don't |
|---|
- Label the ends of the slider
- Show tick marks for each value if your slider has distinct increments
- Place the largest value at the right or top
- Use the appropriate orientation
- Label each slider position when the increment size changes, such as logarithmically
|
- Use a slider for a progress indicator or scrollbar
- Label each slider position for sliders with fixed increment sizes
|
- Labels
Labels help the user know what a particular control is for. Most of the controls in the BeOS API include and handle their own labels. This section deals with both the labels included with controls and ones created on their own.
Table 12.6. Do's and Don'ts of Labels
| Do | Don't |
|---|
- Label controls
- Use a separate label when layout makes it hard to use a control's built-in label.
- Use proximity to associate labels with their controls
|
- Use a label for large amounts of static text
- Use a separate label object for controls which have label functions built-in
|
- Text Controls
Text controls are one-line editable text boxes. They are useful for entering text into forms.
Table 12.7. Do's and Don'ts of Text Controls
| Do | Don't |
|---|
- Disable characters you don't want in the field
- Try hard to validate text entered
- Make them large enough to accommodate the length of common entries
- Allow clipboard operations when possible
|
- Use a text control for a label
- Make them too small
- Use them for static text
- Arbitrarily limit the number of characters without a very good reason
|
- Text Views
Text views are multiline text controls. They also provide undo, styled text, and a number of other useful text functions.
Table 12.8. Do's and Don'ts of Text Views
| Do | Don't |
|---|
- Disable editing if you use one to display static text
- Allow both undo and selection of text unless there is a good reason not to
- Allow clipboard operations when possible
|
- Use one for single-line input
- Forget to pad the text rectangle inside the text view
|
- Lists
Lists are used to display lots of individual items, possibly in a hierarchy. They can also allow multiple or single selections.
Table 12.9. Do's and Don'ts of List Views
| Do | Don't |
|---|
- Provide a way to select all items in multiple-selection lists.
- Sort your list
|
- Use just enough space to display just a couple of items
- Try to use it to select from hundreds of items. Use a search instead.
- Use list items to toggle options like a list of checkboxes
|
- Tabs
Tabs can be quite handy for displaying multiple views in a small space. Unfortunately, they seem to suffer from being too easy to abuse.
Table 12.10. Do's and Don'ts of Tabs
| Do | Don't |
|---|
- Use tabs to manage and organize otherwise complex dialog windows
- Use a list instead of tabs to manage large numbers of views
|
- Use tabs to select a particular mode
- Nest tab views
- Use so many tabs that a scrolling is needed to see them all
- Place confirm / cancel buttons inside tabs
- Overlay toolbars by using tabs
- Use vertical text with vertical tabs
- Use tabs on more than one side at once
- Use one tab all by itself
- Use unlabelled icons for tab titles
- Use a scrollbar to scroll a form inside a tab
|
- Scrollbars
Scrollbars, unlike tabs, tend to not be abused. Use them to display more items than can fit on the screen, but don't overuse them.
Table 12.11. Do's and Don'ts of Scrollbars
| Do | Don't |
|---|
- Adjust range and step size when their target view is resized
|
- Scroll forms
- Try to customize their look
- Use them like a slider control
- Nest BScrollViews
|
- Menu Fields
Menu fields are buttons which display a label and pop up a menu when clicked.
Table 12.12. Do's and Don'ts of Menu Fields
| Do | Don't |
|---|
- Use them in place of radio buttons when space is limited
- Remember to follow the menu construction guidelines mentioned in Chapter 9
|
- Use them instead of a menu bar for the main program menu
|
- Pop-up Menus
Pop-up menus differ from regular menus in that they can be invoked from anywhere on the screen.
Table 12.13. Do's and Don'ts of Popup Menus
| Do | Don't |
|---|
- Make pop-up menus sticky
- Use pop-up menus for context menus
|
- Show a pop-up menu by clicking on a button or do other similar nonsensical control daisy-chaining.
- Use a pop-up menu as a tooltip
- Use the primary mouse button to show a context menu
|
- Progress Meters
BStatusBars are used to show progress in BeOS operating systems.
Table 12.14. Do's and Don'ts of Progress Meters
| Do | Don't |
|---|
- Choose a color carefully if you don't use the default
- Use them whenever an operation has the potential to take a while
- Properly label the progress bar
|
- Use a slider or scrollbar for a progress bar.
- Use a progress bar as a control separator
|
- Toolbars
While BeOS doesn't have official support for toolbars, they are easily constructed because they are little more than a collection of graphical buttons. They are used for providing fast access to commonly-used functions.
Table 12.15. Do's and Don'ts of Toolbars
| Do | Don't |
|---|
- Use them to speed up access to common functions
- Avoid bright colors
- Make the function of each button obvious from the icons used
- Make toolbar buttons look like buttons and look clickable
|
- Add a toolbar just for looks
- Scroll toolbars
- Use put too many buttons in a toolbar or have too many toolbars on the screen
|