Display Items in Group Box Item

Hello,

In my DialogBox, I want to group dialog items like text-inputs, labels and buttons. The Group Box Item can draw a rectangle around a group of dialog items.

How am I able to group dialog items, so that they are shown in the box.

My Code:

DialogBoxRsc DIALOGID_ViewInfo = {
    DIALOGATTR_DEFAULT | DIALOGATTR_SINKABLE | DIALOGATTR_GROWABLE,
    WIDTH, HEIGHT, NOHELP, MHELP,
    HOOKDIALOGID_ViewInfo, NOPARENTID,
    TXT_DialogTitle,
	{
	BEGIN_VSTACK_LAYOUT(VSTACKLAYOUTID_Main,"")
		BEGIN_HSTACK_LAYOUT(HSTACKLAYOUTID_LabeledItem, "")

					LAYOUT_LABEL_NEXT_LEFT(0, "")
					{{11*XC,   1*YC, 0,  0},		OptionButton,   OPTIONBUTTONID_ViewNo,			ON, 0,							"",					""},
					STRETCH(1)
					{{AUTO_XY,BUTTON_LARGEWIDTH,0},	PushButton,		PUSHBUTTONID_Update,			ON, 0,							"",					""},

		END_LAYOUT
		BEGIN_VSTACK_LAYOUT(VSTACKLAYOUTID_LabeledItem,"")

					{AUTO_XYWH,						Label,			0,								ON,	LABEL_LINKNEXT | ALIGN_LEFT,"",					""},
					{AUTO_XYWH,                     MLText,			MLTEXTID_ViewInfoDescription,	ON, 0,							"",					""},
					SPACING(YC)

		END_LAYOUT

					{AUTO_XYWH,						GroupBox,		0,								ON,	GROUPBOXATTR_BAR,			TXT_SetAcsGroup,	""},

		BEGIN_VSTACK_LAYOUT(0,"")
			BEGIN_HSTACK_LAYOUT(0,"")

					{AUTO_XYWH,						GroupBox,		0,								ON,	0,							TXT_AcsOrigin,		""},
					
				BEGIN_VSTACK_LAYOUT(VSTACKLAYOUTID_Inner,"")

					{AUTO_XYWH,						Text,			TEXTID_AcsOriginX,				ON, 0,							"",					""},
					{AUTO_XYWH,						Text,			TEXTID_AcsOriginY,				ON, 0,							"",					""},
					{AUTO_XYWH,						Text,			TEXTID_AcsOriginZ,				ON, 0,							"",					""},

				END_LAYOUT		
				
					{AUTO_XYWH,						GroupBox,		0,								ON,	0,							TXT_AcsCp,			""},

				BEGIN_VSTACK_LAYOUT(VSTACKLAYOUTID_Inner,"")
									
					{AUTO_XYWH,						Text,			TEXTID_AcsCpX,					ON, 0,							"",					""},
					{AUTO_XYWH,						Text,			TEXTID_AcsCpY,					ON, 0,							"",					""},
					{AUTO_XYWH,						Text,			TEXTID_AcsCpZ,					ON, 0,							"",					""},

				END_LAYOUT
					
				STRETCH(1)
			
			END_LAYOUT
			BEGIN_HSTACK_LAYOUT(HSTACKLAYOUTID_DialogButtons,"")

					STRETCH(1)
					{{AUTO_XY,BUTTON_LARGEWIDTH,0},	PushButton,		PUSHBUTTONID_Acs,				ON, 0,							"",					""},
			
			END_LAYOUT
		END_LAYOUT
	END_LAYOUT
	}
};

The border of the Group Box Item  "Ursprung" should have the text-inputs x,y,z and labels in it. Is using the VSTACK- and HSTACK-Layout a problem here?

[Connect Update 15 C++]

Parents
  • How am I able to group dialog items

    A GroupBox is a visual container, not a logical one.  That is, a GroupBox doesn't 'know' that it contains other dialog items.

    Unless someone can explain how to use the BEGIN_VSTACK_LAYOUT and BEGIN_HSTACK_LAYOUT macros, I prefer to keep it simple.  There are no examples delivered with the SDK.  If you search MicroStationAPI help for BEGIN_VSTACK_LAYOUT, you will find article APIIntroductionMDL.h.  That has a literal HTML description of automatic layouts, which for whatever reason didn't make it into the formatted API help.

    I've edited that help article so that it displays as best it can in a web browser: see here.

    Place a GroupBox with your width and height, then manually add dialog items with coordinates that place them within that GroupBox.

     
    Regards, Jon Summers
    LA Solutions

  • Ok, thanks!

    A GroupBox is a visual container, not a logical one.  That is, a GroupBox doesn't 'know' that it contains other dialog items.

    I hoped, that you can make a VSTACK_LAYOUT part of a GroupBox, or to make "dialog items groups", which behaves in a different way.

    Place a GroupBox with your width and height, then manually add dialog items with coordinates that place them within that GroupBox.

    I found some examples, so I will be able to try it like you said.

    Regards Ole

Reply Children