[CONNECT MDL] Reuse Dialog Box Item

One of the benefits of MDL dialog boxes is that we can re-use dialog items.  That is, one can define a dialog item once and use it many times, in one or more dialog item lists.

This re-use idiom extends to MicroStation dialog items.  We can incorporate an MDL dialog item into our own container simply by citing its item ID (usually found in /Mstn/MdlApi/dlogids.r.h).  Here's an example...

 CmdItemListRsc ItemList_Example =
 {{

{{ 7*XC,  GENY(10), 12*XC, 0},    OptionButton, OPTIONBUTTONID_SolidSurface,                ON, 0, "", ""},
 }};

Where number OPTIONBUTTONID_SolidSurface is defined in dlogids.r.h.  But OPTIONBUTTONID_SolidSurface is not the dialog item I want to re-use.

The option button I want to include in my own dialog  is Locate Interiors, which you will find in MicroStation's User Preferences dialog.

However, I can't find the item ID of that option button.  Its access string, I believe, is userPrefsP->smartGeomFlags.locateSurfaces.

Parents
  • It is an unpublished item id. Its number is -4225. I don't know if it can be directly used in our own dialog.



  • It is an unpublished item id. Its number is -4225

    Thanks!  Can the header file that contains that definition be made public?  Is there any reason why it is not public?

    It's not hard to write the equivalent resource — but why should we since it already exists?

    #define OPTIONBUTTONID_LocateInteriors 1
    /*----------------------------------------------------------------------+
    |                                                                       |
    |   Option Button Interior Locator  Refer to LOCATE_SURFACES_ defines 	|
    |                                                                       |
    +----------------------------------------------------------------------*/
    DItem_OptionButtonRsc  OPTIONBUTTONID_LocateInteriors =
        {
        NOSYNONYM, NOHELP, LHELPCMD, NOHOOK, NOARG,
        TXT_LocateInteriorsPrompt,
        "userPrefsP->smartGeomFlags.locateSurfaces",
        {
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::Never,	NOMASK, ON, TXT_oBtnNever },
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::ByView,	NOMASK, ON, TXT_oBtnByView },
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::Always,	NOMASK, ON, TXT_oBtnAlways },
        }
        };
    

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Jon Summers 

Reply
  • It is an unpublished item id. Its number is -4225

    Thanks!  Can the header file that contains that definition be made public?  Is there any reason why it is not public?

    It's not hard to write the equivalent resource — but why should we since it already exists?

    #define OPTIONBUTTONID_LocateInteriors 1
    /*----------------------------------------------------------------------+
    |                                                                       |
    |   Option Button Interior Locator  Refer to LOCATE_SURFACES_ defines 	|
    |                                                                       |
    +----------------------------------------------------------------------*/
    DItem_OptionButtonRsc  OPTIONBUTTONID_LocateInteriors =
        {
        NOSYNONYM, NOHELP, LHELPCMD, NOHOOK, NOARG,
        TXT_LocateInteriorsPrompt,
        "userPrefsP->smartGeomFlags.locateSurfaces",
        {
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::Never,	NOMASK, ON, TXT_oBtnNever },
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::ByView,	NOMASK, ON, TXT_oBtnByView },
        {NOTYPE, NOICON, NOCMD, MCMD, LocateSurfacesPref::Always,	NOMASK, ON, TXT_oBtnAlways },
        }
        };
    

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Jon Summers 

Children