public TreeViewSection() { var layout = new DynamicLayout(); layout.BeginHorizontal(); layout.Add(new Label()); layout.BeginVertical(); layout.BeginHorizontal(); layout.Add(null); layout.Add(allowExpanding = new CheckBox{ Text = "Allow Expanding", Checked = true }); layout.Add(allowCollapsing = new CheckBox{ Text = "Allow Collapsing", Checked = true }); layout.Add(RefreshButton()); layout.Add(null); layout.EndHorizontal(); layout.EndVertical(); layout.EndHorizontal(); treeView = ImagesAndMenu(); layout.AddRow(new Label{ Text = "Simple" }, Default()); layout.BeginHorizontal(); layout.Add(new Panel()); layout.BeginVertical(); layout.AddSeparateRow(InsertButton(), AddChildButton(), RemoveButton(), ExpandButton(), CollapseButton(), null); layout.AddSeparateRow(LabelEditCheck(), EnabledCheck(), null); layout.EndVertical(); layout.EndHorizontal(); layout.AddRow(new Label{ Text = "With Images\n&& Context Menu" }, treeView); layout.AddRow(new Panel(), HoverNodeLabel()); layout.Add(null, false, true); Content = layout; }
public PrintDialogSection() { this.DataContext = settings; var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.BeginVertical(); layout.BeginHorizontal(); layout.Add(null); layout.BeginVertical(Padding.Empty); layout.AddSeparateRow(null, ShowPrintDialog(), null); layout.AddSeparateRow(null, PrintFromGraphicsWithDialog(), null); layout.AddSeparateRow(null, PrintFromGraphics(), null); layout.EndBeginVertical(); layout.Add(PrintDialogOptions()); layout.Add(null); layout.EndVertical(); layout.Add(null); layout.EndHorizontal(); layout.EndVertical(); layout.AddSeparateRow(null, PageRange(), Settings(), null); layout.Add(null); Content = layout; }
public BrushSection() { var layout = new DynamicLayout(); brush = solidBrush = Brushes.LightSkyBlue; gradientBrush = new LinearGradientBrush(Colors.AliceBlue, Colors.Black, new PointF(0, 0), new PointF(100f, 100f)); //gradientBrush = new LinearGradientBrush (new RectangleF (0, 0, 50, 50), Colors.AliceBlue, Colors.Black, 10); gradientBrush.Wrap = GradientWrapMode.Repeat; textureBrush = new TextureBrush(image, 0.5f); brush = textureBrush; ScaleX = 100f; ScaleY = 100f; drawable = new Drawable { Size = new Size(300, 200) }; drawable.Paint += (sender, pe) => Draw(pe.Graphics); layout.AddSeparateRow(null, BrushControl(), UseBackgroundColorControl(), null); if (Platform.Supports<NumericUpDown>()) { matrixRow = layout.AddSeparateRow(null, new Label { Text = "Rot" }, RotationControl(), new Label { Text = "Sx" }, ScaleXControl(), new Label { Text = "Sy" }, ScaleYControl(), new Label { Text = "Ox" }, OffsetXControl(), new Label { Text = "Oy" }, OffsetYControl(), null); matrixRow.Table.Visible = false; } gradientRow = layout.AddSeparateRow(null, GradientWrapControl(), null); gradientRow.Table.Visible = false; layout.AddSeparateRow(null, drawable, null); layout.Add(null); this.Content = layout; }
void Init() { _comboBoxServices = new ComboBox(); _comboBoxServices.SelectedIndexChanged += _comboBoxServices_SelectedIndexChanged; _textAreaInfo = new TextArea{Size=new Size(-1,200)}; _textAreaInfo.Enabled = false; _textAreaResult = new TextArea(); _textAreaResult.Text = "If you wanna call one service, you can do like this:\n" + "dynamic ToBase64 = PluginServiceProvider.GetService(\"ToBase64\");\n" + "var result = ToBase64(new PluginParameter(\"str\", \"Test\"));\n" + "//result=\"VGVzdA==\""; _textAreaResult.Enabled = false; var layout = new DynamicLayout {Padding = new Padding(10, 10)}; layout.AddSeparateRow( new Label {Text = "The Registered Services", VerticalAlign = VerticalAlign.Middle}, _comboBoxServices); layout.AddSeparateRow(_textAreaInfo); layout.AddSeparateRow(_textAreaResult); Content = layout; Title = "Developer Tool"; Size = new Size(400, 400); }
Control Default() { var control = new ComboBox(); LogEvents(control); var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) }; layout.Add(TableLayout.AutoSized(control)); layout.AddSeparateRow(AddRowsButton(control), RemoveRowsButton(control), ClearButton(control), SetSelected(control), ClearSelected(control), null); layout.AddSeparateRow(GetEnabled(control), GetReadOnly(control), AutoComplete(control), ShowComboText(control), SetComboText(control), null); return layout; }
public PenSection() { PenThickness = 4; var layout = new DynamicLayout(); layout.AddSeparateRow(null, PenJoinControl(), PenCapControl(), DashStyleControl(), null); layout.AddSeparateRow(null, PenThicknessControl(), null); layout.AddSeparateRow(GetDrawable()); Content = layout; }
public PenSection() { PenThickness = 4; var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, PenJoinControl(), PenCapControl(), DashStyleControl(), null); if (Platform.Supports<NumericUpDown>()) layout.AddSeparateRow(null, PenThicknessControl(), null); layout.AddCentered(GetDrawable()); Content = layout; }
public WindowsSection() { var layout = new DynamicLayout(); layout.AddSeparateRow(null, Resizable(), Minimizable(), Maximizable(), ShowInTaskBar(), TopMost(), null); layout.AddSeparateRow(null, new Label { Text = "Window Style" }, WindowStyle(), null); layout.AddSeparateRow(null, new Label { Text = "Window State" }, WindowState(), null); layout.AddSeparateRow(null, CreateChildWindowButton(), null); layout.AddSeparateRow(null, BringToFrontButton(), null); layout.Add(null); Content = layout; }
public MousePositionSection () { var layout = new DynamicLayout (); layout.AddSeparateRow (null, new Label { Text = "Mouse Position (in screen co-ordinates)"}, MousePositionLabel (), null); layout.AddSeparateRow (null, new Label { Text = "PointFromScreen" }, PointFromScreen (), null); layout.AddSeparateRow (null, new Label { Text = "PointToScreen" }, PointToScreen (), null); layout.AddSeparateRow (null, new Label { Text = "Buttons" }, Buttons (), null); layout.Add (null); SetLabels (); Content = layout; }
void Init() { _tbxShellData = new TextArea {Size = new Size(-1, 200)}; _tbxMsg = new TextBox(); _btnShowMsgInStatus = new Button {Text = "Show Msg In Status", Width = 150}; _btnShowMsgInStatus.Click+=btn_showMsgInStatus_Click; _btnShowMessageBox = new Button { Text = "Show Msg In Message", Width = 150 }; _btnShowMessageBox.Click+=btn_showMessageBox_Click; _btnCreateNewTabPage = new Button { Text = "Create New TabPage", Width = 150 }; _btnCreateNewTabPage.Click+=btn_createNewTabPage_Click; // Test var btnTest = new Button {Text = "Test", Width = 150}; btnTest.Click += btnTest_Click; var layout = new DynamicLayout {Padding = new Padding(10, 10), Size = new Size(10, 10)}; layout.AddRow(new Label() { Text = "ShellData"}); layout.AddRow(_tbxShellData); layout.AddSeparateRow(new Label() { Text = "Msg", VerticalAlign = VerticalAlign.Middle }, _tbxMsg, null); layout.AddAutoSized(_btnShowMsgInStatus); layout.AddAutoSized(_btnShowMessageBox); layout.AddAutoSized(_btnCreateNewTabPage); layout.AddAutoSized(btnTest); layout.Add(null); this.Content = layout; }
public LabelSection() { var layout = new DynamicLayout(); layout.Add(NormalLabel()); layout.Add(FontLabel()); layout.Add(NoWrapLabel()); layout.AddSeparateRow(null, UnderlineLabel(), HotkeyLabel(), HotkeyUnderlineLabel(), null); layout.AddSeparateRow(null, ColorLabel(), BackgroundColorLabel(), null); layout.Add(CenterLabel()); layout.Add(RightLabel()); layout.Add(MiddleLabel(), yscale: true); layout.Add(BottomLabel(), yscale: true); Content = layout; }
public MousePositionSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) }; layout.Add(null); layout.AddSeparateRow(null, "Mouse Position (in screen co-ordinates)", MousePositionLabel(), null); layout.AddSeparateRow(null, "PointFromScreen", PointFromScreen(), null); layout.AddSeparateRow(null, "PointToScreen", PointToScreen(), null); layout.AddSeparateRow(null, "Mouse.Buttons", Buttons(), null); layout.AddSeparateRow(null, "Keyboard.ModifierKeys", Modifiers(), null); layout.Add(null); SetLabels(); Content = layout; }
public LabelSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.Add(NormalLabel()); layout.Add(FontLabel()); layout.Add(WrapLabel()); layout.AddSeparateRow(null, UnderlineLabel(), HotkeyLabel(), HotkeyUnderlineLabel(), null); layout.AddSeparateRow(null, ColorLabel(), BackgroundColorLabel(), null); layout.Add(CenterLabel()); layout.Add(RightLabel()); layout.Add(MiddleLabel(), yscale: true); layout.Add(BottomLabel(), yscale: true); Content = layout; }
public JabbRAuthDialog(string serverAddress, string appName) { this.ServerAddress = serverAddress; this.AppName = appName; this.DisplayMode = DialogDisplayMode.Attached; this.ClientSize = defaultSize; this.Resizable = true; this.Title = "JabbR Login"; var baseDir = Path.Combine(EtoEnvironment.GetFolderPath(EtoSpecialFolder.ApplicationResources), "Styles", "default"); webserver = new HttpServer(baseDir); LocalhostTokenUrl = new Uri(webserver.Url, "Authorize"); webserver.StaticContent.Add("/", AuthHtml(true)); webserver.StaticContent.Add("/Authorize", GetUserIDHtml()); webserver.ReceivedRequest += HandleReceivedRequest; web = new WebView(); web.DocumentLoaded += HandleDocumentLoaded; web.Url = webserver.Url; var layout = new DynamicLayout(); layout.Add(web, yscale: true); layout.AddSeparateRow(Padding.Empty).Add(null, this.CancelButton()); Content = layout; }
public ButtonSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddAutoSized(NormalButton(), centered: true); layout.AddAutoSized(LongerButton(), centered: true); layout.AddAutoSized(DefaultSizeButton(), centered: true); layout.AddAutoSized(ColourButton(), centered: true); layout.AddAutoSized(DisabledButton(), centered: true); layout.Add(StretchedButton()); layout.AddSeparateRow(null, new Label { Text = "Image Position:", VerticalAlignment = VerticalAlignment.Center }, ImagePositionControl(), ClearMinimumSizeControl(), null); layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(smallImage)), TableLayout.AutoSized(ImageTextButton(smallImage)), null); layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(largeImage)), TableLayout.AutoSized(ImageTextButton(largeImage)), null); layout.Add(null); Content = layout; }
public WindowsSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, Resizable(), Minimizable(), Maximizable(), CreateCancelClose(), null); layout.AddSeparateRow(null, ShowInTaskBar(), TopMost(), null); layout.AddSeparateRow(null, "Type", CreateTypeControls(), null); layout.AddSeparateRow(null, "Window Style", WindowStyle(), null); layout.AddSeparateRow(null, "Window State", WindowState(), null); layout.AddSeparateRow(null, CreateInitialLocationControls(), null); layout.AddSeparateRow(null, CreateClientSizeControls(), null); layout.AddSeparateRow(null, CreateMinimumSizeControls(), null); layout.AddSeparateRow(null, CreateChildWindowButton(), null); layout.AddSeparateRow(null, BringToFrontButton(), null); layout.Add(null); Content = layout; }
public GraphicsPathSection() { StartFigures = true; PenThickness = 1; var layout = new DynamicLayout(); layout.AddSeparateRow(null, StartFiguresControl(), CloseFiguresControl(), ConnectPathControl(), null); layout.AddSeparateRow(null, PenThicknessControl(), PenJoinControl(), PenCapControl(), null); layout.AddSeparateRow(null, ShowBounds(), CurrentPoint(), null); layout.BeginVertical(); layout.AddRow(new Label { Text = "Draw Line Path" }, DrawLinePath()); layout.AddRow(new Label { Text = "Fill Line Path" }, FillLinePath()); layout.EndVertical(); layout.Add(null); Content = layout; }
public ButtonSection() { var layout = new DynamicLayout(); layout.AddAutoSized(NormalButton(), centered: true); layout.AddAutoSized(LongerButton(), centered: true); layout.AddAutoSized(DefaultSizeButton(), centered: true); layout.AddAutoSized(ColourButton(), centered: true); layout.AddAutoSized(DisabledButton(), centered: true); layout.Add(StretchedButton()); layout.AddSeparateRow(null, new Label { Text = "Image Position:", VerticalAlign = VerticalAlign.Middle }, ImagePositionControl(), null); layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(smallImage)), TableLayout.AutoSized(ImageTextButton(smallImage)), null); layout.AddSeparateRow(null, TableLayout.AutoSized(ImageButton(largeImage)), TableLayout.AutoSized(ImageTextButton(largeImage)), null); layout.Add(null); Content = layout; }
public FontDialogSection() { var layout = new DynamicLayout(new Size(5, 5)); layout.AddSeparateRow(null, PickFont(), PickFontWithStartingFont(), SetToFontFamily(), null); layout.AddSeparateRow(null, new Label { Text = "Set Font Family", VerticalAlign = VerticalAlign.Middle }, PickFontFamily(), null); layout.AddSeparateRow(null, FontList(), FontStyles(), FontSizes(), null); layout.AddSeparateRow(null, new Label { Text = "Style:" }, BoldFont(), ItalicFont(), UnderlineFont(), StrikeoutFont(), null); var tabs = new TabControl(); tabs.TabPages.Add(new TabPage(Preview()) { Text = "Preview" }); tabs.TabPages.Add(new TabPage(Metrics()) { Text = "Metrics" }); layout.Add(tabs, yscale: true); UpdatePreview(Fonts.Serif(18, FontStyle.Bold)); Content = layout; }
public FontDialogSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, PickFont(), PickFontWithStartingFont(), SetToFontFamily(), null); layout.AddSeparateRow(null, new Label { Text = "Set Font Family", VerticalAlignment = VerticalAlignment.Center }, PickFontFamily(), null); layout.AddSeparateRow(null, FontList(), FontStyles(), FontSizes(), null); layout.AddSeparateRow(null, new Label { Text = "Style:" }, BoldFont(), ItalicFont(), UnderlineFont(), StrikeoutFont(), null); var tabs = new TabControl(); tabs.Pages.Add(new TabPage { Text = "Preview", Content = Preview() }); tabs.Pages.Add(new TabPage { Text = "Metrics", Content = Metrics() }); layout.Add(new Panel { MinimumSize = new Size(100, 150), Content = tabs }, yscale: true); UpdatePreview(Fonts.Serif(18, FontStyle.Bold)); Content = layout; }
public SplitterSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.Add(null); var xthemed = new CheckBox { Text = "Use Themed Splitter" }; layout.AddCentered(xthemed); layout.AddSeparateRow(null, Test1WithSize(), Test1AutoSize(), null); layout.AddSeparateRow(null, Test1WithFullScreenAndSize(), Test1FullScreenAndAutoSize(), null); layout.AddSeparateRow(null, Test2WithSize(), Test2AutoSize(), null); layout.AddCentered(TestDynamic()); layout.AddCentered(TestInitResize()); layout.AddCentered(TestHiding()); layout.Add(null); Content = layout; xthemed.CheckedChanged += (s, e) => { useThemed = xthemed.Checked == true; }; }
public DockLayoutExpansion() { var layout = new DynamicLayout(); defaultScrollable = new Scrollable(); layout.AddSeparateRow(null, ExpandContentWidth(), ExpandContentHeight(), null); layout.Add(Default(), yscale: true); layout.Add(ExpandedWidth(), yscale: true); layout.Add(ExpandedHeight(), yscale: true); Content = layout; }
public GraphicsPathSection() { StartFigures = true; PenThickness = 1; AntiAlias = true; var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, StartFiguresControl(), CloseFiguresControl(), ConnectPathControl(), AntiAliasControl(), null); if (Platform.Instance.Supports<NumericUpDown>()) layout.AddSeparateRow(null, PenThicknessControl(), PenJoinControl(), PenCapControl(), null); layout.AddSeparateRow(null, ShowBounds(), CurrentPoint(), null); layout.BeginVertical(); layout.AddRow(new Label { Text = "Draw Line Path" }, DrawLinePath()); layout.AddRow(new Label { Text = "Fill Line Path" }, FillLinePath()); layout.EndVertical(); layout.Add(null); Content = layout; }
public PreferencesDialog(Configuration config) { this.config = config; this.MinimumSize = new Size(200, 300); this.Title = "JabbReto Preferences"; this.Resizable = true; var layout = new DynamicLayout(this); layout.Add(Tabs(), yscale: true); layout.AddSeparateRow(null, this.CancelButton(), this.OkButton(clicked: SaveData)); }
public TableLayoutExpansion() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; defaultScrollable = new Scrollable(); layout.AddSeparateRow(null, ExpandContentWidth(), ExpandContentHeight(), null); layout.Add(Default(), yscale: true); layout.Add(ExpandedWidth(), yscale: true); layout.Add(ExpandedHeight(), yscale: true); Content = layout; }
/// <summary> /// Required public constructor with NO parameters /// </summary> public SampleCsEtoPanel() { Title = GetType().Name; var hello_button = new Button { Text = "Hello" }; hello_button.Click += (sender, e) => OnHelloButton(); var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(hello_button, null); layout.Add(null); Content = layout; }
void Init() { //_textAreaWelcome _textAreaWelcome = new TextArea() {Size = new Size(418, 277), Text = AltStrRes.Disclaimer}; _textAreaWelcome.Wrap = true; _textAreaWelcome.Enabled = false; //_checkBoxNoDisplay _checkBoxNoDisplay = new CheckBox() { Text = AltStrRes.DontDisplayAgain}; //_buttonNo _buttonNo = new Button() { Text = AltStrRes.No}; _buttonNo.Click += delegate { if (_checkBoxNoDisplay.Checked == true) { _setting.IsShowDisclaimer = false; //保存Setting到xml InitWorker.SaveSettingToXml(AppEnvironment.AppPath, _setting); //重新初始化GlobalSetting InitWorker.InitGlobalSetting(AppEnvironment.AppPath); } //Application.Instance.Quit(); Environment.Exit(0); }; //_buttonYes _buttonYes = new Button() {Text = AltStrRes.Yes}; _buttonYes.Click += delegate { if (_checkBoxNoDisplay.Checked == true) { _setting.IsShowDisclaimer = false; //保存Setting到xml InitWorker.SaveSettingToXml(AppEnvironment.AppPath, _setting); //重新初始化GlobalSetting InitWorker.InitGlobalSetting(AppEnvironment.AppPath); } Close(); }; var layout = new DynamicLayout(); layout.AddRow(_textAreaWelcome); layout.AddSeparateRow(_checkBoxNoDisplay,null, _buttonNo, _buttonYes); layout.AddRow(null); Content = layout; Size = new Size(460,370); Icon = Icons.AltmanIcon; ShowInTaskbar = true; Title = AltStrRes.Welcome; }
public ClearSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, UseClearColorControl(), UseGraphicsPathClipControl(), null); layout.BeginVertical(); layout.AddRow(new Label { Text = "Drawable" }, ClearGraphicsTest(), null); layout.AddRow(new Label { Text = "Bitmap (with yellow background)" }, ClearBitmapTest(), null); layout.EndVertical(); layout.Add(null); Content = layout; }
public BrushSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; // defaults ScaleX = 100f; ScaleY = 100f; Center = new PointF(100, 50); GradientOrigin = new PointF(150, 80); Radius = new SizeF(100f, 50f); StartPoint = new PointF(50, 50); EndPoint = new PointF(100, 100); drawable = new Drawable { Size = new Size(450, 400) }; drawable.Paint += (sender, pe) => Draw(pe.Graphics); layout.AddSeparateRow(null, BrushControl(), UseBackgroundColorControl(), null); if (Platform.Supports<NumericUpDown>()) { matrixRow = layout.AddSeparateRow(null, new Label { Text = "Rot" }, RotationControl(), new Label { Text = "Sx" }, ScaleXControl(), new Label { Text = "Sy" }, ScaleYControl(), new Label { Text = "Ox" }, OffsetXControl(), new Label { Text = "Oy" }, OffsetYControl(), null); matrixRow.Table.Visible = false; } gradientRow = layout.AddSeparateRow(null, GradientWrapControl(), null); gradientRow.Table.Visible = false; radialRow = layout.AddSeparateRow(null, "Center:", CenterControl(), "GradientOrigin:", GradientOriginControl(), null); radiusRow = layout.AddSeparateRow(null, "Radius:", RadiusControl(), null); linearRow = layout.AddSeparateRow(null, "Start:", StartPointControl(), "End:", EndPointControl(), null); layout.AddSeparateRow(null, drawable, null); layout.Add(null); this.Content = layout; }
public ClipSection() { var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) }; layout.AddSeparateRow(null, ResetClipControl(), null); layout.BeginVertical(); layout.AddRow(new Label { Text = "Rectangle Clip" }, RectangleClip()); layout.AddRow(new Label { Text = "GraphicsPath Clip" }, PathClip()); layout.EndVertical(); layout.Add(null); Content = layout; }
public Dialog_Legend(LegendParameter parameter, Action <LegendParameter> previewAction = default) { this.Title = $"Legend Parameters - {DialogHelper.PluginName}"; this.Width = 400; this.Icon = DialogHelper.HoneybeeIcon; _vm = new LegendViewModel(parameter, this); var title = new TextBox(); var x = new Eto.Forms.NumericStepper() { MinValue = 0 }; var y = new Eto.Forms.NumericStepper() { MinValue = 0 }; var w = new Eto.Forms.NumericStepper() { MinValue = 1 }; var h = new Eto.Forms.NumericStepper() { MinValue = 1 }; var fontH = new Eto.Forms.NumericStepper() { MinValue = 1 }; var fontColor = new Button(); var decimalPlaces = new Eto.Forms.NumericStepper() { DecimalPlaces = 0, MinValue = 0 }; title.TextBinding.Bind(_vm, _ => _.Title); x.ValueBinding.Bind(_vm, _ => _.X); y.ValueBinding.Bind(_vm, _ => _.Y); w.ValueBinding.Bind(_vm, _ => _.W); h.ValueBinding.Bind(_vm, _ => _.H); fontH.ValueBinding.Bind(_vm, _ => _.FontHeight); fontColor.Bind(_ => _.BackgroundColor, _vm, _ => _.FontColor); fontColor.Command = _vm.FontColorCommand; decimalPlaces.ValueBinding.Bind(_vm, _ => _.DecimalPlaces); var minNum = new Eto.Forms.NumericStepper() { MaximumDecimalPlaces = 5 }; var maxNum = new Eto.Forms.NumericStepper() { MaximumDecimalPlaces = 5 }; var numSeg = new Eto.Forms.NumericStepper() { DecimalPlaces = 0, MinValue = 1 }; var continuous = new CheckBox(); var horizontal = new CheckBox(); minNum.ValueBinding.Bind(_vm, _ => _.Min); maxNum.ValueBinding.Bind(_vm, _ => _.Max); numSeg.ValueBinding.Bind(_vm, _ => _.NumSeg); continuous.CheckedBinding.Bind(_vm, _ => _.Continuous); horizontal.CheckedBinding.Bind(_vm, _ => _.IsHorizontal); minNum.Bind(_ => _.Enabled, _vm, _ => _.IsNumberValues); maxNum.Bind(_ => _.Enabled, _vm, _ => _.IsNumberValues); numSeg.Bind(_ => _.Enabled, _vm, _ => _.IsNumberValues); continuous.Bind(_ => _.Enabled, _vm, _ => _.IsNumberValues); var colorPanel = GenColorControl(); var tb = new TabControl(); tb.Pages.Add(new TabPage(colorPanel) { Text = "Colors" }); var general = new DynamicLayout(); general.Height = 280; general.DefaultSpacing = new Eto.Drawing.Size(5, 5); general.DefaultPadding = new Eto.Drawing.Padding(5); general.AddRow("Font height:", fontH); general.AddRow("Font color:", fontColor); general.AddRow("Location X:", x); general.AddRow("Location Y:", y); general.AddRow("Width:", w); general.AddRow("Height:", h); general.AddRow("Decimal places", decimalPlaces); general.AddRow(null, null); tb.Pages.Add(new TabPage(general) { Text = "Settings" }); var OkBtn = new Eto.Forms.Button() { Text = "OK" }; OkBtn.Click += (s, e) => { if (_vm.Validate()) { var lg = _vm.GetLegend(); this.Close(lg); } }; this.AbortButton = new Eto.Forms.Button() { Text = "Cancel" }; this.AbortButton.Click += (s, e) => { this.Close(); }; var preview = new Button() { Text = "Preview", Visible = previewAction != default }; preview.Click += (s, e) => { if (_vm.Validate()) { var lg = _vm.GetLegend(); previewAction?.Invoke(lg); } }; var layout = new Eto.Forms.DynamicLayout(); layout.DefaultSpacing = new Eto.Drawing.Size(5, 2); layout.DefaultPadding = new Eto.Drawing.Padding(4); layout.AddSeparateRow("Legend title:", title); layout.AddSeparateRow("Maximum:", maxNum); layout.AddSeparateRow("Minimum:", minNum); layout.AddSeparateRow("Number of segment:", numSeg); layout.AddSeparateRow("Continuous colors:", continuous); layout.AddSeparateRow("Horizontal:", horizontal); layout.AddSeparateRow(tb); //layout.AddSeparateRow("Font height:", fontH, null, "Font color:", fontColor); //layout.AddSeparateRow("X:", x, "Y:", y, "W", w, "H", h); layout.AddSeparateRow(null, OkBtn, this.AbortButton, null, preview); layout.AddRow(null); this.Content = layout; }
private Dialog_Error(HoneybeeSchema.ValidationReport report) { this.Title = $"Validation Report - {DialogHelper.PluginName}"; this.Width = 800; this.Icon = DialogHelper.HoneybeeIcon; _vm = new ErrorViewModel(report, this); _grid = GenGridView(); var nextBtn = new Button() { Text = ">>" }; var currentErrorIndex = new Label(); var preBtn = new Button() { Text = "<<" }; var showBtn = new Button() { Text = "Show" }; var showParentBtn = new Button() { Text = "Show Parent" }; var moreInfoBtn = new Button() { Text = "More Info" }; var message = new TextArea() { Height = 84 }; message.TextBinding.Bind(_vm, _ => _.CurrentErrorMessage); currentErrorIndex.TextBinding.Bind(_vm, _ => _.CurrentErrorIndex); nextBtn.Bind(_ => _.Enabled, _vm, _ => _.NextBtnEnabled); preBtn.Bind(_ => _.Enabled, _vm, _ => _.PreBtnEnabled); moreInfoBtn.Bind(_ => _.Enabled, _vm, _ => _.MoreBtnEnabled); showBtn.Bind(_ => _.Enabled, _vm, _ => _.ShowBtnEnabled); showParentBtn.Bind(_ => _.Enabled, _vm, _ => _.ShowParentBtnEnabled); nextBtn.Command = _vm.NextBtnCommand; preBtn.Command = _vm.PreBtnCommand; moreInfoBtn.Command = _vm.ErrorLinkCommand; showBtn.Command = _vm.ShowCommand; showParentBtn.Command = _vm.ShowParentCommand; //errorLink.Command = _vm.ErrorLinkCommand; var group = new GroupBox(); group.Bind(_ => _.Text, _vm, _ => _.TotalErrorMessage); group.Size = new Eto.Drawing.Size(-1, -1); var groupLayout = new DynamicLayout(); groupLayout.DefaultSpacing = new Eto.Drawing.Size(5, 5); groupLayout.DefaultPadding = new Eto.Drawing.Padding(5); groupLayout.AddSeparateRow(_grid); groupLayout.AddSeparateRow(preBtn, currentErrorIndex, nextBtn, null, showBtn, showParentBtn, moreInfoBtn); groupLayout.AddSeparateRow(message); group.Content = groupLayout; var validateBtn = new Eto.Forms.Button() { Text = "Re-Validate" }; validateBtn.Bind(_ => _.Visible, _vm, _ => _.ValidateBtnEnabled); validateBtn.Command = _vm.ValidateCommand; var abortButton = new Eto.Forms.Button() { Text = "Close", Height = 24 }; abortButton.Click += (s, e) => { this.Close(); }; var layout = new Eto.Forms.DynamicLayout(); layout.DefaultSpacing = new Eto.Drawing.Size(5, 2); layout.DefaultPadding = new Eto.Drawing.Padding(4); layout.AddSeparateRow(controls: new[] { group }, xscale: true, yscale: true); layout.AddSeparateRow(null, validateBtn, abortButton); this.Content = layout; _vm.UILoaded(); }