The individual tab page item DialogItemRsc entries are listed in the item list of the tab page list resource. The items to be displayed on a page are listed in the appropriate tab page resource definition.

v8tabpage.jpg

Item List Specification

The DialogItemRsc field extent is unused for tab page items. The tab page list containing this tab page will place and size the tab according to the tab page list attributes.

The type field should contain TabPage.

The ID determines the DItem_TabPageRsc instance to load.

The attributes field can be ON or OFF, and optionally combined with hidden. It will usually be ON.

The itemArg field is unused and should usually be set to 0.

The label field is unused and should be set to "".

The auxInfo field is unused and should be set to "".

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

{{0,0,0,0}, TabPage, TABPAGEID_OPTIONS, ON, 0,"",""},

Item Resource Specification

The tab page resources are defined by the following structure:

typedef struct ditem_tabpagersc
{
ULong commandNumber;
ULong commandSource;
long synonymsId;
ULong helpInfo;
ULong helpSource;
long itemHookId;
long itemHookArg;
ULong attributes;
ULong iconType;
long iconId;
#if defined (resource)
char label[]; // Default Label //
DialogItemRsc itemList[]; // List of items in this container //
#else
long labelLength;
char label[1];
#endif
#if defined (resource)
#define TabPage RTYPE_TabPage
#endif

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

Field Description
iconType Indicates the type of icon the tab is using. This field should usually be Icon if you are using IconRscs. If not using icons, specify NOTYPE.
iconID Specifies the ID of the icon instance to load and display on the tab. May be used in conjunction with the tab's label. If you are not using icons, specify NOICON. The tab page list attributes for icons determine the placement of the icon on the tab.
label Specifies the tab's label. May be used in conjunction with the tab's icon. The tab page list attributes for labels determine the placement of the label on the tab.
itemList An array of DialogItemRsc that lists the items contained in the display area of this tab page.

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

DItem_TabPageRsc TABPAGEID_OPTIONS=
{
TABATTR_DEFAULT, Icon, ICONID_TabOptions,
TXT_TabPageOptions,
{
{{XRBL,Y11,0,0}, RadioButtonListX, RBLISTXID_TABPLACEMENT,
ON, 0, "", ""},
{{XGRP,Y11-YC,GBW,7*YC}, GroupBox, 0, ON, 0, TXT_TabPlacement, ""},
{{X1,Y16,0,0}, ToggleButton, TOGGLEBTNID_AddTabPage, ON, 0, "", ""},
}
};

-The first item in a tab page item list must have a type and Id combination that is unique within the dialog box. Because most group box's are defined with an id of 0, we recommend you not start a tab page item list with a group box. In the example above, we use the RadioButtonListX as the unique item, as this item occurs only once in the dialog box.

Item Hook Function Messages

The following messages are sent to item hook functions that are attached to tab page 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.