private void btnApply_Click(object sender, EventArgs e) { Manager.Graphics.IsFullScreen = chkResFull.Checked; var w = 1024; var h = 768; if (rdbRes1024.Checked) { w = 1024; h = 768; } else if (rdbRes1280.Checked) { w = 1280; h = 1024; } else if (rdbRes1680.Checked) { w = 1680; h = 1050; } Manager.Graphics.PreferredBackBufferWidth = w; Manager.Graphics.PreferredBackBufferHeight = h; Manager.Graphics.ApplyChanges(); }
private void trkMain_ValueChanged(object sender, EventArgs e) { if (lblTrack != null) { lblTrack.Text = trkMain.Value + "/" + trkMain.Range; } }
private void ModeChanged(object sender, EventArgs e) { if (sender == rdbNormal) { txtEdit.Mode = TextBoxMode.Normal; } else if (sender == rdbPassword) { txtEdit.Mode = TextBoxMode.Password; } }
private void btnProgress_Click(object sender, EventArgs e) { if (prgMain.Mode == ProgressBarMode.Default) { prgMain.Mode = ProgressBarMode.Infinite; } else { prgMain.Mode = ProgressBarMode.Default; } lstMain.Items.Add(new Random().Next().ToString()); lstMain.ItemIndex = lstMain.Items.Count - 1; cmbMain.Text = "!!!"; }
/// <summary> /// When the save button is clicked, add the server or edit the existing one /// </summary> private void BtnSaveClick(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtHost.Text)) { return; } if (edit) { wndServer.EditServer(index, new ServerData(txtName.Text, host, port)); } else { wndServer.AddServer(new ServerData(txtName.Text, host, port)); } Close(); }
private void btnClose_Click(object sender, EventArgs e) { var list = new ControlsList(); list.AddRange(Manager.Controls); for (var i = 0; i < list.Count; i++) { if (list[i] is Window) { if (((Window)list[i]).Text.Substring(0, 6) == "Window") { (list[i] as Window).Dispose(); } } } list.Clear(); }
private void btnDisable_Click(object sender, EventArgs e) { if (txtEdit.Enabled) { btnDisable.Text = "Enable"; btnDisable.TextColor = Color.FromNonPremultiplied(64, 255, 32, 200); } else { btnDisable.Text = "Disable"; btnDisable.TextColor = Color.FromNonPremultiplied(255, 64, 32, 200); } ClientArea.Enabled = !ClientArea.Enabled; BottomPanel.Enabled = true; prgMain.Enabled = ClientArea.Enabled; }
private void btnRandom_Click(object sender, EventArgs e) { var win = new Window(Manager); var btn = new Button(Manager); var txt = new TextBox(Manager); win.Init(); btn.Init(); txt.Init(); win.ClientWidth = 320; win.ClientHeight = 160; win.MinimumWidth = 128; win.MinimumHeight = 128; var r = new Random((int)Central.Frames); win.ClientWidth += r.Next(-100, +100); win.ClientHeight += r.Next(-100, +100); win.Left = r.Next(200, Manager.ScreenWidth - win.ClientWidth / 2); win.Top = r.Next(0, Manager.ScreenHeight - win.ClientHeight / 2); win.Closed += win_Closed; /* * win.Width = 1024; * win.Height = 768; * win.Left = 220; * win.Top = 0; * win.StayOnBack = true; * win.SendToBack(); */ 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.ReadOnly = true; txt.ScrollBars = ScrollBars.Both; win.Add(btn, true); win.Show(); Manager.Add(win); }
private void btnExit_Click(object sender, EventArgs e) { Close(); }
private void Central_Click(object sender, EventArgs e) { ((sender as Button).Root as Window).Close(); }
private void btnTask_Click(object sender, EventArgs e) { if (sender == btnTasks[0]) { #if (!XBOX && !XBOX_FAKE) Manager.Cursor = Manager.Skin.Cursors["Busy"].Resource; #endif btnTasks[0].Enabled = false; var tmp = new TaskDialog(Manager); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Init(); Manager.Add(tmp); tmp.Show(); #if (!XBOX && !XBOX_FAKE) Manager.Cursor = Manager.Skin.Cursors["Default"].Resource; #endif } else if (sender == btnTasks[1]) { btnTasks[1].Enabled = false; var tmp = new TaskControls(Manager); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Init(); Manager.Add(tmp); tmp.ShowModal(); } else if (sender == btnTasks[2]) { btnTasks[2].Enabled = false; var tmp = new TaskAutoScroll(Manager); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Init(); Manager.Add(tmp); tmp.Show(); } else if (sender == btnTasks[3]) { btnTasks[3].Enabled = false; var tmp = (Window)Layout.Load(Manager, "Window"); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Init(); tmp.GetControl("btnOk").Click += Central_Click; Manager.Add(tmp); tmp.Show(); } else if (sender == btnTasks[4]) { btnTasks[4].Enabled = false; var tmp = new TaskEvents(Manager); tmp.Closing += WindowClosing; tmp.Closed += WindowClosed; tmp.Init(); Manager.Add(tmp); tmp.Show(); } }
private void TaskControls_SkinChanged(object sender, EventArgs e) { #if (!XBOX && !XBOX_FAKE) prgMain.Cursor = Manager.Skin.Cursors["Busy"].Resource; #endif }
private void chkReadOnly_CheckedChanged(object sender, EventArgs e) { txtEdit.ReadOnly = chkReadOnly.Checked; }
private void chkBorders_CheckedChanged(object sender, EventArgs e) { txtEdit.DrawBorders = !chkBorders.Checked; }
private void btnExit_Click(object sender, EventArgs e) { Environment.Exit(0); }
private void TxtNameTextChanged(object sender, EventArgs e) => Validate();