private void OpenWindowModal(ControlBase control, EventArgs args) { Control.Window window = new Control.Window(this); window.Title = String.Format("Modal Window ({0})", ++m_WindowCount); window.Left = m_Rand.Next(700); window.Top = m_Rand.Next(400); window.Padding = new Padding(6, 3, 6, 6); window.HorizontalAlignment = HorizontalAlignment.Left; window.VerticalAlignment = VerticalAlignment.Top; window.Resizing = Resizing.None; window.MakeModal(true); VerticalLayout layout = new VerticalLayout(window); Control.GroupBox grb = new Control.GroupBox(layout); grb.Text = "Auto size"; layout = new VerticalLayout(grb); { Control.Label label = new Control.Label(layout); label.Margin = Margin.Six; label.Text = "Label text"; Control.Button button = new Control.Button(layout); button.Margin = Margin.Six; button.Text = "Button"; button.Width = 200; } }
private void OpenWindowAutoSizing(ControlBase control, EventArgs args) { Control.Window window = new Control.Window(this); window.Title = String.Format("Window ({0})", ++m_WindowCount); window.Left = m_Rand.Next(700); window.Top = m_Rand.Next(400); window.Padding = new Padding(6, 3, 6, 6); window.HorizontalAlignment = HorizontalAlignment.Left; window.VerticalAlignment = VerticalAlignment.Top; window.Resizing = Resizing.None; VerticalLayout layout = new VerticalLayout(window); Control.GroupBox grb = new Control.GroupBox(layout); grb.Text = "Auto size"; layout = new VerticalLayout(grb); { Control.Label label = new Control.Label(layout); label.Margin = Margin.Six; label.Text = "Label text"; Control.Button button = new Control.Button(layout); button.Margin = Margin.Six; button.Text = "Click Me"; button.Width = 200; label = new Control.Label(layout); label.Margin = Margin.Six; label.Text = "Hide / Show Label"; //label.IsCollapsed = true; button.Clicked += (s, a) => label.IsCollapsed = !label.IsCollapsed; } }
private void OpenWindow(ControlBase control, EventArgs args) { Control.Window window = new Control.Window(GetCanvas()); window.Padding = Padding.Three; window.Title = String.Format("RichLabel Window"); window.DeleteOnClose = true; window.Size = new Size(500, 300); window.Left = 200; window.Top = 100; Control.ScrollControl scroll = new Control.ScrollControl(window); scroll.Dock = Dock.Fill; scroll.EnableScroll(false, true); scroll.AutoHideBars = false; Control.RichLabel label = new Control.RichLabel(scroll); label.Dock = Dock.Fill; label.Document = LongDocument(); }
private void OpenWindowWithMenuAndStatusBar(ControlBase control, EventArgs args) { Control.Window window = new Control.Window(this); window.Title = String.Format("Window ({0})", ++m_WindowCount); window.Size = new Size(m_Rand.Next(200, 400), m_Rand.Next(200, 400)); window.Left = m_Rand.Next(700); window.Top = m_Rand.Next(400); window.Padding = new Padding(1, 0, 1, 1); Control.Layout.DockLayout layout = new Control.Layout.DockLayout(window); Control.MenuStrip menuStrip = new Control.MenuStrip(layout); menuStrip.Dock = Dock.Top; /* File */ { Control.MenuItem root = menuStrip.AddItem("File"); root.Menu.AddItem("Load", "test16.png", "Ctrl+L"); root.Menu.AddItem("Save", String.Empty, "Ctrl+S"); root.Menu.AddItem("Save As..", String.Empty, "Ctrl+A"); root.Menu.AddItem("Quit", String.Empty, "Ctrl+Q").SetAction((c, a) => window.Close()); } /* Resizing */ { Control.MenuItem root = menuStrip.AddItem("Resizing"); root.Menu.AddItem("Disabled").SetAction((c, a) => window.Resizing = Resizing.None); root.Menu.AddItem("Width").SetAction((c, a) => window.Resizing = Resizing.Width); root.Menu.AddItem("Height").SetAction((c, a) => window.Resizing = Resizing.Height); root.Menu.AddItem("Both").SetAction((c, a) => window.Resizing = Resizing.Both); } Control.StatusBar statusBar = new Control.StatusBar(layout); statusBar.Dock = Dock.Bottom; statusBar.Text = "Status bar"; { Control.Button br = new Control.Button(statusBar); br.Text = "Right button"; statusBar.AddControl(br, true); } }
public ColorPickers(ControlBase parent) : base(parent) { /* RGB Picker */ { ColorPicker rgbPicker = new ColorPicker(this); rgbPicker.Dock = Dock.Top; rgbPicker.ColorChanged += ColorChanged; } /* HSVColorPicker */ { HSVColorPicker hsvPicker = new HSVColorPicker(this); hsvPicker.Dock = Dock.Fill; hsvPicker.HorizontalAlignment = HorizontalAlignment.Left; hsvPicker.VerticalAlignment = VerticalAlignment.Top; hsvPicker.ColorChanged += ColorChanged; } /* HSVColorPicker in Window */ { Control.Window window = new Control.Window(base.GetCanvas()); window.Size = new Size(300, 200); window.Collapse(); Control.Layout.DockLayout layout = new Control.Layout.DockLayout(window); HSVColorPicker hsvPicker = new HSVColorPicker(layout); hsvPicker.Margin = Margin.Two; hsvPicker.Dock = Dock.Fill; hsvPicker.ColorChanged += ColorChanged; Control.Button OpenWindow = new Control.Button(this); OpenWindow.Dock = Dock.Bottom; OpenWindow.HorizontalAlignment = HorizontalAlignment.Left; OpenWindow.Text = "Open Window"; OpenWindow.Clicked += delegate(ControlBase sender, ClickedEventArgs args) { window.Show(); }; } }
private void OpenWindow(ControlBase control, EventArgs args) { Control.Window window = new Control.Window(this); window.Title = String.Format("Window ({0})", ++m_WindowCount); window.Size = new Size(m_Rand.Next(200, 400), m_Rand.Next(200, 400)); window.Left = m_Rand.Next(700); window.Top = m_Rand.Next(400); window.Padding = new Padding(6, 3, 6, 6); Control.RadioButtonGroup rbg = new RadioButtonGroup(window); rbg.Dock = Dock.Top; rbg.AddOption("Resize disabled", "None").Checked += (c, a) => window.Resizing = Resizing.None; rbg.AddOption("Resize width", "Width").Checked += (c, a) => window.Resizing = Resizing.Width; rbg.AddOption("Resize height", "Height").Checked += (c, a) => window.Resizing = Resizing.Height; rbg.AddOption("Resize both", "Both").Checked += (c, a) => window.Resizing = Resizing.Both; rbg.SetSelectionByName("Both"); Control.LabeledCheckBox dragging = new Control.LabeledCheckBox(window); dragging.Dock = Dock.Top; dragging.Text = "Dragging"; dragging.IsChecked = true; dragging.CheckChanged += (c, a) => window.IsDraggingEnabled = dragging.IsChecked; }