Hi, There,
I need to develop an application with mulitple ( > 10 ) tabs, each with multiple items. These items share some features, such as toggle boxes with the same label. Instead define hundreds of toggles, text items, is there a way to define an array stile items?
Any suggestions will be greatly appreciated.
Ken
If you're using MDL, then take advantage of MDL dialog items. You can define an item once, and use it many times. You can re-use MicroStation dialog items in your own MDL dialogs, too.
Regards, Jon Summers LA Solutions
Hi, Jon,
Thanks for your reply. I am using MDL. Can you advise further on "re-use MicroStation dialog items"?
According to my understanding, you can only use a UI item it the item represents the same data item. For example, a colour selector can only used for selection MicroStation colour.
In my situation, items on each tab of my application represents one data items of a one data object. I am not sure how to reuse them on different tabs.
Regards,
Unknown said:According to my understanding, you can only use a UI item it the item represents the same data item
You can re-use a dialog item if it displays the same type of data. For example, you can use the same text item many times.
Unknown said:For example, a colour selector can only used for selection MicroStation colour
Yes — but that could show MicroStation's active colour or a colour that is stored in your application variable.
Unknown said:I am not sure how to reuse them on different tabs
Just copy the item instance data (in your .r file). It's as simple as that!
/*----------------------------------------------------------------------+ | | Dialog definition contains item instances | +----------------------------------------------------------------------*/ DialogBoxRsc DIALOGID_Ken = { DIALOGATTR_NORIGHTICONS | DIALOGATTR_AUTOUNLOADAPP | DIALOGATTR_DEFAULT, 50 * XC, GENY(17) + 0, NOHELP, MHELP, NOHOOK, NOPARENTID, "Ken's Dialog", { {{ 3*XC, GENY(1), 13*XC, 0}, OptionButton, OPTIONBUTTONID_1, ON, 0, "", ""}, {{ 3*XC, GENY(2), 13*XC, 0}, OptionButton, OPTIONBUTTONID_2, ON, 0, "", ""}, // Re-use OPTIONBUTTONID_1 {{ 3*XC, GENY(3), 13*XC, 0}, OptionButton, OPTIONBUTTONID_1, ON, 0, "", ""}, } };
/*----------------------------------------------------------------------+ | | Option Button Item Resources | +----------------------------------------------------------------------*/ DItem_OptionButtonRsc OPTIONBUTTONID_1 = { NOSYNONYM, NOHELP, LHELP, HOOKITEMID_oBtn_1, OPTNBTNATTR_NEWSTYLE, "", /* TXT_oBtn_List, */ "g_kensGlobalVars.var1", { /* option button is filled dynamically by dialog hook */ } };
DItem_OptionButtonRsc OPTIONBUTTONID_2 = { NOSYNONYM, NOHELP, LHELP, HOOKITEMID_oBtn_2, OPTNBTNATTR_NEWSTYLE, "", /* TXT_oBtn_2, */ "g_kensGlobalVars.var2", { /* option button is filled dynamically by dialog hook */ } };