The tab page list item DialogItemRsc entry is included in the dialog box item list.

Item List Specification

The DialogItemRsc field extent specifies the location and size of the tab page list item. Depending on the placement of the tabs (top, bottom, left, right), the x position specifies the location of the left side of the tab page area or the left side of the tabs. Similarly, depending on the tab placement, the y position specifies either the top of the tabs to be included in the list or the top of the tab page display area. The size of the tab page area depends on the width and height fields. If width is 0, the width of the tab page area is based on the positioning and sizes of the different items on each of the tab pages. If height is 0, the height of the tab page area is based on the sizes of the items on the pages.

The following is an example of an item list specification for the tab page list item.

{{B1X,GENY(1),TPLW,0}, TabPageList, TPLISTID_ONE, ON, 0,"",""},

Item Resource Specification

The tab page list resource is defined in a resource file along with the actual tab page resources themselves. Tab page list resources are defined by the following structure:

typedef struct ditem_tabpagelistrsc
{
long width; // dialog coords //
long height; // dialog coords //
long synonymsId;
ULong helpInfo;
ULong helpSource;
long itemHookId;
long itemHookArg;
ULong attributes;
#if defined (resource)
char label[];
DialogItemRsc itemList[];
#else
long labelLength;
char label[1];
#endif
#if defind (resource)
#define TabPageList RTYPE_TabPageList
#endif

The DItem_TabPageListRsc structure defines the list of DItem_TabPageRsc resource Ids which comprise the tab page list. This structure has the following unique fields. (See "Common item resource fields" for a description of any field not in this table.)

Field Description
width Specifies the overall width of the tab page display area, including the area for the tabs.
height Specifies the overall height of the tab page display area, including the area for the tabs.
label Unused and should be set to "".
itemList An array of DialogItemRsc and lists the tab pages contained in this tab page list.
attributes Specifies the attributes of the tab page list item. It is constructed by combining the constants from the attributes table (below) with the logical OR operator.
Value Description
TABATTR_DEFAULT Tab Attributes default includes: Tabs across the top, Single row of tabs (if tabs are too wide for display area, up-down buttons are generated for tab navigation), Tabs variable sized, centered labels & centered icons Tabs are medium height
TABATTR_TABSBOTTOM Tabs across the bottom
TABATTR_TABSLEFT Tabs along the left
TABATTR_TABSRIGHT Tabs along the right
TABATTR_MULTIROW Show multiple rows of tabs if too wide for a single row
TABATTR_TABSFITPAGEWIDTH Tabs sized to fit the page area
TABATTR_TABSFIXEDWIDTH Width of tabs based on largest label
TABATTR_LABELLEFTJUSTIFY Left justify the tab label
TABATTR_LABELRIGHTJUSTIFY Right justify the tab label
TABATTR_ICONLEFTJUSTIFY Left justify the tab icon
TABATTR_ICONRIGHTJUSTIFY Right justify the tab icon
TABATTR_TABSSHORT Short tabs
TABATTR_TABSTALL Tall tabs

The following is an example of a tab page list item resource.

DItem_TabPageListRsc TPLISTID_ONE =
{
TXT_DialogTabs,
{
{{0,0,0,0}, TabPage, TABPAGEID_OPTIONS, ON, 0,"",""},
{{0,0,0,0}, TabPage, TABPAGEID_RADIOS, ON, 0,"",""},
{{0,0,0,0}, TabPage, TABPAGEID_SCALES, ON, 0,"",""},
}
};

Item Hook Function Messages

The following messages are sent to item hook functions that are attached to tab page list items: DITEM_MESSAGE_CREATE, DITEM_MESSAGE_DESTROY, DITEM_MESSAGE_SYNCHRONIZE, DITEM_MESSAGE_BUTTON, DITEM_MESSAGE_KEYSTROKE, DITEM_MESSAGE_STATECHANGED, DITEM_MESSAGE_GETSTATE and DITEM_MESSAGE_SETSTATE.

-When working with tab page items, it is recommended that you use rItem functions, such as mdlDialog_rItemEnabledStateSet, instead of itemIndex functions because items are only in the DialogItemList when their parent TabPage is the current page. The rItem functions are prototyped in msritem.fdf.


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