Updated MessageBoxes and Dialogs Scenarios to use AutoSize

This commit is contained in:
Tig Kindel
2023-12-18 01:27:38 -07:00
parent 2eb4ad1cb1
commit bbb84f812e
2 changed files with 3 additions and 33 deletions

View File

@@ -15,6 +15,7 @@ namespace UICatalog.Scenarios {
X = Pos.Center (),
Y = 1,
Width = Dim.Percent (75),
Height = Dim.AutoSize ()
};
var label = new Label ("Width:") {
@@ -114,20 +115,6 @@ namespace UICatalog.Scenarios {
};
frame.Add (styleRadioGroup);
frame.ForceValidatePosDim = true;
void Top_Loaded (object sender, EventArgs args)
{
frame.Height =
widthEdit.Frame.Height +
heightEdit.Frame.Height +
titleEdit.Frame.Height +
numButtonsEdit.Frame.Height +
glyphsNotWords.Frame.Height +
styleRadioGroup.Frame.Height;
Application.Top.Loaded -= Top_Loaded;
}
Application.Top.Loaded += Top_Loaded;
Win.Add (frame);
label = new Label ("Button Pressed:") {

View File

@@ -14,7 +14,7 @@ namespace UICatalog.Scenarios {
X = Pos.Center (),
Y = 1,
Width = Dim.Percent (75),
Height = 12
Height = Dim.AutoSize ()
};
Win.Add (frame);
@@ -145,24 +145,7 @@ namespace UICatalog.Scenarios {
Y = Pos.Top (label) + 3
};
frame.Add (ckbWrapMessage);
frame.ForceValidatePosDim = true;
void Top_Loaded (object sender, EventArgs args)
{
frame.Height =
widthEdit.Frame.Height +
heightEdit.Frame.Height +
titleEdit.Frame.Height +
messageEdit.Frame.Height +
numButtonsEdit.Frame.Height +
defaultButtonEdit.Frame.Height +
styleRadioGroup.Frame.Height +
2 +
ckbWrapMessage.Frame.Height;
Application.Top.Loaded -= Top_Loaded;
}
//Application.Top.Loaded += Top_Loaded;
label = new Label ("Button Pressed:") {
X = Pos.Center (),
Y = Pos.Bottom (frame) + 4,