Share

CAcUiMRUComboBox

Class Hierarchy

CAdUiComboBox
    CAcUiComboBox
        CAcUiMRUComboBox
            CAcUiArrowHeadComboBox
            CAcUiColorComboBox
            CAcUiLineWeightComboBox
            CAcUiPlotStyleNamesComboBox
            CAcUiPlotStyleTablesComboBox
            CAcUiPredefBlockComboBox
            CAcUiTrueColorComboBox

C++

class CAcUiMRUComboBox : public CAcUiComboBox;

File

acuiComboBox.h

Description

AcUi extends combobox support to automatically manage a MRU (most recently used) list within the control. The basic functionality is provided by the class CAcUiMRUComboBox (derived from CAcUiComboBox). A companion class, CAcUiMRUListBox, provides DrawTip support for the combobox's ComboLBox. This is necessary due to the MRU combobox implementation as an owner-draw control.

The MRU controls display a list of items containing a small image followed by some text. Each item also manages a unique value, referred to as cargo, and maintained as standard Windows ITEMDATA within the control. To be useful, items should not have empty text or text consisting solely of white space. As well, application-defined cargo values should generally be greater than or equal to zero; negative values have special significance within the control (refer to the values in the enumeration ACUI_MRU_CARGO).

To use these classes, the combobox control being subclassed should be non-editable and have the owner-draw, fixed item height and use-strings style bits set. Automatic sorting is not recommended. In other words, ensure CBS_DROPDOWNLIST, CBS_HASSTRINGS and CBS_OWNERDRAWFIXED are set, and CBS_SORT is clear.

The MRU comboboxes display a list of up to six MRU items, as defined by the constant ACUI_MAX_COMBOBOX_MRU. Following the MRU items are up to two optional items. These are followed by stock items for the list. When the combobox list is dropped down, up to two additional items may be added to the list; selecting either of these triggers an event in the control that is usually overridden to provide a pop-up dialog. When the combobox list closes, these two items are automatically removed. For example, a hypothetical control might display the following when the list is dropped down:

User 1

User 2

ByLayer

Item 1

Item 2

Item 3

Other...

In this case, User1 and User2 are MRU items that were previously added to the list. ByLayer represents an optional item (the second optional item is suppressed). Item1, Item2, and Item3 represent stock items that are always present in the list. Other... represents an additional item added when the list was dropped down, and removed when the list closes. Selecting the Other... item triggers an event that lets the user add additional MRU items.

Links

CAcUiMRUComboBox Methods

Was this information helpful?