void btnTask_Click(object sender, EventArgs e) { if (sender == btnTasks[0]) { #if (!XBOX) UserInterfaceManager.Cursor = Skin.Cursors["Busy"].Cursor; #endif btnTasks[0].Enabled = false; TaskDialog tmp = new TaskDialog(); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; Thread.Sleep(2000); // Sleep to demonstrate animated busy cursor tmp.Show(); #if (!XBOX) UserInterfaceManager.Cursor = Skin.Cursors["Default"].Cursor; #endif } else if (sender == btnTasks[1]) { btnTasks[1].Enabled = false; TaskControls tmp = new TaskControls(); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.ShowModal(); } else if (sender == btnTasks[2]) { btnTasks[2].Enabled = false; TaskAutoScroll tmp = new TaskAutoScroll(); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Show(); } else if (sender == btnTasks[3]) { btnTasks[3].Enabled = false; Window tmp = (Window)Layout.Load("Window"); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; //tmp.SearchChildControlByName("btnOk").Click += Central_Click; tmp.Show(); } else if (sender == btnTasks[4]) { btnTasks[4].Enabled = false; TaskEvents tmp = new TaskEvents(); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Show(); } }
void btnRandom_Click(object sender, EventArgs e) { Window win = new Window(); Button btn = new Button(); TextBox txt = new TextBox(); win.ClientWidth = 320; win.ClientHeight = 160; win.MinimumWidth = 128; win.MinimumHeight = 128; Random r = new Random(); win.ClientWidth += r.Next(-100, +100); win.ClientHeight += r.Next(-100, +100); win.Left = r.Next(200, Screen.Width - win.ClientWidth / 2); win.Top = r.Next(0, Screen.Height - win.ClientHeight / 2); win.Closed += win_Closed; btn.Anchor = Anchors.Bottom; btn.Left = (win.ClientWidth / 2) - (btn.Width / 2); btn.Top = win.ClientHeight - btn.Height - 8; btn.Text = "OK"; win.Text = "Window (" + win.Width + "x" + win.Height + ")"; txt.Parent = win; txt.Left = 8; txt.Top = 8; txt.Width = win.ClientArea.Width - 16; txt.Height = win.ClientArea.Height - 48; txt.Anchor = Anchors.All; txt.Mode = TextBoxMode.Multiline; txt.Text = "This is a Multiline TextBox.\n" + "Allows to edit large texts,\n" + "copy text to and from clipboard,\n" + "select text with mouse or keyboard\n" + "and much more..."; txt.SelectAll(); txt.Focused = true; txt.ScrollBars = ScrollBarType.Both; btn.Parent = win; // win.Add(btn, true); win.Show(); }
void btnClose_Click(object sender, EventArgs e) { ControlsList list = new ControlsList(); list.AddRange(UserInterfaceManager.RootControls); for (int i = 0; i < list.Count; i++) { if (list[i] is Window) { if (list[i].Text.Substring(0, 6) == "Window") { (list[i] as Window).Dispose(); } } } list.Clear(); }
void Central_Click(object sender, EventArgs e) { ((sender as Button).Root as Window).Close(); }
void rdbDefault_Click(object sender, EventArgs e) { UserInterfaceManager.SetSkin("Default"); }
void rdbGreen_Click(object sender, EventArgs e) { UserInterfaceManager.SetSkin("Green"); }