A chooser is a small-list selection object. In its inactive mode it looks much like a button or cycle gadget. When the button is pressed using the mouse, a menu displaying the items in the list is displayed.
The chooser operates in either of two modes, pop-up and drop-down. Even though they may operate similarly internally, they are for two different functions. Consult the chooser style guide for information on how to use these two modes.
Advantages that this class provides:
-
Supports window relativity.
-
Supports OS 3.0 BOOPSI Gadget HelpTest.
-
Cycle2Menu style activation.
-
Supports tab-cycle activation and keyboard control.
The chooser has two very distinct modes of operation, pop-up and drop-down. It is important to understand the differences between these two modes and to use the proper mode in the proper context.
Pop up - A pop-up is generally used for setting an application mode or state,
and in many cases it can replace a cycle gadget or MX (radio button) gadget. In this mode, there is a currently active item in the list of selections, which will be displayed in the gadget select button. This has the same advantage of a cycle menu in that it is compact, with the further advantage that all values can be displayed at once and therefore the list of values can be much larger, though generally no more than a dozen items should be displayed.
Drop-down - A drop-down chooser is for performing an action from a list of
available actions. In this mode, the gadget select box contains a title indicating what the actions are for. These actions should all be closely related, and specific to a certain context within the application. This can be used to replace a group of buttons, or a cycle gadget and a button where the cycle gadget modifies the behaviour of the button. Since using the chooser in this mode makes functions effectively hidden, it should generally only be used where compactness is a significant issue.
An alternate use for a drop-down is to use it as a means of accessing a "hot list" for a string or integer gadget. For example, in a word processor you might have a string gadget at the top of the screen for entering the text point size. Beside that you could have a drop-down chooser that lists some common point sizes that would then be copied into your integer gadget and change the text size when you make a selection. When a drop-down is used this way, it is generally desirable not to have the drop-down display a title within the gadget box (pass NULL for CHOOSER_Title) and to make the gadget thin enough so that just the arrow is displayed (use about 20 for GA_Width if not using the chooser within a layout group).