Changed: stupid design for hotkeys options

This commit is contained in:
Ray committed 2020-05-20 00:49:47 +01:00
1 parent 7fc399540f
commit 1d96222514
11 files changed
+542 -264

No files matched your search

+59
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -52,6 +53,20 @@ namespace RyzStudio.Windows.Forms
}
}
public static void Clear(FlowLayoutPanel control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Controls.Clear();
}));
}
else
{
control.Controls.Clear();
}
}
public static string GetText(Control control, bool doTrim = true)
{
string rv = string.Empty;
@@ -148,5 +163,49 @@ namespace RyzStudio.Windows.Forms
}
}
public static void SetSize(Control control, int width, int height)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Width = width;
control.Height = height;
}));
}
else
{
control.Width = width;
control.Height = height;
}
}
public static void SetSize(Control control, Size value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Size = value;
}));
}
else
{
control.Size = value;
}
}
public static void SetTopMost(Form control, bool value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.TopMost = value;
}));
}
else
{
control.TopMost = value;
}
}
}
}
@@ -27,6 +27,7 @@
this.FormBorderStyle = FormBorderStyle.None;
this.ShowInTaskbar = false;
this.TopMost = true;
imgbxClose.Click += pictureBox3_Click;
}
@@ -0,0 +1,17 @@
namespace RyzStudio.Windows.ThemedForms
{
public class TYesNoPickerBox : TPickerBox
{
public TYesNoPickerBox() : base()
{
this.ComboBox.Items.Clear();
this.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (this.ComboBox.Items.Count > 0) this.ComboBox.SelectedIndex = 0;
}
public bool Value { get => (this.ComboBox.SelectedIndex == 1); set =>this.ComboBox.SelectedIndex = (value ? 1 : 0); }
}
}