IconPopup Item

The IconPopup dialog item can be used to display an icon along with an arrow, which indicates that a drop down box can be displayed containing a ComboBox, Menu, or group of dialog items. The icon portion of the IconPopup can be connected to the arrow or not. If not, the icon portion can be used as a toggle button, with an on/off value, or as a command button.

v8iconpopup.jpg

Item resource definition

The icon popup item is defined in a resource file with the following structure:

typedef struct ditem_iconpopuprsc
{
ULong commandNumber;
ULong commandSource;
long synonymsId;
ULong helpInfo;
ULong helpSource;
long itemHookId;
long itemHookArg;
ULong attributes;
long iconId;
ULong iconType; // 0 for RTYPE_IconCmdSmallIcon or Large
ULong mask; // For Toggle portion
char invertFlag;
ULong itemType; // type of item to popup, ie. RTYPE_Container
long itemId; // id of item to popup, ie. CONTAINERID_xxx
#if defined (resource)
char label[];
char accessStr[];
#else
long labelLength;
char label[1];
#endif
#if defined (resource)
resourceclass DItem_IconPopupRsc RTYPE_IconPopup extendedAttributes,
extendedIntAttributes, extendedWideAttributes;
#define IconPopup RTYPE_IconPopup
#endif

The DItem_IconPopupRsc structure has the following unique fields. (See "Common Item Resource Fields" for a description of any field not in this table).

Field Description
attributes Specifies the attributes of the icon popup. This field is constructed by combining the constants from the attributes table (below) with the logical OR operator.
iconId Specifies the Id of icon to display. The mdlDialog_iconPopupSetIcon and mdlDialog_iconPopupSetPressedIcon functions may be called to change the icons displayed for the normal and pressed states.
iconType Specifies the type of the icon to display.
mask Similar to the ToggleIcon resource, if invertFlag is FALSE, when the toggle button is ON (depressed and checked) the bitwise OR operator combines mask with the variable specified by accessStr. When the toggle button is OFF (raised and unchecked) the bitwise AND operator combines the 1's complement of mask with the varaible specified by accessStr.
If invertFlag is TRUE, when the toggle button is OFF (raised and unchecked) the bitwise OR operator combines mask with the variable specified by accessStr. When the toggle button is ON (depressed and checked) the bitwise AND operator combines the 1's complement of mask with the variable specified by accessStr.
invertFlag See the description for mask.
itemType Specifies the Type of the item to display in the drop down box. Valid types are RTYPE_ComboBox, RTYPE_PopupMenu, RTYPE_Container, and RTYPE_DialogItemList.
itemId Specifies the Id of the item to display in the drop down box. See itemType for valid dialog item types.
attributes Value Meaning
ICONPOPUPATTR_CONNECTED Indicates the icon and arrow portions are connected.
ICONPOPUPATTR_PADCORNER Indicates the lower right corner of the drop down box should be padded with space.
ICONPOPUPATTR_NOTOGGLE Indicates this icon popup does not act as a toggle button.
ICONPOPUPATTR_PADBOTTOM Indicates the bottom of the drop down box should be padded with space.
ICONPOPUPATTR_NOLABEL Indicates that a label should no be displayed.
ICONPOPUPATTR_NORESTOREFOCUS Indicates that focus should not be restored to the icon popup item after the drop down box is closed.

IconPopup functions

mdlDialog_iconPopupGetInfo

mdlDialog_iconPopupSetInfo

mdlDialog_iconPopupSetIcon

mdlDialog_iconPopupSetPressedIcon

mdlDialog_iconPopupSetIconColors


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.