aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Apps/Shifter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/Shifter.cs')
-rw-r--r--source/WindowsFormsApplication1/Apps/Shifter.cs250
1 files changed, 132 insertions, 118 deletions
diff --git a/source/WindowsFormsApplication1/Apps/Shifter.cs b/source/WindowsFormsApplication1/Apps/Shifter.cs
index 3aad889..9630597 100644
--- a/source/WindowsFormsApplication1/Apps/Shifter.cs
+++ b/source/WindowsFormsApplication1/Apps/Shifter.cs
@@ -8,7 +8,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using System.Windows.Forms;
+using ShiftUI;
namespace ShiftOS
{
@@ -50,7 +50,7 @@ namespace ShiftOS
//Set Available Title Buttons
combobuttonoption.Items.Clear();
- if(API.Upgrades["closebutton"])
+ if (API.Upgrades["closebutton"])
{
combobuttonoption.Items.Add("Close");
}
@@ -104,7 +104,8 @@ namespace ShiftOS
predesktoppanel.BackColor = CustomizingSkin.desktoppanelcolour;
predesktoppanel.BackgroundImage = null;
}
- else {
+ else
+ {
predesktoppanel.BackgroundImage = CustomizingImages.desktoppanel;
predesktoppanel.BackgroundImageLayout = (ImageLayout)CustomizingSkin.desktoppanellayout;
predesktoppanel.BackColor = Color.Transparent;
@@ -124,7 +125,8 @@ namespace ShiftOS
}
predesktoppanel.Show();
}
- else {
+ else
+ {
predesktoppanel.Hide();
}
@@ -142,7 +144,8 @@ namespace ShiftOS
ApplicationsToolStripMenuItem.Text = "";
ApplicationsToolStripMenuItem.BackColor = Color.Transparent;
}
- else {
+ else
+ {
ApplicationsToolStripMenuItem.Text = CustomizingSkin.applicationlaunchername;
ApplicationsToolStripMenuItem.BackColor = CustomizingSkin.applauncherbackgroundcolour;
ApplicationsToolStripMenuItem.BackgroundImage = null;
@@ -159,12 +162,14 @@ namespace ShiftOS
{
ApplicationsToolStripMenuItem.BackgroundImage = CustomizingImages.applauncher;
}
- else {
+ else
+ {
ApplicationsToolStripMenuItem.BackColor = CustomizingSkin.applauncherbackgroundcolour;
ApplicationsToolStripMenuItem.BackgroundImageLayout = (ImageLayout)CustomizingSkin.applauncherlayout;
}
}
- else {
+ else
+ {
ApplicationsToolStripMenuItem.Visible = false;
}
@@ -178,7 +183,8 @@ namespace ShiftOS
pretimepanel.BackColor = CustomizingSkin.clockbackgroundcolor;
pretimepanel.BackgroundImage = null;
}
- else {
+ else
+ {
pretimepanel.BackColor = Color.Transparent;
pretimepanel.BackgroundImage = CustomizingImages.panelclock;
pretimepanel.BackgroundImageLayout = (ImageLayout)CustomizingSkin.panelclocklayout;
@@ -188,7 +194,8 @@ namespace ShiftOS
prepaneltimetext.Location = new Point(0, CustomizingSkin.panelclocktexttop);
pretimepanel.Show();
}
- else {
+ else
+ {
pretimepanel.Hide();
}
@@ -235,11 +242,11 @@ namespace ShiftOS
}
-
+
public void setskin()
{
-
+
//disposals
preclosebutton.BackgroundImage = null;
pretitlebar.BackgroundImage = null;
@@ -252,7 +259,7 @@ namespace ShiftOS
preclosebutton.BackColor = CustomizingSkin.closebtncolour;
else
preclosebutton.BackgroundImage = CustomizingImages.closebtn;
- preclosebutton.BackgroundImageLayout = (ImageLayout)CustomizingSkin.closebtnlayout;
+ preclosebutton.BackgroundImageLayout = (ImageLayout)CustomizingSkin.closebtnlayout;
if (CustomizingImages.titlebar == null)
pretitlebar.BackColor = CustomizingSkin.titlebarcolour;
else
@@ -306,7 +313,8 @@ namespace ShiftOS
prepgbottomrcorner.BackgroundImage = CustomizingImages.bottomrightcorner;
prepgbottomrcorner.BackgroundImageLayout = (ImageLayout)CustomizingSkin.bottomrightcornerlayout;
}
- else {
+ else
+ {
prepgbottomlcorner.BackColor = CustomizingSkin.borderrightcolour;
prepgbottomrcorner.BackColor = CustomizingSkin.borderrightcolour;
prepgbottomlcorner.BackgroundImage = null;
@@ -345,7 +353,7 @@ namespace ShiftOS
prepgright.Width = CustomizingSkin.borderwidth;
prepgbottom.Height = CustomizingSkin.borderwidth;
pretitlebar.Height = CustomizingSkin.titlebarheight;
-
+
if (CustomizingSkin.enablecorners == true)
{
prepgtoplcorner.Show();
@@ -353,7 +361,8 @@ namespace ShiftOS
prepgtoprcorner.Width = CustomizingSkin.titlebarcornerwidth;
prepgtoplcorner.Width = CustomizingSkin.titlebarcornerwidth;
}
- else {
+ else
+ {
prepgtoplcorner.Hide();
prepgtoprcorner.Hide();
}
@@ -367,7 +376,8 @@ namespace ShiftOS
{
pretitletext.Hide();
}
- else {
+ else
+ {
pretitletext.Font = new Font(CustomizingSkin.titletextfontfamily, CustomizingSkin.titletextfontsize, CustomizingSkin.titletextfontstyle, GraphicsUnit.Point);
pretitletext.Text = "Preview";
pretitletext.Show();
@@ -377,7 +387,8 @@ namespace ShiftOS
{
preclosebutton.Hide();
}
- else {
+ else
+ {
preclosebutton.BackColor = CustomizingSkin.closebtncolour;
preclosebutton.Size = CustomizingSkin.closebtnsize;
preclosebutton.Show();
@@ -387,7 +398,8 @@ namespace ShiftOS
{
prerollupbutton.Hide();
}
- else {
+ else
+ {
prerollupbutton.BackColor = CustomizingSkin.rollbtncolour;
prerollupbutton.Size = CustomizingSkin.rollbtnsize;
prerollupbutton.Show();
@@ -397,7 +409,8 @@ namespace ShiftOS
{
preminimizebutton.Hide();
}
- else {
+ else
+ {
preminimizebutton.BackColor = CustomizingSkin.minbtncolour;
preminimizebutton.Size = CustomizingSkin.minbtnsize;
preminimizebutton.Show();
@@ -419,7 +432,8 @@ namespace ShiftOS
}
pretitletext.ForeColor = CustomizingSkin.titletextcolour;
}
- else {
+ else
+ {
preclosebutton.Location = new Point(pretitlebar.Size.Width - CustomizingSkin.closebtnfromside - prepgtoplcorner.Width - prepgtoprcorner.Width - preclosebutton.Size.Width, CustomizingSkin.closebtnfromtop);
prerollupbutton.Location = new Point(pretitlebar.Size.Width - CustomizingSkin.rollbtnfromside - prepgtoplcorner.Width - prepgtoprcorner.Width - prerollupbutton.Size.Width, CustomizingSkin.rollbtnfromtop);
preminimizebutton.Location = new Point(pretitlebar.Size.Width - CustomizingSkin.minbtnfromside - prepgtoplcorner.Width - prepgtoprcorner.Width - preminimizebutton.Size.Width, CustomizingSkin.minbtnfromtop);
@@ -443,7 +457,7 @@ namespace ShiftOS
prepnlicon.Location = new Point(CustomizingSkin.titleiconfromside, CustomizingSkin.titleiconfromtop);
prepnlicon.Size = new Size(CustomizingSkin.titlebariconsize, CustomizingSkin.titlebariconsize);
prepnlicon.Image = Properties.Resources.iconShifter;
-
+
}
}
@@ -491,32 +505,32 @@ namespace ShiftOS
public void GetAllImages()
{
- CustomizingImages = new Skinning.Images();
- CustomizingImages.applauncherclick = Skinning.Utilities.GetImage(CustomizingSkin.applauncherclickpath);
- CustomizingImages.panelbutton = Skinning.Utilities.GetImage(CustomizingSkin.panelbuttonpath);
- CustomizingImages.applaunchermouseover = Skinning.Utilities.GetImage(CustomizingSkin.applaunchermouseoverpath);
- CustomizingImages.applauncher = Skinning.Utilities.GetImage(CustomizingSkin.applauncherpath);
- CustomizingImages.panelclock = Skinning.Utilities.GetImage(CustomizingSkin.panelclockpath);
- CustomizingImages.desktopbackground = Skinning.Utilities.GetImage(CustomizingSkin.desktopbackgroundpath);
- CustomizingImages.desktoppanel = Skinning.Utilities.GetImage(CustomizingSkin.desktoppanelpath);
- CustomizingImages.minbtnhover = Skinning.Utilities.GetImage(CustomizingSkin.minbtnhoverpath);
- CustomizingImages.minbtnclick = Skinning.Utilities.GetImage(CustomizingSkin.minbtnclickpath);
- CustomizingImages.rightcorner = Skinning.Utilities.GetImage(CustomizingSkin.rightcornerpath);
- CustomizingImages.titlebar = Skinning.Utilities.GetImage(CustomizingSkin.titlebarpath);
- CustomizingImages.borderright = Skinning.Utilities.GetImage(CustomizingSkin.borderrightpath);
- CustomizingImages.borderleft = Skinning.Utilities.GetImage(CustomizingSkin.borderleftpath);
- CustomizingImages.borderbottom = Skinning.Utilities.GetImage(CustomizingSkin.borderbottompath);
- CustomizingImages.closebtn = Skinning.Utilities.GetImage(CustomizingSkin.closebtnpath);
- CustomizingImages.closebtnhover = Skinning.Utilities.GetImage(CustomizingSkin.closebtnhoverpath);
- CustomizingImages.closebtnclick = Skinning.Utilities.GetImage(CustomizingSkin.closebtnclickpath);
- CustomizingImages.rollbtn = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnpath);
- CustomizingImages.rollbtnhover = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnhoverpath);
- CustomizingImages.rollbtnclick = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnclickpath);
- CustomizingImages.minbtn = Skinning.Utilities.GetImage(CustomizingSkin.minbtnpath);
- CustomizingImages.leftcorner = Skinning.Utilities.GetImage(CustomizingSkin.leftcornerpath);
- CustomizingImages.bottomleftcorner = Skinning.Utilities.GetImage(CustomizingSkin.bottomleftcornerpath);
- CustomizingImages.bottomrightcorner = Skinning.Utilities.GetImage(CustomizingSkin.bottomrightcornerpath);
-
+ CustomizingImages = new Skinning.Images();
+ CustomizingImages.applauncherclick = Skinning.Utilities.GetImage(CustomizingSkin.applauncherclickpath);
+ CustomizingImages.panelbutton = Skinning.Utilities.GetImage(CustomizingSkin.panelbuttonpath);
+ CustomizingImages.applaunchermouseover = Skinning.Utilities.GetImage(CustomizingSkin.applaunchermouseoverpath);
+ CustomizingImages.applauncher = Skinning.Utilities.GetImage(CustomizingSkin.applauncherpath);
+ CustomizingImages.panelclock = Skinning.Utilities.GetImage(CustomizingSkin.panelclockpath);
+ CustomizingImages.desktopbackground = Skinning.Utilities.GetImage(CustomizingSkin.desktopbackgroundpath);
+ CustomizingImages.desktoppanel = Skinning.Utilities.GetImage(CustomizingSkin.desktoppanelpath);
+ CustomizingImages.minbtnhover = Skinning.Utilities.GetImage(CustomizingSkin.minbtnhoverpath);
+ CustomizingImages.minbtnclick = Skinning.Utilities.GetImage(CustomizingSkin.minbtnclickpath);
+ CustomizingImages.rightcorner = Skinning.Utilities.GetImage(CustomizingSkin.rightcornerpath);
+ CustomizingImages.titlebar = Skinning.Utilities.GetImage(CustomizingSkin.titlebarpath);
+ CustomizingImages.borderright = Skinning.Utilities.GetImage(CustomizingSkin.borderrightpath);
+ CustomizingImages.borderleft = Skinning.Utilities.GetImage(CustomizingSkin.borderleftpath);
+ CustomizingImages.borderbottom = Skinning.Utilities.GetImage(CustomizingSkin.borderbottompath);
+ CustomizingImages.closebtn = Skinning.Utilities.GetImage(CustomizingSkin.closebtnpath);
+ CustomizingImages.closebtnhover = Skinning.Utilities.GetImage(CustomizingSkin.closebtnhoverpath);
+ CustomizingImages.closebtnclick = Skinning.Utilities.GetImage(CustomizingSkin.closebtnclickpath);
+ CustomizingImages.rollbtn = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnpath);
+ CustomizingImages.rollbtnhover = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnhoverpath);
+ CustomizingImages.rollbtnclick = Skinning.Utilities.GetImage(CustomizingSkin.rollbtnclickpath);
+ CustomizingImages.minbtn = Skinning.Utilities.GetImage(CustomizingSkin.minbtnpath);
+ CustomizingImages.leftcorner = Skinning.Utilities.GetImage(CustomizingSkin.leftcornerpath);
+ CustomizingImages.bottomleftcorner = Skinning.Utilities.GetImage(CustomizingSkin.bottomleftcornerpath);
+ CustomizingImages.bottomrightcorner = Skinning.Utilities.GetImage(CustomizingSkin.bottomrightcornerpath);
+
}
private void Shifter_Load(object sender, EventArgs e)
@@ -532,7 +546,7 @@ namespace ShiftOS
#endregion
- private void SetAvailableOptions ()
+ private void SetAvailableOptions()
{
btntitlebar.Visible = API.Upgrades["shifttitlebar"];
btntitletext.Visible = API.Upgrades["shifttitletext"];
@@ -557,7 +571,7 @@ namespace ShiftOS
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
string result = API.GetInfoboxResult();
- if(result == "Yes")
+ if (result == "Yes")
{
Skinning.Utilities.loadedSkin = new Skinning.Skin();
Skinning.Utilities.loadedskin_images = new Skinning.Images();
@@ -571,7 +585,7 @@ namespace ShiftOS
};
}
-
+
private void txtdesktoppanelheight_ValueChanged(object sender, EventArgs e)
{
@@ -581,7 +595,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch
+ catch
{
txtdesktoppanelheight.Text = CustomizingSkin.desktoppanelheight.ToString();
}
@@ -607,7 +621,7 @@ namespace ShiftOS
pnldesktoppaneloptions.Show();
pnldesktoppaneloptions.BringToFront();
SetupDesktopPanelValues();
- if(API.Upgrades["advanceddesktop"])
+ if (API.Upgrades["advanceddesktop"])
{
lbpanelcolor.Hide();
pnldesktoppanelcolour.Hide();
@@ -656,7 +670,7 @@ namespace ShiftOS
private void ChangeDesktopPanelColor(object sender, MouseEventArgs e)
{
- if(e.Button == MouseButtons.Left)
+ if (e.Button == MouseButtons.Left)
{
API.CreateColorPickerSession("Desktop Panel Color", CustomizingSkin.desktoppanelcolour);
API.ColorPickerSession.FormClosing += (object s, FormClosingEventArgs a) =>
@@ -668,13 +682,13 @@ namespace ShiftOS
}
else
{
- if(API.Upgrades["skinning"] == true)
+ if (API.Upgrades["skinning"] == true)
{
API.CreateGraphicPickerSession("Desktop Panel", false);
API.GraphicPickerSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
string result = API.GetGraphicPickerResult();
- if(result == "OK")
+ if (result == "OK")
{
CustomizingImages.desktoppanel = API.GraphicPickerSession.IdleImage;
CustomizingSkin.desktoppanellayout = (int)API.GraphicPickerSession.ImageLayout;
@@ -743,7 +757,7 @@ namespace ShiftOS
list.Items.Add("Bold");
list.Items.Add("Italic");
list.Items.Add("Underline");
- switch(currentFontStyle)
+ switch (currentFontStyle)
{
case FontStyle.Regular:
list.Text = "Regular";
@@ -828,7 +842,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch
+ catch
{
txtapplicationsbuttonheight.Text = CustomizingSkin.applicationbuttonheight.ToString();
}
@@ -842,7 +856,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch
+ catch
{
txtapplauncherwidth.Text = CustomizingSkin.applaunchermenuholderwidth.ToString();
}
@@ -911,7 +925,7 @@ namespace ShiftOS
private void SetALButtonClickedColor(object sender, MouseEventArgs e)
{
- if(CustomizingImages.applauncherclick != null)
+ if (CustomizingImages.applauncherclick != null)
{
API.CreateInfoboxSession("Shifter - Error", "It appears you've set an image as the 'Activated' property of the App Launcher button, thus this setting is overidden by it. Please un-set the image to change this setting.", infobox.InfoboxMode.Info);
@@ -1001,11 +1015,13 @@ namespace ShiftOS
private void txtpanelbuttonwidth_TextChanged(object sender, EventArgs e)
{
- try {
+ try
+ {
CustomizingSkin.panelbuttonwidth = Convert.ToInt16(txtpanelbuttonwidth.Text);
AddCP(1);
}
- catch{
+ catch
+ {
txtpanelbuttonwidth.Text = CustomizingSkin.panelbuttonwidth.ToString();
}
SetPreviewSkin(false);
@@ -1018,7 +1034,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttoninitialgap = Convert.ToInt16(txtpanelbuttoninitalgap.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttoninitalgap.Text = CustomizingSkin.panelbuttoninitialgap.ToString();
}
@@ -1079,7 +1095,7 @@ namespace ShiftOS
AddCP(rand.Next(0, 5));
};
}
-
+
}
private void SetPanelButtonColor(object sender, MouseEventArgs e)
@@ -1134,7 +1150,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttoniconside = Convert.ToInt16(txtpanelbuttoniconside.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttoniconside.Text = CustomizingSkin.panelbuttoniconside.ToString();
}
@@ -1148,7 +1164,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonicontop = Convert.ToInt16(txtpanelbuttonicontop.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttonicontop.Text = CustomizingSkin.panelbuttonicontop.ToString();
}
@@ -1162,7 +1178,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontextside = Convert.ToInt16(txtpanelbuttontextside.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttontextside.Text = CustomizingSkin.panelbuttontextside.ToString();
}
@@ -1176,7 +1192,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontexttop = Convert.ToInt16(txtpanelbuttontexttop.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttontexttop.Text = CustomizingSkin.panelbuttontexttop.ToString();
}
@@ -1190,7 +1206,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontextsize = Convert.ToInt16(txtpaneltextbuttonsize.Text);
AddCP(1);
}
- catch
+ catch
{
txtpaneltextbuttonsize.Text = CustomizingSkin.panelbuttontextsize.ToString();
}
@@ -1204,7 +1220,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonfromtop = Convert.ToInt16(txtpanelbuttontop.Text);
AddCP(1);
}
- catch
+ catch
{
txtpanelbuttontop.Text = CustomizingSkin.panelbuttonfromtop.ToString();
}
@@ -1296,7 +1312,7 @@ namespace ShiftOS
CustomizingSkin.panelclocktextsize = Convert.ToInt16(txtclocktextsize.Text);
AddCP(1);
}
- catch
+ catch
{
txtclocktextsize.Text = CustomizingSkin.panelclocktextsize.ToString();
}
@@ -1310,7 +1326,7 @@ namespace ShiftOS
CustomizingSkin.panelclocktexttop = Convert.ToInt16(txtclocktextfromtop.Text);
AddCP(1);
}
- catch
+ catch
{
txtclocktextfromtop.Text = CustomizingSkin.panelclocktexttop.ToString(); //Funny story: I accidentally assigned 'panelcocktexttop' to that property. xD - Michael VanOverbeek
}
@@ -1371,7 +1387,7 @@ namespace ShiftOS
CustomizingSkin.titletextfromside = Convert.ToInt16(txttitletextside.Text);
AddCP(1);
}
- catch
+ catch
{
txttitletextside.Text = CustomizingSkin.titletextfromside.ToString();
}
@@ -1406,7 +1422,7 @@ namespace ShiftOS
CustomizingSkin.titletextfontsize = Convert.ToInt16(txttitletextsize.Text);
AddCP(1);
}
- catch
+ catch
{
txttitletextsize.Text = CustomizingSkin.titletextfontsize.ToString();
}
@@ -1447,7 +1463,7 @@ namespace ShiftOS
private void Button2_Click(object sender, EventArgs e)
{
- }
+ }
private void Label68_Click(object sender, EventArgs e)
{
@@ -1781,7 +1797,7 @@ namespace ShiftOS
pnltitlebarrightcornercolour.BackColor = CustomizingSkin.rightcornercolour;
pnltitlebarrightcornercolour.BackgroundImage = CustomizingImages.rightcorner;
pnltitlebarrightcornercolour.BackgroundImageLayout = (ImageLayout)CustomizingSkin.rightcornerlayout;
-
+
//Height
txttitlebarheight.Text = CustomizingSkin.titlebarheight.ToString();
@@ -1849,7 +1865,7 @@ namespace ShiftOS
CustomizingSkin.titlebarcornerwidth = Convert.ToInt16(txttitlebarcornerwidth.Text);
AddCP(1);
}
- catch
+ catch
{
txttitlebarcornerwidth.Text = CustomizingSkin.titlebarcornerwidth.ToString();
}
@@ -1925,7 +1941,7 @@ namespace ShiftOS
CustomizingSkin.titleiconfromside = Convert.ToInt16(txticonfromside.Text);
AddCP(1);
}
- catch
+ catch
{
txticonfromside.Text = CustomizingSkin.titleiconfromside.ToString();
}
@@ -1939,7 +1955,7 @@ namespace ShiftOS
CustomizingSkin.titleiconfromtop = Convert.ToInt16(txticonfromtop.Text);
AddCP(1);
}
- catch
+ catch
{
txticonfromtop.Text = CustomizingSkin.titleiconfromtop.ToString();
}
@@ -1959,7 +1975,7 @@ namespace ShiftOS
pnlminimizebuttonoptions.Hide();
pnlclosebuttonoptions.Hide();
pnlrollupbuttonoptions.Hide();
- switch(button)
+ switch (button)
{
case "Close":
pnlclosebuttonoptions.Show();
@@ -2077,7 +2093,7 @@ namespace ShiftOS
CustomizingSkin.minbtnsize.Width = Convert.ToInt16(txtminimizebuttonwidth.Text);
AddCP(1);
}
- catch
+ catch
{
txtminimizebuttonwidth.Text = CustomizingSkin.minbtnsize.Width.ToString();
}
@@ -2105,7 +2121,7 @@ namespace ShiftOS
CustomizingSkin.minbtnfromside = Convert.ToInt16(txtminimizebuttonside.Text);
AddCP(1);
}
- catch
+ catch
{
txtminimizebuttonside.Text = CustomizingSkin.minbtnfromside.ToString();
}
@@ -2154,7 +2170,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnsize.Height = Convert.ToInt16(txtrollupbuttonheight.Text);
AddCP(1);
}
- catch
+ catch
{
txtrollupbuttonheight.Text = CustomizingSkin.rollbtnsize.Height.ToString();
}
@@ -2168,7 +2184,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnsize.Width = Convert.ToInt16(txtrollupbuttonwidth.Text);
AddCP(1);
}
- catch
+ catch
{
txtrollupbuttonwidth.Text = CustomizingSkin.rollbtnsize.Width.ToString();
}
@@ -2182,7 +2198,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnfromtop = Convert.ToInt16(txtrollupbuttontop.Text);
AddCP(1);
}
- catch
+ catch
{
txtrollupbuttontop.Text = CustomizingSkin.rollbtnfromtop.ToString();
}
@@ -2196,7 +2212,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnfromside = Convert.ToInt16(txtrollupbuttonside.Text);
AddCP(1);
}
- catch
+ catch
{
txtrollupbuttonside.Text = CustomizingSkin.rollbtnfromside.ToString();
}
@@ -2245,7 +2261,7 @@ namespace ShiftOS
CustomizingSkin.closebtnsize.Height = Convert.ToInt16(txtclosebuttonheight.Text);
AddCP(1);
}
- catch
+ catch
{
txtclosebuttonheight.Text = CustomizingSkin.closebtnsize.Height.ToString();
}
@@ -2259,7 +2275,7 @@ namespace ShiftOS
CustomizingSkin.closebtnsize.Width = Convert.ToInt16(txtclosebuttonwidth.Text);
AddCP(1);
}
- catch
+ catch
{
txtclosebuttonwidth.Text = CustomizingSkin.closebtnsize.Width.ToString();
}
@@ -2273,7 +2289,7 @@ namespace ShiftOS
CustomizingSkin.closebtnfromtop = Convert.ToInt16(txtclosebuttonfromtop.Text);
AddCP(1);
}
- catch
+ catch
{
txtclosebuttonfromtop.Text = CustomizingSkin.closebtnfromtop.ToString();
}
@@ -2287,7 +2303,7 @@ namespace ShiftOS
CustomizingSkin.closebtnfromside = Convert.ToInt16(txtclosebuttonfromside.Text);
AddCP(1);
}
- catch
+ catch
{
txtclosebuttonfromside.Text = CustomizingSkin.closebtnfromside.ToString();
}
@@ -2725,7 +2741,7 @@ namespace ShiftOS
{
CustomizingSkin.Menu_ButtonCheckedHighlight = API.GetLastColorFromSession();
CustomizingSkin.Menu_ButtonCheckedHighlightBorder = API.GetLastColorFromSession();
-
+
SetPreviewSkin(true);
AddCP(rand.Next(0, 5));
};
@@ -2826,7 +2842,7 @@ namespace ShiftOS
{
cb.Items.Clear();
var vals = Enum.GetValues(typeof(T)).Cast<T>();
- foreach(var item in vals)
+ foreach (var item in vals)
{
cb.Items.Add(item.ToString());
}
@@ -2839,13 +2855,13 @@ namespace ShiftOS
var vals = Enum.GetValues(typeof(T)).Cast<T>();
foreach (var item in vals)
{
- if(item.ToString() == text)
+ if (item.ToString() == text)
{
objToSet = item;
codepointstogive += 1;
}
}
-
+
}
public void SetupAnimationStyleValues()
@@ -2911,7 +2927,7 @@ namespace ShiftOS
CustomizingSkin.DragFadeSpeed = Convert.ToDouble(txtdragfadedec.Text);
AddCP(1);
}
- catch
+ catch
{
txtdragfadedec.Text = CustomizingSkin.DragFadeSpeed.ToString();
}
@@ -2931,7 +2947,7 @@ namespace ShiftOS
CustomizingSkin.DragFadeLevel = Convert.ToDouble(txtdragopacitydec.Text);
AddCP(1);
}
- catch
+ catch
{
txtdragopacitydec.Text = CustomizingSkin.DragFadeLevel.ToString();
}
@@ -2944,7 +2960,7 @@ namespace ShiftOS
CustomizingSkin.ShakeMaxOffset = Convert.ToInt32(txtshakemax.Text);
AddCP(1);
}
- catch
+ catch
{
txtshakemax.Text = CustomizingSkin.ShakeMaxOffset.ToString();
}
@@ -2957,7 +2973,7 @@ namespace ShiftOS
CustomizingSkin.ShakeMinOffset = Convert.ToInt32(txtshakeminoffset.Text);
AddCP(1);
}
- catch
+ catch
{
txtshakeminoffset.Text = CustomizingSkin.ShakeMinOffset.ToString();
}
@@ -2970,7 +2986,7 @@ namespace ShiftOS
CustomizingSkin.WindowFadeTime = Convert.ToInt32(txtwinfadespeed.Text);
AddCP(1);
}
- catch
+ catch
{
txtwinfadespeed.Text = CustomizingSkin.WindowFadeTime.ToString();
}
@@ -2983,7 +2999,7 @@ namespace ShiftOS
CustomizingSkin.WindowFadeSpeed = Convert.ToDecimal(txtwinfadedec.Text);
AddCP(1);
}
- catch
+ catch
{
txtwinfadedec.Text = CustomizingSkin.WindowFadeSpeed.ToString();
}
@@ -2994,13 +3010,13 @@ namespace ShiftOS
pnlluaoptions.Show();
pnlluaoptions.BringToFront();
SetupLuaUI();
-
+
}
public void SetupLuaUI()
{
- pnlluafield.Controls.Clear();
- flmorebuttons.Controls.Clear();
+ pnlluafield.Widgets.Clear();
+ flmorebuttons.Widgets.Clear();
if (API.LuaShifterRegistry == null)
{
var l = new Label();
@@ -3008,11 +3024,9 @@ namespace ShiftOS
l.TextAlign = ContentAlignment.MiddleCenter;
l.Font = new Font("Microsoft Sans Serif", 12);
l.Text = @"Nothing to show here.
-
There are no options to show here yet.
-
You can add options in the Lua interpreter using the shifter_add_category(string name), shifter_add_value(string category, string name, value), and shifter_remove_category(string name) methods. Applications may also add their own values.";
- pnlluafield.Controls.Add(l);
+ pnlluafield.Widgets.Add(l);
l.Show();
}
else
@@ -3024,7 +3038,7 @@ You can add options in the Lua interpreter using the shifter_add_category(string
b.FlatStyle = FlatStyle.Flat;
b.AutoSize = true;
b.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- flmorebuttons.Controls.Add(b);
+ flmorebuttons.Widgets.Add(b);
b.Show();
b.Click += (object s, EventArgs a) =>
{
@@ -3036,8 +3050,8 @@ You can add options in the Lua interpreter using the shifter_add_category(string
public void SetupLuaForm(Dictionary<string, object> d)
{
- pnlluafield.Controls.Clear();
- foreach(var kv in d)
+ pnlluafield.Widgets.Clear();
+ foreach (var kv in d)
{
IShifterSetting l = new ShifterTextInput();
if (kv.Value is string)
@@ -3048,7 +3062,7 @@ You can add options in the Lua interpreter using the shifter_add_category(string
l = new ShifterColorInput();
if (kv.Value is int || kv.Value is float || kv.Value is double || kv.Value is decimal)
l = new ShifterIntInput();
- if(l is ShifterIntInput)
+ if (l is ShifterIntInput)
{
var i = l as ShifterIntInput;
if (kv.Value is int)
@@ -3056,11 +3070,11 @@ You can add options in the Lua interpreter using the shifter_add_category(string
else
i.NoDecimal = false;
}
- if (pnlluafield.Controls.Count > 0)
+ if (pnlluafield.Widgets.Count > 0)
{
- var ctrl = pnlluafield.Controls[pnlluafield.Controls.Count - 1];
+ var ctrl = pnlluafield.Widgets[pnlluafield.Widgets.Count - 1];
l.Location = new Point(ctrl.Left + ctrl.Width + 5, ctrl.Top);
- if(l.Left + l.Width > pnlluafield.Width)
+ if (l.Left + l.Width > pnlluafield.Width)
{
l.Left = 2;
l.Top = ctrl.Top + ctrl.Height + 2;
@@ -3071,23 +3085,23 @@ You can add options in the Lua interpreter using the shifter_add_category(string
l.Location = new Point(2, 2);
}
- pnlluafield.Controls.Add(l);
+ pnlluafield.Widgets.Add(l);
l.Show();
l.Font = new Font("Microsoft Sans Serif", 9);
l.Text = kv.Key;
l.Value = kv.Value;
- l.OnValueChange += (hello, its_me) =>
+ l.OnValueChange += (hello, its_me) =>
{
- foreach(var dict in API.LuaShifterRegistry)
+ foreach (var dict in API.LuaShifterRegistry)
{
- if(API.LuaShifterRegistry[dict.Key] == d)
+ if (API.LuaShifterRegistry[dict.Key] == d)
{
API.LuaShifterRegistry[dict.Key][kv.Key] = l.Value;
}
}
};
-
+
}
}
}
-}
+} \ No newline at end of file