| DialogAddPulldownEx | Function (Macro)

dialogs.h

HANDLE DialogAddPulldownEx (HANDLE Handle, short flags, short x, short y, const char *label, HANDLE PopupMenu, unsigned short index);

Adds a pulldown/popup menu into a dialog box. Extended version.

DialogAddPulldownEx adds the pulldown menu PopupMenu 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 MenuHandle is the handle of the associated menu which needs to be created using the PopupNew function (the same functions are used for creating pulldown and popup menus). See menus.h for more info about creating 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.
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.

DialogAddPulldownEx 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.
DialogAddPulldownEx is in fact a macro created for your convenience. It calls DialogAdd with D_HPOPUP as the ItemType parameter. Note that DialogAddPulldownEx is the same macro as DialogAddPulldown except for the parameter flags which is always set to zero in DialogAddPulldown.

Uses: DialogAdd