DialogAddStaticPulldown Function (Macro)

dialogs.h

HANDLE DialogAddStaticPulldown (HANDLE Handle, short flags, short x, short y, const char *label, void *Popup, unsigned short index);

Adds a static pulldown/popup menu into a dialog box.

DialogAddStaticPulldown uses the pointer Popup to a static pre-filled popup menu structure (popup menus and dialog pulldowns are in fact the same structure) and adds this pulldown menu to the dialog structure associated with the handle Handle at the position (x,y), where the coordinates are relative to the top-left corner of the dialog box.

label is the label which will appear in front of the popup menu (or "" if you don't want any name), and Popup is a prefilled static popup structure (i.e. you must write this popup in your source code; for dynamic pop-ups use DialogAddPulldownEx) of the associated menu. See menus.h for more info about creating static popups. The text must fit into one line of the dialog box.

The parameter index determines where the result value of executing the pulldown menu will be stored, and also indicates what the initially selected option will be. See DialogDo for information on how and where the result values are actually stored.

The order of item creation is very important, as it automatically gives each item an identification number (the first created item will get an identification number of 0, the second one will get 1, and so on). Every function that creates an item (i.e. every function beginning with 'DialogAdd...') will increase this identification number.

DialogAddStaticPulldown works like DialogAddPulldownEx, but only accepts a static pre-filled dialog Popup instead of a handle.

The parameter flags can be a combination of the following, defined in the DialogFlags enumeration:
DF_SCROLLABLE Set this flag if you want this item to be scrollable in a scroll region.
DF_SKIP This item is skipped when browsing through items with the arrow keys.
DF_SCREEN_SAVE The dialog code saves the area underneath the dialog box when it is started, DB_MEMFULL returned if it cannot. If you wish to use this flag, you must then set it with the first item you created in the dialog box.
DF_TAB_ELLIPSES Lines the item up on the right side of the dialog, and draws '......' between the item and its label. This flag is used in the TIOS 'MODE' dialog, for example. It is the default on AMS 1.xx.
DF_TAB_SPACES AMS 2.00 or higher: Like DF_TAB_ELLIPSES, but does not draw any dots.
DF_POPUP_RADIO AMS 2.00 or higher: If this flag is set, the item looks like a normal pulldown menu that you can select, but when you press the right arrow key, it does not pop up as usual, but returns control to the dialog callback function. This enables the programmer to do whatever he/she wants. For example, in the 'MODE' dialog, setting custom units pops up another dialog instead of a pulldown menu.

DialogAddStaticPulldown returns H_NULL in case of an error, may return DB_MEMFULL if you used DF_SCREEN_SAVE, else returns Handle. This routine (as well as all other 'DialogAdd...' routines) may cause heap compression.

DialogAddStaticPulldown is in fact a macro created for your convenience. It calls DialogAdd with D_POPUP as the ItemType parameter.


Uses: DialogAdd