mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 09:18:01 +01:00
Updated MessageBoxes and Dialogs Scenarios to use AutoSize
This commit is contained in:
@@ -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:") {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user