public Dialog_BoundaryCondition_Outdoors(HB.Outdoors boundaryCondition) { try { Padding = new Padding(5); Resizable = true; Title = $"Energy Boundary Condition - {DialogHelper.PluginName}"; WindowStyle = WindowStyle.Default; MinimumSize = new Size(450, 300); this.Icon = DialogHelper.HoneybeeIcon; var layout = new DynamicLayout() { Padding = new Padding(15) }; var bcLayout = PanelHelper.CreateOutdoorLayout(boundaryCondition); layout.AddRow(bcLayout); DefaultButton = new Button { Text = "OK" }; DefaultButton.Click += (sender, e) => Close(boundaryCondition); AbortButton = new Button { Text = "Cancel" }; AbortButton.Click += (sender, e) => Close(); var buttons = new TableLayout { Padding = new Padding(5, 10, 5, 5), Spacing = new Size(10, 10), Rows = { new TableRow(null, this.DefaultButton, this.AbortButton, null) } }; layout.AddSeparateRow(buttons); layout.AddRow(null); //Create layout Content = layout; } catch (Exception e) { throw e; } }
private Dialog_Message(string message, string title = default) { try { Padding = new Padding(5); Resizable = true; Title = title ?? DialogHelper.PluginName; this.Icon = DialogHelper.HoneybeeIcon; WindowStyle = WindowStyle.Default; MinimumSize = new Size(450, 400); Width = 500; DefaultButton = new Button { Text = "OK" }; DefaultButton.Click += (sender, e) => Close(); var buttons = new TableLayout { Padding = new Padding(5, 10, 5, 5), Spacing = new Size(10, 10), Rows = { new TableRow(null, this.DefaultButton, this.AbortButton, null) } }; var panel = PanelHelper.UpdateMessagePanel(message); //Create layout Content = new TableLayout() { Padding = new Padding(10), Spacing = new Size(5, 5), Rows = { panel, new TableRow(buttons), null } }; } catch (Exception e) { throw new ArgumentException(e.Message); //Rhino.RhinoApp.WriteLine(e.Message); } }