Day 7 and 8

This commit is contained in:
Alkaline Thunder 2019-01-04 16:01:10 -05:00
parent c12d920ca5
commit 79cf187166
37 changed files with 12100 additions and 444 deletions

View file

@ -21,7 +21,10 @@ namespace ShiftOS.Commands
InConsole.WriteLine("");
InConsole.WriteLine("Tips:");
InConsole.WriteLine("");
InConsole.WriteLine(" - Not yet implemented.");
foreach (var tip in InConsole.CurrentSystem.GetUsefulTips().OrderBy(x=>x))
{
InConsole.WriteLine($" - {tip}");
}
InConsole.WriteLine("");
InConsole.WriteLine("Terminal commands:");
InConsole.WriteLine("");
@ -34,7 +37,10 @@ namespace ShiftOS.Commands
InConsole.WriteLine("");
InConsole.WriteLine("Programs:");
InConsole.WriteLine("");
InConsole.WriteLine(" - Not yet implemented.");
foreach(var program in InConsole.CurrentSystem.GetInstalledPrograms().OrderBy(x=>x))
{
InConsole.WriteLine($" - {program}: {InConsole.CurrentSystem.GetProgramDescription(program)}");
}
InConsole.WriteLine("");
}
}

View file

@ -130,6 +130,7 @@
this.Controls.Add(this.DesktopPanel);
this.ForeColor = System.Drawing.Color.White;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.KeyPreview = true;
this.MainMenuStrip = this.AppLauncherStrip;
this.Name = "Desktop";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

View file

@ -189,6 +189,7 @@ namespace ShiftOS
{
menuItem.Font = new Font(appItemFontName, appItemFontSize, appItemFontStyle);
}
menuItem.ForeColor = skin.GetSkinData().launcheritemcolour;
}
}
@ -197,16 +198,16 @@ namespace ShiftOS
if (skin.HasImage("applauncher"))
{
AppLauncherMenu.Text = "";
AppLauncherMenu.BackColor = Color.Transparent;
if(AppLauncherMenu.BackgroundImage != skin.GetImage("applauncher"))
AppLauncherMenu.BackgroundImage = skin.GetImage("applauncher");
AppLauncherMenu.BackgroundImageLayout = skin.GetSkinData().applauncherlayout;
AppLauncherStrip.BackColor = Color.Transparent;
if(AppLauncherStrip.BackgroundImage != skin.GetImage("applauncher"))
AppLauncherStrip.BackgroundImage = skin.GetImage("applauncher");
AppLauncherStrip.BackgroundImageLayout = skin.GetSkinData().applauncherlayout;
}
else
{
AppLauncherMenu.BackColor = skin.GetSkinData().applauncherbackgroundcolour;
AppLauncherMenu.Text = skin.GetSkinData().applicationlaunchername;
AppLauncherMenu.BackgroundImage = null;
AppLauncherStrip.BackColor = skin.GetSkinData().applauncherbuttoncolour;
AppLauncherStrip.Text = skin.GetSkinData().applicationlaunchername;
AppLauncherStrip.BackgroundImage = null;
}
AppLauncherMenu.Height = skin.GetSkinData().applicationbuttonheight;
@ -265,10 +266,13 @@ namespace ShiftOS
// TODO: Check if we actually have unity mode toggle and shutdown.
var separator = new ToolStripSeparator();
AppLauncherMenu.DropDownItems.Add(separator);
if (CurrentSystem.HasShiftoriumUpgrade("alunitymode") || CurrentSystem.HasShiftoriumUpgrade("applaunchershutdown"))
{
var separator = new ToolStripSeparator();
AppLauncherMenu.DropDownItems.Add(separator);
}
if (CurrentSystem.HasShiftoriumUpgrade("unitymodetoggle"))
if (CurrentSystem.HasShiftoriumUpgrade("alunitymode"))
{
var unityToggle = new ToolStripMenuItem("Toggle Unity Mode");
@ -301,7 +305,10 @@ namespace ShiftOS
}
else if(e.KeyCode == Keys.S && e.Control)
{
CurrentSystem.LaunchProgram("shiftorium");
CurrentSystem.AskForColor("Desktop Panel color", CurrentSystem.GetSkinContext().GetSkinData().desktoppanelcolour, (color) =>
{
CurrentSystem.GetSkinContext().GetSkinData().desktoppanelcolour = color;
});
}
}

View file

@ -120,9 +120,6 @@
<metadata name="AppLauncherStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>
<metadata name="AppLauncherStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>
<metadata name="UpdateTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

View file

@ -6,6 +6,7 @@ using System.IO;
using System.Threading.Tasks;
using System.Reflection;
using System.Windows.Forms;
using System.Drawing;
namespace ShiftOS
{
@ -74,6 +75,19 @@ namespace ShiftOS
return mapped;
}
public Image LoadImage(string InPath)
{
Image ret = null;
if(FileExists(InPath))
{
using (var stream = OpenRead(InPath))
{
ret = new Bitmap(Bitmap.FromStream(stream));
}
}
return ret;
}
public Stream Open(string InPath, FileMode InFileMode)
{
return File.Open(MapToEnvironmentPath(InPath), InFileMode);

View file

@ -1,39 +0,0 @@
Example usage for T4 Docopt.NET
Usage:
prog command ARG <myarg> [OPTIONALARG] [-o -s=<arg> --long=ARG --switch]
prog files FILE...
Options:
-o Short switch.
-s=<arg> Short option with arg.
--long=ARG Long option with arg.
--switch Long switch.
Explanation:
This is an example usage file that needs to be customized.
Every time you change this file, run the Custom Tool command
on T4DocoptNet.tt to re-generate the MainArgs class
(defined in T4DocoptNet.cs).
You can then use the MainArgs classed as follows:
class Program
{
static void DoStuff(string arg, bool flagO, string longValue)
{
// ...
}
static void Main(string[] argv)
{
// Automatically exit(1) if invalid arguments
var args = new MainArgs(argv, exit: true);
if (args.CmdCommand)
{
Console.WriteLine("First command");
DoStuff(args.ArgArg, args.OptO, args.OptLong);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Windowing;
using System.Windows.Forms;
using Newtonsoft.Json;
namespace ShiftOS.Programs
{
public partial class ColorPicker : Window
{
public ColorPicker()
{
InitializeComponent();
ColorDatabase = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<int, List<Color>>>>(Properties.Resources.ColorPickerDefaults);
}
private Dictionary<string, Dictionary<int, List<Color>>> ColorDatabase = new Dictionary<string, Dictionary<int, List<Color>>>();
public string ColorName { get => lblobjecttocolour.Text; set => lblobjecttocolour.Text = value; }
public Action<Color> Callback { get; set; }
public Color OldColor { get; set; } = Color.Black;
private int graylevel, redlevel, bluelevel, greenlevel, pinklevel, purplelevel, orangelevel, yellowlevel, brownlevel, anylevel = 0;
private void pnloldcolour_MouseClick(object sender, MouseEventArgs e)
{
Callback?.Invoke(OldColor);
Close();
}
private void pnlnewcolour_MouseClick(object sender, MouseEventArgs e)
{
Callback?.Invoke(pnlnewcolour.BackColor);
Close();
}
private void determinecolor(Panel container, int level, string color)
{
if(ColorDatabase.ContainsKey(color))
{
var colorlistmap = ColorDatabase[color];
if(colorlistmap.ContainsKey(level))
{
var colors = colorlistmap[level];
foreach (Control control in container.Controls.OfType<Panel>().Where(x => char.IsNumber(x.Name.Last())).OrderBy(x => (int)x.Tag))
{
if (control is Panel)
{
int tag = (int)control.Tag - 1;
if(tag >= 0 && tag < colors.Count)
{
control.BackColor = colors[tag];
control.Show();
}
else
{
control.BackColor = Color.White;
control.Hide();
}
}
}
}
}
}
private void determinelevels()
{
if (CurrentSystem.HasShiftoriumUpgrade("gray")) graylevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("grayshades")) graylevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullgrayshadeset")) graylevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customgrayshades")) graylevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("basiccustomshade")) anylevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("generalcustomshades")) anylevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("advancedcustomshades")) anylevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("limitlesscustomshades")) anylevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("purple")) purplelevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("purpleshades")) purplelevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullpurpleshadeset")) purplelevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("custompurpleshades")) purplelevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("blue")) bluelevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("blueshades")) bluelevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullblueshadeset")) bluelevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customblueshades")) bluelevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("green")) greenlevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("greenshades")) greenlevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullgreenshadeset")) greenlevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customgreenshades")) greenlevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("yellow")) yellowlevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("yellowshades")) yellowlevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullyellowshadeset")) yellowlevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customyellowshades")) yellowlevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("orange")) orangelevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("orangeshades")) orangelevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullorangeshadeset")) orangelevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customorangeshades")) orangelevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("brown")) brownlevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("brownshades")) brownlevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullbrownshadeset")) brownlevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("custombrownshades")) brownlevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("red")) redlevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("redshades")) redlevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullredshadeset")) redlevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("customredshades")) redlevel = 4;
if (CurrentSystem.HasShiftoriumUpgrade("pink")) pinklevel = 1;
if (CurrentSystem.HasShiftoriumUpgrade("pinkshades")) pinklevel = 2;
if (CurrentSystem.HasShiftoriumUpgrade("fullpinkshadeset")) pinklevel = 3;
if (CurrentSystem.HasShiftoriumUpgrade("custompinkshades")) pinklevel = 4;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
foreach(Panel panel in pnlcolorgroups.Controls)
{
foreach(Control child in panel.Controls)
{
if (child is Panel)
{
(child as Panel).BorderStyle = BorderStyle.FixedSingle;
string name = child.Name;
if(char.IsNumber(name.Last()))
{
string number = string.Join("", name.Where(x => char.IsNumber(x)).ToArray());
child.Tag = Convert.ToInt32(number);
child.MouseClick += (o, a) =>
{
pnlnewcolour.BackColor = child.BackColor;
};
}
}
}
}
}
protected override void OnDesktopUpdate()
{
base.OnDesktopUpdate();
pnloldcolour.BackColor = OldColor;
lbloldcolourname.Text = $"{OldColor.Name} :Name";
lbloldcolourrgb.Text = $"{OldColor.R} {OldColor.G} {OldColor.B} :RGB";
var NewColor = pnlnewcolour.BackColor;
lblnewcolourname.Text = $"{NewColor.Name} :Name";
lblnewcolourrgb.Text = $"{NewColor.R} {NewColor.G} {NewColor.B} :RGB";
// Determine color levels based on Shiftorium state.
determinelevels();
// Set color level visibility.
pnlgraycolours.Visible = graylevel > 0;
pnlredcolours.Visible = redlevel > 0;
pnlgreencolours.Visible = greenlevel > 0;
pnlbluecolours.Visible = bluelevel > 0;
pnlorangecolours.Visible = orangelevel > 0;
pnlyellowcolours.Visible = yellowlevel > 0;
pnlpinkcolours.Visible = pinklevel > 0;
pnlpurplecolours.Visible = purplelevel > 0;
pnlbrowncolours.Visible = brownlevel > 0;
pnlanycolours.Visible = anylevel > 0;
// Set color level text.
lblgraylevel.Text = $"Level {graylevel}";
lblredlevel.Text = $"Level {redlevel}";
lblgreenlevel.Text = $"Level {greenlevel}";
lblbluelevel.Text = $"Level {bluelevel}";
lblyellowlevel.Text = $"Level {yellowlevel}";
lblorangelevel.Text = $"Level {orangelevel}";
lblpinklevel.Text = $"Level {pinklevel}";
lblpurplelevel.Text = $"Level {purplelevel}";
lblbrownlevel.Text = $"Level {brownlevel}";
lblanylevel.Text = $"Level {anylevel}";
// Determine the actual colors.
determinecolor(pnlgraycolours, graylevel, "gray");
determinecolor(pnlredcolours, redlevel, "red");
determinecolor(pnlgreencolours, greenlevel, "green");
determinecolor(pnlbluecolours, bluelevel, "blue");
determinecolor(pnlyellowcolours, yellowlevel, "yellow");
determinecolor(pnlorangecolours, orangelevel, "orange");
determinecolor(pnlpinkcolours, pinklevel, "pink");
determinecolor(pnlpurplecolours, purplelevel, "purple");
determinecolor(pnlbrowncolours, brownlevel, "brown");
determinecolor(pnlanycolours, anylevel, "any");
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -40,9 +40,18 @@
this.ImageList1 = new System.Windows.Forms.ImageList(this.components);
this.lvfiles = new System.Windows.Forms.ListView();
this.pgcontents = new System.Windows.Forms.Panel();
this.pnlopenoptions = new System.Windows.Forms.Panel();
this.txtfilename = new System.Windows.Forms.TextBox();
this.lblfilenameprompt = new System.Windows.Forms.Label();
this.cmbformatchooser = new System.Windows.Forms.ComboBox();
this.btncancel = new System.Windows.Forms.Button();
this.btnopen = new System.Windows.Forms.Button();
this.lbextention = new System.Windows.Forms.Label();
this.lblcurrentlydisplayingprompt = new System.Windows.Forms.Label();
this.panel4.SuspendLayout();
this.pnloptions.SuspendLayout();
this.pgcontents.SuspendLayout();
this.pnlopenoptions.SuspendLayout();
this.SuspendLayout();
//
// lbllocation
@ -91,6 +100,7 @@
this.btndeletefile.Text = "Delete Folder";
this.btndeletefile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btndeletefile.UseVisualStyleBackColor = false;
this.btndeletefile.Click += new System.EventHandler(this.btndeletefile_Click);
//
// btnnewfolder
//
@ -106,6 +116,7 @@
this.btnnewfolder.Text = "New Folder";
this.btnnewfolder.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnnewfolder.UseVisualStyleBackColor = false;
this.btnnewfolder.Click += new System.EventHandler(this.btnnewfolder_Click);
//
// pnlbreak
//
@ -113,7 +124,7 @@
this.pnlbreak.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pnlbreak.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlbreak.ForeColor = System.Drawing.Color.Black;
this.pnlbreak.Location = new System.Drawing.Point(0, 365);
this.pnlbreak.Location = new System.Drawing.Point(0, 323);
this.pnlbreak.Name = "pnlbreak";
this.pnlbreak.Size = new System.Drawing.Size(796, 15);
this.pnlbreak.TabIndex = 7;
@ -123,7 +134,7 @@
this.pnloptions.Controls.Add(this.btndeletefile);
this.pnloptions.Controls.Add(this.btnnewfolder);
this.pnloptions.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnloptions.Location = new System.Drawing.Point(0, 380);
this.pnloptions.Location = new System.Drawing.Point(0, 338);
this.pnloptions.Name = "pnloptions";
this.pnloptions.Size = new System.Drawing.Size(796, 38);
this.pnloptions.TabIndex = 6;
@ -162,7 +173,7 @@
this.lvfiles.LargeImageList = this.ImageList1;
this.lvfiles.Location = new System.Drawing.Point(0, 33);
this.lvfiles.Name = "lvfiles";
this.lvfiles.Size = new System.Drawing.Size(796, 332);
this.lvfiles.Size = new System.Drawing.Size(796, 290);
this.lvfiles.TabIndex = 3;
this.lvfiles.UseCompatibleStateImageBehavior = false;
this.lvfiles.DoubleClick += new System.EventHandler(this.lvfiles_DoubleClick);
@ -172,6 +183,7 @@
this.pgcontents.Controls.Add(this.lvfiles);
this.pgcontents.Controls.Add(this.pnlbreak);
this.pgcontents.Controls.Add(this.pnloptions);
this.pgcontents.Controls.Add(this.pnlopenoptions);
this.pgcontents.Controls.Add(this.panel3);
this.pgcontents.Controls.Add(this.panel4);
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
@ -180,6 +192,98 @@
this.pgcontents.Size = new System.Drawing.Size(796, 418);
this.pgcontents.TabIndex = 25;
//
// pnlopenoptions
//
this.pnlopenoptions.Controls.Add(this.txtfilename);
this.pnlopenoptions.Controls.Add(this.lblfilenameprompt);
this.pnlopenoptions.Controls.Add(this.cmbformatchooser);
this.pnlopenoptions.Controls.Add(this.btncancel);
this.pnlopenoptions.Controls.Add(this.btnopen);
this.pnlopenoptions.Controls.Add(this.lbextention);
this.pnlopenoptions.Controls.Add(this.lblcurrentlydisplayingprompt);
this.pnlopenoptions.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlopenoptions.Location = new System.Drawing.Point(0, 376);
this.pnlopenoptions.Name = "pnlopenoptions";
this.pnlopenoptions.Size = new System.Drawing.Size(796, 42);
this.pnlopenoptions.TabIndex = 11;
//
// txtfilename
//
this.txtfilename.BackColor = System.Drawing.Color.White;
this.txtfilename.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtfilename.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtfilename.Location = new System.Drawing.Point(87, 10);
this.txtfilename.Name = "txtfilename";
this.txtfilename.Size = new System.Drawing.Size(480, 22);
this.txtfilename.TabIndex = 0;
//
// lblfilenameprompt
//
this.lblfilenameprompt.AutoSize = true;
this.lblfilenameprompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblfilenameprompt.Location = new System.Drawing.Point(6, 13);
this.lblfilenameprompt.Name = "lblfilenameprompt";
this.lblfilenameprompt.Size = new System.Drawing.Size(73, 16);
this.lblfilenameprompt.TabIndex = 1;
this.lblfilenameprompt.Text = "File Name:";
//
// cmbformatchooser
//
this.cmbformatchooser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cmbformatchooser.FormattingEnabled = true;
this.cmbformatchooser.Location = new System.Drawing.Point(579, 10);
this.cmbformatchooser.Name = "cmbformatchooser";
this.cmbformatchooser.Size = new System.Drawing.Size(45, 21);
this.cmbformatchooser.TabIndex = 4;
this.cmbformatchooser.SelectedIndexChanged += new System.EventHandler(this.cmbformatchooser_SelectedIndexChanged);
//
// btncancel
//
this.btncancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btncancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btncancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btncancel.Location = new System.Drawing.Point(630, 5);
this.btncancel.Name = "btncancel";
this.btncancel.Size = new System.Drawing.Size(75, 29);
this.btncancel.TabIndex = 4;
this.btncancel.Text = "Cancel";
this.btncancel.UseVisualStyleBackColor = true;
this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
//
// btnopen
//
this.btnopen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnopen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnopen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnopen.Location = new System.Drawing.Point(711, 5);
this.btnopen.Name = "btnopen";
this.btnopen.Size = new System.Drawing.Size(75, 29);
this.btnopen.TabIndex = 3;
this.btnopen.Text = "Open";
this.btnopen.UseVisualStyleBackColor = true;
this.btnopen.Click += new System.EventHandler(this.btnopen_Click);
//
// lbextention
//
this.lbextention.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lbextention.AutoSize = true;
this.lbextention.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbextention.Location = new System.Drawing.Point(573, 3);
this.lbextention.Name = "lbextention";
this.lbextention.Size = new System.Drawing.Size(51, 31);
this.lbextention.TabIndex = 2;
this.lbextention.Text = ".txt";
//
// lblcurrentlydisplayingprompt
//
this.lblcurrentlydisplayingprompt.AutoSize = true;
this.lblcurrentlydisplayingprompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblcurrentlydisplayingprompt.Location = new System.Drawing.Point(8, 13);
this.lblcurrentlydisplayingprompt.Name = "lblcurrentlydisplayingprompt";
this.lblcurrentlydisplayingprompt.Size = new System.Drawing.Size(360, 16);
this.lblcurrentlydisplayingprompt.TabIndex = 1;
this.lblcurrentlydisplayingprompt.Text = "Currently displaying files to open with the following extention:";
//
// FileSkimmer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -194,6 +298,8 @@
this.panel4.ResumeLayout(false);
this.pnloptions.ResumeLayout(false);
this.pgcontents.ResumeLayout(false);
this.pnlopenoptions.ResumeLayout(false);
this.pnlopenoptions.PerformLayout();
this.ResumeLayout(false);
}
@ -209,5 +315,13 @@
internal System.Windows.Forms.ImageList ImageList1;
internal System.Windows.Forms.ListView lvfiles;
internal System.Windows.Forms.Panel pgcontents;
internal System.Windows.Forms.Panel pnlopenoptions;
internal System.Windows.Forms.Button btncancel;
internal System.Windows.Forms.Button btnopen;
internal System.Windows.Forms.Label lbextention;
internal System.Windows.Forms.Label lblcurrentlydisplayingprompt;
internal System.Windows.Forms.TextBox txtfilename;
internal System.Windows.Forms.Label lblfilenameprompt;
internal System.Windows.Forms.ComboBox cmbformatchooser;
}
}

View file

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using ShiftOS.Metadata;
using ShiftOS.Windowing;
using System.Windows.Forms;
using System.IO;
namespace ShiftOS.Programs
{
@ -24,6 +25,21 @@ namespace ShiftOS.Programs
InitializeComponent();
}
public FileSkimmerMode Mode { get; set; } = FileSkimmerMode.Skim;
public Func<string, bool> FileOpenCallback { get; set; }
public void SetFilters(string[] InFilters)
{
cmbformatchooser.Items.Clear();
foreach(var filter in InFilters)
{
cmbformatchooser.Items.Add(filter);
}
cmbformatchooser.SelectedIndex = 0;
lbextention.Text = InFilters[0];
}
private string GetIcon(string extension)
{
switch(extension)
@ -93,6 +109,10 @@ namespace ShiftOS.Programs
// Now onto files.
foreach(var file in fs.GetFiles(_working))
{
if (Mode != FileSkimmerMode.Skim)
if (!file.ToLower().EndsWith(lbextention.Text))
continue;
var fileItem = new ListViewItem();
fileItem.Tag = file;
@ -121,6 +141,59 @@ namespace ShiftOS.Programs
// Update the working directory.
lbllocation.Text = _working;
pnloptions.Visible = CurrentSystem.HasShiftoriumUpgrade("fsnewfolder") || CurrentSystem.HasShiftoriumUpgrade("fsdelete") && Mode == FileSkimmerMode.Skim;
btnnewfolder.Visible = CurrentSystem.HasShiftoriumUpgrade("fsnewfolder");
btndeletefile.Visible = CurrentSystem.HasShiftoriumUpgrade("fsdelete") && lvfiles.SelectedItems.Count > 0 && lvfiles.SelectedItems[0].Tag.ToString() != "..";
pnlopenoptions.Visible = Mode == FileSkimmerMode.Open || Mode == FileSkimmerMode.Save;
pnlbreak.Visible = pnlopenoptions.Visible || pnloptions.Visible;
switch(Mode)
{
case FileSkimmerMode.Open:
txtfilename.Hide();
lblfilenameprompt.Hide();
lblcurrentlydisplayingprompt.Show();
btnopen.Text = "Open";
break;
case FileSkimmerMode.Save:
txtfilename.Show();
lblfilenameprompt.Show();
lblcurrentlydisplayingprompt.Hide();
btnopen.Text = "Save";
break;
}
if(pnlopenoptions.Visible)
{
if(cmbformatchooser.Items.Count == 1)
{
cmbformatchooser.Hide();
}
else
{
cmbformatchooser.Show();
}
lbextention.Text = cmbformatchooser.SelectedItem.ToString();
}
if(btndeletefile.Visible)
{
var item = lvfiles.SelectedItems[0];
if(item.ImageKey == "folder")
{
btndeletefile.Text = "Delete Folder";
btndeletefile.Image = Properties.Resources.deletefolder;
}
else
{
btndeletefile.Text = "Delete File";
btndeletefile.Image = Properties.Resources.deletefile;
}
}
base.OnDesktopUpdate();
}
@ -131,7 +204,9 @@ namespace ShiftOS.Programs
lvfiles.LargeImageList = ImageList1;
lvfiles.SmallImageList = ImageList1;
UpdateFolderList();
if(CurrentSystem!=null)
UpdateFolderList();
}
private void lvfiles_DoubleClick(object sender, EventArgs e)
@ -157,8 +232,193 @@ namespace ShiftOS.Programs
_working = itemTag;
UpdateFolderList();
}
else if(fs.FileExists(itemTag))
{
txtfilename.Text = itemTag.Substring(itemTag.LastIndexOf("/") + 1);
HandleFileOpen();
}
}
}
}
private void btnnewfolder_Click(object sender, EventArgs e)
{
string work = this._working;
CurrentSystem.AskForText("New Folder", "Please enter a name for your new folder.", (name) =>
{
if(string.IsNullOrWhiteSpace(name))
{
CurrentSystem.ShowInfo("New Folder", "The folder name cannot be blank.");
return false;
}
if (name.Any(x => Path.GetInvalidFileNameChars().Contains(x)))
{
CurrentSystem.ShowInfo("New Folder", "The folder name contains some invalid characters.");
return false;
}
string path = "";
if (work.EndsWith("/"))
path = work + name;
else
path = work + "/" + name;
var fs = CurrentSystem.GetFilesystem();
if(fs.DirectoryExists(path))
{
CurrentSystem.ShowInfo("New Folder", "A folder with that name already exists.");
return false;
}
fs.CreateDirectory(path);
UpdateFolderList();
return true;
});
}
private void btndeletefile_Click(object sender, EventArgs e)
{
string path = lvfiles.SelectedItems[0].Tag.ToString();
if(path.StartsWith("/Shiftum42") || path.StartsWith("/SoftwareData"))
{
CurrentSystem.ShowInfo("Permission denied.", $"You do not have permission to delete {path}.");
return;
}
var fs = CurrentSystem.GetFilesystem();
if(fs.DirectoryExists(path))
{
CurrentSystem.AskYesNo("Delete folder?", $"Do you erally want to delete {path}?", (answer) =>
{
if (answer)
{
fs.DeleteDirectory(path, true);
UpdateFolderList();
}
});
}
else if(fs.FileExists(path))
{
CurrentSystem.AskYesNo("Delete file?", $"Do you erally want to delete {path}?", (answer) =>
{
if (answer)
{
fs.DeleteFile(path);
UpdateFolderList();
}
});
}
}
private void btncancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnopen_Click(object sender, EventArgs e)
{
HandleFileOpen();
}
private void HandleFileOpen()
{
var fs = CurrentSystem.GetFilesystem();
switch(Mode)
{
case FileSkimmerMode.Open:
if(lvfiles.SelectedItems.Count == 0)
{
CurrentSystem.ShowInfo("Open File", "No file has been selected.");
return;
}
string path = lvfiles.SelectedItems[0].Tag.ToString();
if(fs.FileExists(path))
{
if(FileOpenCallback?.Invoke(path) == true)
{
Close();
return;
}
}
else
{
CurrentSystem.ShowInfo("Open File", "File not found.");
return;
}
break;
case FileSkimmerMode.Save:
string work = _working;
string name = txtfilename.Text;
if(string.IsNullOrWhiteSpace(name))
{
CurrentSystem.ShowInfo("Save File", "Please enter a file name.");
return;
}
if(!name.ToLower().EndsWith(lbextention.Text))
{
name += lbextention.Text;
}
if(name.Any(x=>Path.GetInvalidFileNameChars().Contains(x)))
{
CurrentSystem.ShowInfo("Save File", "The file name you entered contains some invalid characters.");
return;
}
string savePath = "";
if (work.EndsWith("/"))
savePath = work + name;
else
savePath = work + "/" + name;
if(savePath.StartsWith("/Shiftum42") || savePath.StartsWith("/SoftwareData"))
{
CurrentSystem.ShowInfo("Permission denied.", "You do not have permission to save here.");
return;
}
if(fs.FileExists(savePath))
{
CurrentSystem.AskYesNo("Save File - Overwrite?", "A file with that name already exists. Do you want to overwrite it?", (answer) =>
{
if(FileOpenCallback?.Invoke(savePath) == true)
{
Close();
return;
}
});
return;
}
else
{
if(FileOpenCallback?.Invoke(savePath)==true)
{
Close();
return;
}
}
break;
}
}
private void cmbformatchooser_SelectedIndexChanged(object sender, EventArgs e)
{
lbextention.Text = cmbformatchooser.SelectedItem.ToString();
UpdateFolderList();
}
}
public enum FileSkimmerMode
{
Skim,
Open,
Save
}
}

View file

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABG
QQAAAk1TRnQBSQFMAgEBFAEAAbgBAQG4AQEBKgEAASoBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
QQAAAk1TRnQBSQFMAgEBFAEAAdgBAQHYAQEBKgEAASoBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABqAMAAfwDAAEBAQABCAUAAWABpRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz

View file

@ -0,0 +1,271 @@
namespace ShiftOS.Programs
{
partial class GraphicPicker
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btncancel = new System.Windows.Forms.Button();
this.btnreset = new System.Windows.Forms.Button();
this.btnapply = new System.Windows.Forms.Button();
this.Label2 = new System.Windows.Forms.Label();
this.btnidlebrowse = new System.Windows.Forms.Button();
this.txtidlefile = new System.Windows.Forms.TextBox();
this.picidle = new System.Windows.Forms.PictureBox();
this.btnzoom = new System.Windows.Forms.Button();
this.btnstretch = new System.Windows.Forms.Button();
this.lblobjecttoskin = new System.Windows.Forms.Label();
this.picgraphic = new System.Windows.Forms.PictureBox();
this.btncentre = new System.Windows.Forms.Button();
this.btntile = new System.Windows.Forms.Button();
this.pnlgraphicholder = new System.Windows.Forms.Panel();
this.pgcontents = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.picidle)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picgraphic)).BeginInit();
this.pnlgraphicholder.SuspendLayout();
this.pgcontents.SuspendLayout();
this.SuspendLayout();
//
// btncancel
//
this.btncancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btncancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btncancel.Location = new System.Drawing.Point(19, 298);
this.btncancel.Name = "btncancel";
this.btncancel.Size = new System.Drawing.Size(109, 32);
this.btncancel.TabIndex = 23;
this.btncancel.Text = "Cancel";
this.btncancel.UseVisualStyleBackColor = true;
this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
//
// btnreset
//
this.btnreset.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnreset.Location = new System.Drawing.Point(134, 298);
this.btnreset.Name = "btnreset";
this.btnreset.Size = new System.Drawing.Size(109, 32);
this.btnreset.TabIndex = 22;
this.btnreset.Text = "Reset";
this.btnreset.UseVisualStyleBackColor = true;
this.btnreset.Click += new System.EventHandler(this.btnreset_Click);
//
// btnapply
//
this.btnapply.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnapply.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnapply.Location = new System.Drawing.Point(249, 298);
this.btnapply.Name = "btnapply";
this.btnapply.Size = new System.Drawing.Size(118, 32);
this.btnapply.TabIndex = 21;
this.btnapply.Text = "Apply";
this.btnapply.UseVisualStyleBackColor = true;
this.btnapply.Click += new System.EventHandler(this.btnapply_Click);
//
// Label2
//
this.Label2.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label2.Location = new System.Drawing.Point(124, 215);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(163, 28);
this.Label2.TabIndex = 12;
this.Label2.Text = "Idle";
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnidlebrowse
//
this.btnidlebrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnidlebrowse.Location = new System.Drawing.Point(294, 215);
this.btnidlebrowse.Name = "btnidlebrowse";
this.btnidlebrowse.Size = new System.Drawing.Size(73, 60);
this.btnidlebrowse.TabIndex = 10;
this.btnidlebrowse.Text = "Browse";
this.btnidlebrowse.UseVisualStyleBackColor = true;
this.btnidlebrowse.Click += new System.EventHandler(this.btnidlebrowse_Click);
//
// txtidlefile
//
this.txtidlefile.BackColor = System.Drawing.Color.White;
this.txtidlefile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtidlefile.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtidlefile.Location = new System.Drawing.Point(124, 246);
this.txtidlefile.Multiline = true;
this.txtidlefile.Name = "txtidlefile";
this.txtidlefile.Size = new System.Drawing.Size(163, 29);
this.txtidlefile.TabIndex = 9;
this.txtidlefile.Text = "None";
this.txtidlefile.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// picidle
//
this.picidle.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.picidle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picidle.Location = new System.Drawing.Point(18, 215);
this.picidle.Name = "picidle";
this.picidle.Size = new System.Drawing.Size(100, 60);
this.picidle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picidle.TabIndex = 8;
this.picidle.TabStop = false;
//
// btnzoom
//
this.btnzoom.BackgroundImage = global::ShiftOS.Properties.Resources.zoombutton;
this.btnzoom.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btnzoom.FlatAppearance.BorderSize = 0;
this.btnzoom.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnzoom.Location = new System.Drawing.Point(286, 144);
this.btnzoom.Name = "btnzoom";
this.btnzoom.Size = new System.Drawing.Size(82, 65);
this.btnzoom.TabIndex = 7;
this.btnzoom.UseVisualStyleBackColor = true;
this.btnzoom.Click += new System.EventHandler(this.btnzoom_Click);
//
// btnstretch
//
this.btnstretch.BackgroundImage = global::ShiftOS.Properties.Resources.stretchbutton;
this.btnstretch.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btnstretch.FlatAppearance.BorderSize = 0;
this.btnstretch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnstretch.Location = new System.Drawing.Point(197, 144);
this.btnstretch.Name = "btnstretch";
this.btnstretch.Size = new System.Drawing.Size(82, 65);
this.btnstretch.TabIndex = 6;
this.btnstretch.UseVisualStyleBackColor = true;
this.btnstretch.Click += new System.EventHandler(this.btnstretch_Click);
//
// lblobjecttoskin
//
this.lblobjecttoskin.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblobjecttoskin.Location = new System.Drawing.Point(19, 9);
this.lblobjecttoskin.Name = "lblobjecttoskin";
this.lblobjecttoskin.Size = new System.Drawing.Size(350, 23);
this.lblobjecttoskin.TabIndex = 2;
this.lblobjecttoskin.Text = "Close Button";
this.lblobjecttoskin.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// picgraphic
//
this.picgraphic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.picgraphic.Location = new System.Drawing.Point(0, 0);
this.picgraphic.Name = "picgraphic";
this.picgraphic.Size = new System.Drawing.Size(350, 100);
this.picgraphic.TabIndex = 0;
this.picgraphic.TabStop = false;
//
// btncentre
//
this.btncentre.BackgroundImage = global::ShiftOS.Properties.Resources.centrebutton;
this.btncentre.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btncentre.FlatAppearance.BorderSize = 0;
this.btncentre.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btncentre.Location = new System.Drawing.Point(108, 144);
this.btncentre.Name = "btncentre";
this.btncentre.Size = new System.Drawing.Size(82, 65);
this.btncentre.TabIndex = 5;
this.btncentre.UseVisualStyleBackColor = true;
this.btncentre.Click += new System.EventHandler(this.btncentre_Click);
//
// btntile
//
this.btntile.BackgroundImage = global::ShiftOS.Properties.Resources.tilebutton;
this.btntile.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btntile.FlatAppearance.BorderSize = 0;
this.btntile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btntile.Location = new System.Drawing.Point(19, 144);
this.btntile.Name = "btntile";
this.btntile.Size = new System.Drawing.Size(82, 65);
this.btntile.TabIndex = 4;
this.btntile.UseVisualStyleBackColor = true;
this.btntile.Click += new System.EventHandler(this.btntile_Click);
//
// pnlgraphicholder
//
this.pnlgraphicholder.Controls.Add(this.picgraphic);
this.pnlgraphicholder.Location = new System.Drawing.Point(19, 38);
this.pnlgraphicholder.Name = "pnlgraphicholder";
this.pnlgraphicholder.Size = new System.Drawing.Size(350, 100);
this.pnlgraphicholder.TabIndex = 3;
//
// pgcontents
//
this.pgcontents.BackColor = System.Drawing.Color.White;
this.pgcontents.Controls.Add(this.btncancel);
this.pgcontents.Controls.Add(this.btnreset);
this.pgcontents.Controls.Add(this.btnapply);
this.pgcontents.Controls.Add(this.Label2);
this.pgcontents.Controls.Add(this.btnidlebrowse);
this.pgcontents.Controls.Add(this.txtidlefile);
this.pgcontents.Controls.Add(this.picidle);
this.pgcontents.Controls.Add(this.btnzoom);
this.pgcontents.Controls.Add(this.btnstretch);
this.pgcontents.Controls.Add(this.btncentre);
this.pgcontents.Controls.Add(this.btntile);
this.pgcontents.Controls.Add(this.pnlgraphicholder);
this.pgcontents.Controls.Add(this.lblobjecttoskin);
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgcontents.Location = new System.Drawing.Point(2, 30);
this.pgcontents.Name = "pgcontents";
this.pgcontents.Size = new System.Drawing.Size(386, 346);
this.pgcontents.TabIndex = 25;
//
// GraphicPicker
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(390, 378);
this.Controls.Add(this.pgcontents);
this.Name = "GraphicPicker";
this.Text = "GraphicPicker";
this.WindowIcon = global::ShiftOS.Properties.Resources.icongraphicpicker;
this.WindowTitle = "Graphic Picker";
this.Controls.SetChildIndex(this.pgcontents, 0);
((System.ComponentModel.ISupportInitialize)(this.picidle)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picgraphic)).EndInit();
this.pnlgraphicholder.ResumeLayout(false);
this.pgcontents.ResumeLayout(false);
this.pgcontents.PerformLayout();
this.ResumeLayout(false);
}
#endregion
internal System.Windows.Forms.Button btncancel;
internal System.Windows.Forms.Button btnreset;
internal System.Windows.Forms.Button btnapply;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Button btnidlebrowse;
internal System.Windows.Forms.TextBox txtidlefile;
internal System.Windows.Forms.PictureBox picidle;
internal System.Windows.Forms.Button btnzoom;
internal System.Windows.Forms.Button btnstretch;
internal System.Windows.Forms.Label lblobjecttoskin;
internal System.Windows.Forms.PictureBox picgraphic;
internal System.Windows.Forms.Button btncentre;
internal System.Windows.Forms.Button btntile;
internal System.Windows.Forms.Panel pnlgraphicholder;
internal System.Windows.Forms.Panel pgcontents;
}
}

View file

@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Windowing;
using System.Windows.Forms;
namespace ShiftOS.Programs
{
public partial class GraphicPicker : Window
{
public Image CurrentGraphic { get; set; }
public ImageLayout CurrentLayout { get; set; } = ImageLayout.Center;
public Action<Image, ImageLayout> Callback { get; set; }
public string GraphicName { get => lblobjecttoskin.Text; set => lblobjecttoskin.Text = value; }
public GraphicPicker()
{
InitializeComponent();
}
protected override void OnDesktopUpdate()
{
picgraphic.BackgroundImage = CurrentGraphic;
picgraphic.BackgroundImageLayout = CurrentLayout;
picidle.BackgroundImage = CurrentGraphic;
picidle.BackgroundImageLayout = CurrentLayout;
btntile.BackgroundImage = (CurrentLayout == ImageLayout.Tile) ? Properties.Resources.tilebuttonpressed : Properties.Resources.tilebutton;
btncentre.BackgroundImage = (CurrentLayout == ImageLayout.Center) ? Properties.Resources.centrebuttonpressed : Properties.Resources.centrebutton;
btnstretch.BackgroundImage = (CurrentLayout == ImageLayout.Stretch) ? Properties.Resources.stretchbuttonpressed : Properties.Resources.stretchbutton;
btnzoom.BackgroundImage = (CurrentLayout == ImageLayout.Zoom) ? Properties.Resources.zoombuttonpressed : Properties.Resources.zoombutton;
base.OnDesktopUpdate();
}
private void btnidlebrowse_Click(object sender, EventArgs e)
{
CurrentSystem.AskForFile(new[]
{
".pic",
".png",
".jpg",
".jpeg",
".bmp",
".gif"
}, false, (path) =>
{
try
{
if (CurrentGraphic != null)
CurrentGraphic.Dispose();
CurrentGraphic = CurrentSystem.GetFilesystem().LoadImage(path);
return true;
}
catch
{
CurrentSystem.ShowInfo("Graphic Picker", "Graphic Picker could not open the graphic you selected.");
return false;
}
});
}
private void btntile_Click(object sender, EventArgs e)
{
CurrentLayout = ImageLayout.Tile;
}
private void btncentre_Click(object sender, EventArgs e)
{
CurrentLayout = ImageLayout.Center;
}
private void btnstretch_Click(object sender, EventArgs e)
{
CurrentLayout = ImageLayout.Stretch;
}
private void btnzoom_Click(object sender, EventArgs e)
{
CurrentLayout = ImageLayout.Zoom;
}
private void btncancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnreset_Click(object sender, EventArgs e)
{
CurrentGraphic = null;
CurrentLayout = ImageLayout.Center;
}
private void btnapply_Click(object sender, EventArgs e)
{
Callback?.Invoke(CurrentGraphic, CurrentLayout);
Close();
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,196 @@
namespace ShiftOS.Programs
{
partial class Infobox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblintructtext = new System.Windows.Forms.Label();
this.pboximage = new System.Windows.Forms.PictureBox();
this.txtmessage = new System.Windows.Forms.Label();
this.btnok = new System.Windows.Forms.Button();
this.txtuserinput = new System.Windows.Forms.TextBox();
this.pnlyesno = new System.Windows.Forms.Panel();
this.btnno = new System.Windows.Forms.Button();
this.btnyes = new System.Windows.Forms.Button();
this.pgcontents = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.pboximage)).BeginInit();
this.pnlyesno.SuspendLayout();
this.pgcontents.SuspendLayout();
this.SuspendLayout();
//
// lblintructtext
//
this.lblintructtext.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblintructtext.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblintructtext.Location = new System.Drawing.Point(101, 7);
this.lblintructtext.Name = "lblintructtext";
this.lblintructtext.Size = new System.Drawing.Size(256, 44);
this.lblintructtext.TabIndex = 9;
this.lblintructtext.Text = "Please enter a name for your new folder:\r\nOr \r\nDie\r\n";
this.lblintructtext.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.lblintructtext.Visible = false;
//
// pboximage
//
this.pboximage.Image = global::ShiftOS.Properties.Resources.Symbolinfo;
this.pboximage.Location = new System.Drawing.Point(12, 7);
this.pboximage.Name = "pboximage";
this.pboximage.Size = new System.Drawing.Size(80, 70);
this.pboximage.TabIndex = 0;
this.pboximage.TabStop = false;
//
// txtmessage
//
this.txtmessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtmessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtmessage.Location = new System.Drawing.Point(98, 7);
this.txtmessage.Name = "txtmessage";
this.txtmessage.Size = new System.Drawing.Size(266, 70);
this.txtmessage.TabIndex = 2;
this.txtmessage.Text = "It appears that this application may be infected. It is highly recommended that y" +
"ou close it immediatly with a terminal emulator such as Sterm. To close this app" +
"lication just type \"Close\"\r\n";
this.txtmessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnok
//
this.btnok.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnok.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnok.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnok.ForeColor = System.Drawing.Color.Black;
this.btnok.Location = new System.Drawing.Point(134, 86);
this.btnok.Name = "btnok";
this.btnok.Size = new System.Drawing.Size(105, 30);
this.btnok.TabIndex = 7;
this.btnok.TabStop = false;
this.btnok.Text = "Ok";
this.btnok.UseVisualStyleBackColor = true;
this.btnok.Click += new System.EventHandler(this.btnok_Click);
//
// txtuserinput
//
this.txtuserinput.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.txtuserinput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtuserinput.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtuserinput.Location = new System.Drawing.Point(101, 54);
this.txtuserinput.Multiline = true;
this.txtuserinput.Name = "txtuserinput";
this.txtuserinput.Size = new System.Drawing.Size(256, 23);
this.txtuserinput.TabIndex = 8;
this.txtuserinput.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.txtuserinput.Visible = false;
//
// pnlyesno
//
this.pnlyesno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlyesno.Controls.Add(this.btnno);
this.pnlyesno.Controls.Add(this.btnyes);
this.pnlyesno.Location = new System.Drawing.Point(57, 83);
this.pnlyesno.Name = "pnlyesno";
this.pnlyesno.Size = new System.Drawing.Size(265, 33);
this.pnlyesno.TabIndex = 10;
this.pnlyesno.Visible = false;
//
// btnno
//
this.btnno.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnno.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnno.ForeColor = System.Drawing.Color.Black;
this.btnno.Location = new System.Drawing.Point(142, 2);
this.btnno.Name = "btnno";
this.btnno.Size = new System.Drawing.Size(105, 30);
this.btnno.TabIndex = 9;
this.btnno.TabStop = false;
this.btnno.Text = "No";
this.btnno.UseVisualStyleBackColor = true;
this.btnno.Click += new System.EventHandler(this.btnno_Click);
//
// btnyes
//
this.btnyes.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnyes.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnyes.ForeColor = System.Drawing.Color.Black;
this.btnyes.Location = new System.Drawing.Point(29, 2);
this.btnyes.Name = "btnyes";
this.btnyes.Size = new System.Drawing.Size(105, 30);
this.btnyes.TabIndex = 8;
this.btnyes.TabStop = false;
this.btnyes.Text = "Yes";
this.btnyes.UseVisualStyleBackColor = true;
this.btnyes.Click += new System.EventHandler(this.btnyes_Click);
//
// pgcontents
//
this.pgcontents.BackColor = System.Drawing.Color.White;
this.pgcontents.Controls.Add(this.pnlyesno);
this.pgcontents.Controls.Add(this.txtuserinput);
this.pgcontents.Controls.Add(this.btnok);
this.pgcontents.Controls.Add(this.txtmessage);
this.pgcontents.Controls.Add(this.pboximage);
this.pgcontents.Controls.Add(this.lblintructtext);
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgcontents.Location = new System.Drawing.Point(2, 30);
this.pgcontents.Name = "pgcontents";
this.pgcontents.Size = new System.Drawing.Size(367, 122);
this.pgcontents.TabIndex = 25;
//
// Infobox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(371, 154);
this.Controls.Add(this.pgcontents);
this.Name = "Infobox";
this.Text = "Infobox";
this.WindowIcon = global::ShiftOS.Properties.Resources.iconInfoBox_fw;
this.WindowTitle = "Info";
this.Controls.SetChildIndex(this.pgcontents, 0);
((System.ComponentModel.ISupportInitialize)(this.pboximage)).EndInit();
this.pnlyesno.ResumeLayout(false);
this.pgcontents.ResumeLayout(false);
this.pgcontents.PerformLayout();
this.ResumeLayout(false);
}
#endregion
internal System.Windows.Forms.Label lblintructtext;
internal System.Windows.Forms.PictureBox pboximage;
internal System.Windows.Forms.Label txtmessage;
internal System.Windows.Forms.Button btnok;
internal System.Windows.Forms.TextBox txtuserinput;
internal System.Windows.Forms.Panel pnlyesno;
internal System.Windows.Forms.Button btnno;
internal System.Windows.Forms.Button btnyes;
internal System.Windows.Forms.Panel pgcontents;
}
}

View file

@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Windowing;
using System.Windows.Forms;
using System.Media;
namespace ShiftOS.Programs
{
public partial class Infobox : Window
{
public Infobox()
{
InitializeComponent();
}
public string Info { get => txtmessage.Text; set => txtmessage.Text = value; }
public InfoboxMode Mode { get; set; } = InfoboxMode.Regular;
public Func<string, bool> TextSubmitted { get; set; }
public Action<bool> ChoiceMade { get; set; }
protected override void OnLoad(EventArgs e)
{
using (var sp = new SoundPlayer(Properties.Resources.infobox))
{
sp.Play();
}
base.OnLoad(e);
}
protected override void OnDesktopUpdate()
{
switch (Mode)
{
case InfoboxMode.Regular:
pnlyesno.Hide();
txtuserinput.Hide();
break;
case InfoboxMode.YesNo:
pnlyesno.Show();
txtuserinput.Hide();
break;
case InfoboxMode.TextInput:
pnlyesno.Hide();
txtuserinput.Show();
break;
}
base.OnDesktopUpdate();
}
private void btnok_Click(object sender, EventArgs e)
{
if(Mode == InfoboxMode.TextInput)
{
if(TextSubmitted == null)
{
Close();
return;
}
bool result = TextSubmitted.Invoke(txtuserinput.Text);
if(result)
{
Close();
return;
}
}
else
{
Close();
}
}
private void btnyes_Click(object sender, EventArgs e)
{
ChoiceMade?.Invoke(true);
Close();
}
private void btnno_Click(object sender, EventArgs e)
{
ChoiceMade?.Invoke(false);
Close();
}
}
public enum InfoboxMode
{
Regular,
YesNo,
TextInput
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Label68.Text" xml:space="preserve">
<value>Welcome to the windows settings panel. Here you can modify the appearance of the controls that are displayed on your open windows. Just select a sub option to the left to get started!
The preview window above will track your modifications live until you click "Apply Changes".</value>
</data>
<metadata name="predesktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>314, 45</value>
</metadata>
<metadata name="predesktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>314, 45</value>
</metadata>
<data name="Label69.Text" xml:space="preserve">
<value>Welcome to the desktop settings panel. Here you can modify the appearance of the controls that are displayed on your desktop. Just select a sub option to the left to get started!
The preview desktop above will track your modifications live until you click "Apply Changes".</value>
</data>
<data name="Label109.Text" xml:space="preserve">
<value>After spending hours customizing ShiftOS you may want to reset all settings to their default values so you can have a clean slate. Remember that once you reset your settings you can't undo your actions so only do so if you truly want to abandon all the customizations you have made to ShiftOS.
</value>
</data>
<data name="Label66.Text" xml:space="preserve">
<value>That's right! Simply by customizing your ShiftOS interface you can earn as many codepoints as you like. The amount of codepoints you earn will be calculated and displayed the moment you press "Apply Changes". The more time you spend customizing the more codepoints you will earn!
</value>
</data>
<data name="Label64.Text" xml:space="preserve">
<value>The shifter is an application that allows you to modify various features in ShiftOS. Initially the user interface of ShiftOS is very dull however you can use the Shifter and various sub programs within the Shifter such as the "Colour Picker" to improve the appearance of ShiftOS.
The basic process of modifying your ShiftOS interface is very simple. You first choose a main category on the left which will bring up a list of sub categories. Next select a sub category to display your list of customization options. Once you have modified the appropriate settings click Apply Changes to confirm your choices.
</value>
</data>
</root>

View file

@ -34,14 +34,29 @@ namespace ShiftOS.Programs
// Make ourselves maximized if the borders are hidden.
this.WindowState = ShowShiftOSBorders ? FormWindowState.Normal : FormWindowState.Maximized;
// Terminal scrollbar upgrade.
if(CurrentSystem.HasShiftoriumUpgrade("terminalscrollbar"))
{
TerminalControl.ScrollBars = ScrollBars.Vertical;
}
else
{
TerminalControl.ScrollBars = ScrollBars.None;
}
base.OnDesktopUpdate();
}
public void Write(string text)
{
TerminalControl.SelectionStart = TerminalControl.Text.Length;
TerminalControl.AppendText(text);
TerminalControl.Text += text;
TerminalControl.SelectionStart = TerminalControl.Text.Length;
if(CurrentSystem.HasShiftoriumUpgrade("autoscrollterminal"))
{
TerminalControl.ScrollToCaret();
}
}
public void WriteLine(string text)

View file

@ -0,0 +1,169 @@
namespace ShiftOS.Programs
{
partial class TextPad
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TextPad));
this.btnopen = new System.Windows.Forms.Button();
this.btnnew = new System.Windows.Forms.Button();
this.btnsave = new System.Windows.Forms.Button();
this.pnlbreak = new System.Windows.Forms.Panel();
this.pnloptions = new System.Windows.Forms.Panel();
this.pgcontents = new System.Windows.Forms.Panel();
this.txtuserinput = new System.Windows.Forms.TextBox();
this.pnloptions.SuspendLayout();
this.pgcontents.SuspendLayout();
this.SuspendLayout();
//
// btnopen
//
this.btnopen.BackColor = System.Drawing.Color.White;
this.btnopen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnopen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnopen.Image = global::ShiftOS.Properties.Resources.openicon;
this.btnopen.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnopen.Location = new System.Drawing.Point(86, 4);
this.btnopen.Name = "btnopen";
this.btnopen.Size = new System.Drawing.Size(76, 31);
this.btnopen.TabIndex = 1;
this.btnopen.Text = "Open";
this.btnopen.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnopen.UseVisualStyleBackColor = false;
this.btnopen.Click += new System.EventHandler(this.btnopen_Click);
//
// btnnew
//
this.btnnew.BackColor = System.Drawing.Color.White;
this.btnnew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnnew.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnnew.Image = ((System.Drawing.Image)(resources.GetObject("btnnew.Image")));
this.btnnew.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnnew.Location = new System.Drawing.Point(4, 4);
this.btnnew.Name = "btnnew";
this.btnnew.Size = new System.Drawing.Size(76, 31);
this.btnnew.TabIndex = 0;
this.btnnew.Text = "New";
this.btnnew.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnnew.UseVisualStyleBackColor = false;
this.btnnew.Click += new System.EventHandler(this.btnnew_Click);
//
// btnsave
//
this.btnsave.BackColor = System.Drawing.Color.White;
this.btnsave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnsave.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnsave.Image = global::ShiftOS.Properties.Resources.saveicon;
this.btnsave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnsave.Location = new System.Drawing.Point(168, 4);
this.btnsave.Name = "btnsave";
this.btnsave.Size = new System.Drawing.Size(76, 31);
this.btnsave.TabIndex = 2;
this.btnsave.Text = "Save";
this.btnsave.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnsave.UseVisualStyleBackColor = false;
this.btnsave.Click += new System.EventHandler(this.btnsave_Click);
//
// pnlbreak
//
this.pnlbreak.BackColor = System.Drawing.Color.White;
this.pnlbreak.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pnlbreak.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnlbreak.ForeColor = System.Drawing.Color.Black;
this.pnlbreak.Location = new System.Drawing.Point(0, 365);
this.pnlbreak.Name = "pnlbreak";
this.pnlbreak.Size = new System.Drawing.Size(796, 15);
this.pnlbreak.TabIndex = 2;
//
// pnloptions
//
this.pnloptions.BackColor = System.Drawing.Color.White;
this.pnloptions.Controls.Add(this.btnsave);
this.pnloptions.Controls.Add(this.btnopen);
this.pnloptions.Controls.Add(this.btnnew);
this.pnloptions.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pnloptions.Location = new System.Drawing.Point(0, 380);
this.pnloptions.Name = "pnloptions";
this.pnloptions.Size = new System.Drawing.Size(796, 38);
this.pnloptions.TabIndex = 1;
this.pnloptions.Visible = false;
//
// pgcontents
//
this.pgcontents.Controls.Add(this.txtuserinput);
this.pgcontents.Controls.Add(this.pnlbreak);
this.pgcontents.Controls.Add(this.pnloptions);
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgcontents.Location = new System.Drawing.Point(2, 30);
this.pgcontents.Name = "pgcontents";
this.pgcontents.Size = new System.Drawing.Size(796, 418);
this.pgcontents.TabIndex = 25;
//
// txtuserinput
//
this.txtuserinput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtuserinput.BackColor = System.Drawing.Color.White;
this.txtuserinput.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtuserinput.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtuserinput.ForeColor = System.Drawing.Color.Black;
this.txtuserinput.Location = new System.Drawing.Point(4, 2);
this.txtuserinput.Multiline = true;
this.txtuserinput.Name = "txtuserinput";
this.txtuserinput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtuserinput.Size = new System.Drawing.Size(794, 360);
this.txtuserinput.TabIndex = 0;
//
// TextPad
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.pgcontents);
this.Name = "TextPad";
this.Text = "TextPad";
this.WindowIcon = global::ShiftOS.Properties.Resources.iconTextPad;
this.WindowTitle = "TextPad";
this.Controls.SetChildIndex(this.pgcontents, 0);
this.pnloptions.ResumeLayout(false);
this.pgcontents.ResumeLayout(false);
this.pgcontents.PerformLayout();
this.ResumeLayout(false);
}
#endregion
internal System.Windows.Forms.Button btnopen;
internal System.Windows.Forms.Button btnnew;
internal System.Windows.Forms.Button btnsave;
internal System.Windows.Forms.Panel pnlbreak;
internal System.Windows.Forms.Panel pnloptions;
internal System.Windows.Forms.Panel pgcontents;
internal System.Windows.Forms.TextBox txtuserinput;
}
}

View file

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftOS.Windowing;
using ShiftOS.Metadata;
using System.Windows.Forms;
namespace ShiftOS.Programs
{
[Program("textpad", "TextPad", "Write and edit text documents.")]
[Requires("textpad")]
[AppLauncherRequirement("altextpad")]
public partial class TextPad : Window
{
public TextPad()
{
InitializeComponent();
}
protected override void OnDesktopUpdate()
{
base.OnDesktopUpdate();
pnloptions.Visible = CurrentSystem.HasShiftoriumUpgrade("textpadnew") | CurrentSystem.HasShiftoriumUpgrade("textpadopen") || CurrentSystem.HasShiftoriumUpgrade("textpadsave");
btnnew.Visible = CurrentSystem.HasShiftoriumUpgrade("textpadnew");
btnopen.Visible = CurrentSystem.HasShiftoriumUpgrade("textpadopen");
btnsave.Visible = CurrentSystem.HasShiftoriumUpgrade("textpadsave");
pnlbreak.Visible = pnloptions.Visible;
}
private void btnnew_Click(object sender, EventArgs e)
{
txtuserinput.Text = "";
}
private void btnopen_Click(object sender, EventArgs e)
{
CurrentSystem.AskForFile(new[] { ".txt" }, false, (path) =>
{
var fs = CurrentSystem.GetFilesystem();
txtuserinput.Text = fs.ReadAllText(path);
return true;
});
}
private void btnsave_Click(object sender, EventArgs e)
{
CurrentSystem.AskForFile(new[] { ".txt" }, true, (path) =>
{
var fs = CurrentSystem.GetFilesystem();
fs.WriteAllText(path, txtuserinput.Text);
return true;
});
}
}
}

View file

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnnew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAABUSURBVEhL
7dVBDsAgCERRuP+hx7BoqkbaTIsr5yfsDI+dhi4zg7t/mqcG5O1xVhwXk1WKZFA5soK2IPOeEmROCJUQ
KiFUQqiEUB2CXF/n34k9d0ADy/9Q+T1v5iIAAAAASUVORK5CYII=
</value>
</data>
</root>

View file

@ -785,6 +785,45 @@ namespace ShiftOS.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to {
/// &quot;gray&quot;: {
/// 1: [
/// &quot;Black&quot;,
/// &quot;Gray&quot;,
/// &quot;White&quot;
/// ],
/// 2: [
/// &quot;Black&quot;,
/// &quot;DimGray&quot;,
/// &quot;Gray&quot;,
/// &quot;LightGray&quot;,
/// &quot;White&quot;
/// ]
/// }
///}.
/// </summary>
internal static string ColorPickerDefaults {
get {
return ResourceManager.GetString("ColorPickerDefaults", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {
/// 0: 0,
/// 1: 3,
/// 2: 5,
/// 3: 9,
/// 4: 16
///}.
/// </summary>
internal static string ColorPickerLevels {
get {
return ResourceManager.GetString("ColorPickerLevels", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -2399,11 +2438,10 @@ namespace ShiftOS.Properties {
/// <summary>
/// Looks up a localized string similar to [
/// {
/// &quot;ID&quot;: &quot;gray&quot;,
/// &quot;Name&quot;: &quot;Gray&quot;,
/// &quot;Cost&quot;: 20,
/// &quot;Tutorial&quot;: &quot;Originally the screen could only display black and white but now with the ability to display gray it&apos;s easier and more efficient to display more information and controls on the screen.\r\n\r\nYou can now set the colour of screen controls including the background to gray using Shifter and even draw in gray within Artpad.&quot;,
/// &quot;Description&quot;: &quot;Everything doesn&apos;t always have to be black and white. Give your programs and GUI some [rest of string was truncated]&quot;;.
/// &quot;ID&quot;: &quot;autoscrollterminal&quot;,
/// &quot;Name&quot;: &quot;Auto Scroll Terminal&quot;,
/// &quot;Description&quot;: &quot;Getting sick of the terminal filling up with text leaving you not knowing what you have typed unless you start typing more?\r\n\r\nThen buy this upgrade to keep the terminal scrolled to the bottom so you can always see the latest stuff you&apos;ve typed.&quot;,
/// &quot;Tutorial&quot;: &quot;Buggy terminal Fixed! Although your terminal may not get filled up that much when it&apos;s full screen it certainly will if you find a way to make t [rest of string was truncated]&quot;;.
/// </summary>
internal static string UpgradeDatabase {
get {

View file

@ -1120,4 +1120,10 @@
<data name="_3beepvirus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3beepvirus.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ColorPickerDefaults" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ColorPickerDefaults.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="ColorPickerLevels" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ColorPickerLevels.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View file

@ -0,0 +1,419 @@
{
"gray": {
1: [
"Black",
"Gray",
"White"
],
2: [
"Black",
"DimGray",
"Gray",
"LightGray",
"White"
],
3: [
"Black",
"DimGray",
"Gray",
"DarkGray",
"Silver",
"LightGray",
"Gainsboro",
"WhiteSmoke",
"White"
],
4: [
"Black",
"DimGray",
"Gray",
"DarkGray",
"Silver",
"LightGray",
"Gainsboro",
"WhiteSmoke",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
]
},
"purple": {
1: [
"Purple"
],
2: [
"Indigo",
"Purple",
"MediumPurple"
],
3: [
"Indigo",
"DarkSlateBlue",
"Purple",
"DarkOrchid",
"DarkViolet",
"BlueViolet",
"SlateBlue",
"MediumSlateBlue",
"MediumPurple",
"MediumOrchid",
"Magenta",
"Orchid",
"Violet",
"Plum",
"Thistle",
"Lavender"
],
4: [
"Indigo",
"DarkSlateBlue",
"Purple",
"DarkOrchid",
"DarkViolet",
"BlueViolet",
"SlateBlue",
"MediumSlateBlue",
"MediumPurple",
"MediumOrchid",
"Magenta",
"Orchid",
"Violet",
"Plum",
"Thistle",
"Lavender"
]
},
"blue": {
1: [
"Blue"
],
2: [
"Navy",
"Blue",
"LightBlue"
],
3: [
"MidnightBlue",
"Navy",
"Blue",
"RoyalBlue",
"CornflowerBlue",
"DeepSkyBlue",
"SkyBlue",
"LightBlue",
"LightSteelBlue",
"Cyan",
"Aquamarine",
"DarkTurquoise",
"MediumAquamarine",
"CadetBlue",
"Teal",
"White"
],
4: [
"MidnightBlue",
"Navy",
"Blue",
"RoyalBlue",
"CornflowerBlue",
"DeepSkyBlue",
"SkyBlue",
"LightBlue",
"LightSteelBlue",
"Cyan",
"Aquamarine",
"DarkTurquoise",
"MediumAquamarine",
"CadetBlue",
"Teal",
"White"
]
},
"green": {
1: [
"Green"
],
2: [
"DarkGreen",
"Green",
"LightGreen"
],
3: [
"DarkGreen",
"Green",
"SeaGreen",
"MediumSeaGreen",
"DarkSeaGreen",
"LightGreen",
"MediumSpringGreen",
"SpringGreen",
"GreenYellow",
"LawnGreen",
"Lime",
"LimeGreen",
"YellowGreen",
"OliveDrab",
"Olive",
"DarkOliveGreen"
],
4: [
"DarkGreen",
"Green",
"SeaGreen",
"MediumSeaGreen",
"DarkSeaGreen",
"LightGreen",
"MediumSpringGreen",
"SpringGreen",
"GreenYellow",
"LawnGreen",
"Lime",
"LimeGreen",
"YellowGreen",
"OliveDrab",
"Olive",
"DarkOliveGreen"
]
},
"yellow": {
1: [
"Yellow"
],
2: [
"DarkKhaki",
"Yellow",
"PaleGoldenrod"
],
3: [
"DarkKhaki",
"Yellow",
"Khaki",
"PaleGoldenrod",
"PeachPuff",
"Moccasin",
"PapayaWhip",
"LightGoldenrodYellow",
"LemonChiffon",
"LightYellow"
],
4: [
"DarkKhaki",
"Yellow",
"Khaki",
"PaleGoldenrod",
"PeachPuff",
"Moccasin",
"PapayaWhip",
"LightGoldenrodYellow",
"LemonChiffon",
"LightYellow",
"White",
"White",
"White",
"White",
"White",
"White"
]
},
"orange": {
1: [
"DarkOrange"
],
2: [
"OrangeRed",
"DarkOrange",
"Orange"
],
3: [
"OrangeRed",
"Tomato",
"Coral",
"DarkOrange",
"Orange",
"Gold"
],
4: [
"OrangeRed",
"Tomato",
"Coral",
"DarkOrange",
"Orange",
"Gold",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
]
},
"brown": {
1: [
"Sienna"
],
2: [
"SaddleBrown",
"Sienna",
"BurlyWood"
],
3: [
"Maroon",
"Brown",
"Sienna",
"SaddleBrown",
"Chocolate",
"Peru",
"DarkGoldenrod",
"Goldenrod",
"SandyBrown",
"RosyBrown",
"Tan",
"BurlyWood",
"Wheat",
"NavajoWhite",
"Bisque",
"BlanchedAlmond"
],
4: [
"Maroon",
"Brown",
"Sienna",
"SaddleBrown",
"Chocolate",
"Peru",
"DarkGoldenrod",
"Goldenrod",
"SandyBrown",
"RosyBrown",
"Tan",
"BurlyWood",
"Wheat",
"NavajoWhite",
"Bisque",
"BlanchedAlmond"
]
},
"red": {
1: [
"Red"
],
2: [
"DarkRed",
"Red",
"Salmon"
],
3: [
"DarkRed",
"Red",
"Firebrick",
"Crimson",
"IndianRed",
"LightCoral",
"DarkSalmon",
"Salmon",
"LightSalmon"
],
4: [
"DarkRed",
"Red",
"Firebrick",
"Crimson",
"IndianRed",
"LightCoral",
"DarkSalmon",
"Salmon",
"LightSalmon",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
]
},
"pink": {
1: [
"HotPink"
],
2: [
"DeepPink",
"HotPink",
"LightPink"
],
3: [
"MediumVioletRed",
"PaleVioletRed",
"DeepPink",
"HotPink",
"LightPink",
"Pink"
],
4: [
"MediumVioletRed",
"PaleVioletRed",
"DeepPink",
"HotPink",
"LightPink",
"Pink",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
]
},
"any": {
1: [
"White"
],
2: [
"White",
"White",
"White",
"White"
],
3: [
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
],
4: [
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White",
"White"
]
}
}

View file

@ -0,0 +1,17 @@
{
"gray": {
0: 0,
1: 3,
2: 5,
3: 8,
4: 16
},
"purple": {
0: 0,
1: 1,
2: 3,
3: 16,
4: 16
},
}

View file

@ -4,7 +4,9 @@
"Name": "Auto Scroll Terminal",
"Description": "Getting sick of the terminal filling up with text leaving you not knowing what you have typed unless you start typing more?\r\n\r\nThen buy this upgrade to keep the terminal scrolled to the bottom so you can always see the latest stuff you've typed.",
"Tutorial": "Buggy terminal Fixed! Although your terminal may not get filled up that much when it's full screen it certainly will if you find a way to make the terminal smaller.\r\n\r\nEvery time you press enter the terminal will now automatically scroll you to bottom so you can always see the latest terminal output.",
"Cost": 5
"Cost": 5,
"PreInstallTip": "The Terminal can only show one screen of text and won't show anything typed off-screen.",
"UsageTip": "The Terminal now scrolls to the cursor when new text is added."
},
{
"ID": "osname",
@ -14,353 +16,27 @@
"Cost": 15,
"Requires": [
"customusername"
]
],
"PreInstallTip": "You cannot change your computer's OS name.",
"UsageTip": "You can change your computer's OS name with \"set osname <name>\"."
},
{
"ID": "customusername",
"Name": "Custom Username",
"Description": "Sick of being known as \"User\"? Want to be recognized and labeled? Then you need to replace the default username with your own!\r\n\r\nIf you want ShiftOS to refer to you by name then you are going to need this upgrade.",
"Tutorial": "Well, isn't this special? The terminal will now display any name you want it to. Even the ShiftOS desktop and some other applications will refer to you by the username you set.\r\n\r\nTo set your username simply type \"set username\" in the terminal followed by the name you want (spaces not allowed).",
"Cost": 15
"Cost": 15,
"PreInstallTip": "You cannot change your computer's username.",
"UsageTip": "You can change your computer's username with \"set username <name>\"."
},
{
"ID": "gray",
"Name": "Gray",
"Description": "Everything doesn't always have to be black and white. Give your programs and GUI some depth by mixing black and white together to form grey.\r\n\r\nNote: You are unable to make controls grey until you buy the Shifter.",
"Tutorial": "Originally the screen could only display black and white but now with the ability to display gray it's easier and more efficient to display more information and controls on the screen.\r\n\r\nYou can now set the colour of screen controls including the background to gray using Shifter and even draw in gray within Artpad.",
"Cost": 20
},
{
"ID": "artpad",
"Name": "Artpad",
"Description": "Ever wanted to play around with pixels on your screen?\r\n\r\nWell it looks like your newest companion may become the Artpad but be sure you know your x and y coordinates!",
"Tutorial": "Ah, I knew you were an artist at heart. Get your pixel setter ready and your magnifying glass, youll need it to see your 2 pixel masterpiece.\r\n\r\nMore tools, more pixels and more colours would be helpful though so be on the lookout for more upgrades.",
"Cost": 75,
"Requires": [
"gray"
]
},
{
"ID": "artpad4colorpallettes",
"Name": "Artpad 4 Color pallettes",
"Description": "Having just 2 colours in your work may give it an interesting style but overall its very limiting.\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Two new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 10,
"Requires": [
"artpad"
]
},
{
"ID": "artpad8colorpallettes",
"Name": "Artpad 8 Color pallettes",
"Description": "4 colour pallettes is still very limiting and a lot less than your average paint program.\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Four new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 20,
"Requires": [
"artpad4colorpallettes"
]
},
{
"ID": "artpad16colorpallettes",
"Name": "Artpad 16 Color pallettes",
"Description": "8 colours is still going to leave you changing the colour of your pallettes quite often.\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Eight new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 35,
"Requires": [
"artpad8colorpallettes"
]
},
{
"ID": "artpad32colorpallettes",
"Name": "Artpad 32 Color pallettes",
"Description": "16 colours is definitely usable but it certainly could get better than that right?\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Sixteen new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 50,
"Requires": [
"artpad16colorpallettes"
]
},
{
"ID": "artpad64colorpallettes",
"Name": "Artpad 64 Color pallettes",
"Description": "32 colours is slightly more than average for a paint program but dont you want extreme?\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Thirty Two new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 100,
"Requires": [
"artpad32colorpallettes"
]
},
{
"ID": "artpad128colorpallettes",
"Name": "Artpad 128 Color pallettes",
"Description": "For some people 64 colour pallettes may already be overkill but for the extremists like yourself its just not enough.\r\n\r\nThis upgrade will double the amount of usable colour pallettes in the Artpad to allow you quick access to a wider range of colours.",
"Tutorial": "Sixty Four new black colour pallettes are available for you to use in the artpad.\r\n\r\nIf you would like to change the colour of any of the colour pallettes you can do so by right clicking them and then selecting a colour you would like to be from the colour picker.",
"Cost": 150,
"Requires": [
"artpad64colorpallettes"
]
},
{
"ID": "artpadcustompallettes",
"Name": "Artpad Custom pallettes",
"Description": "It can be annoying when things are set in stone and cant be changed.\r\n\r\nLets not let that happen to the Artpad by programming the colour pallettes to be resizable by the user.",
"Tutorial": "Nice! The colour pallettes are now able to be resized any time you like and you can even adjust the spaces between pallettes.\r\n\r\nTo resize the colour pallettes simply middle click any of them and a special settings window will pop up.",
"Cost": 75,
"Requires": [
"artpad128colorpallettes"
]
},
{
"ID": "artpadnew",
"Name": "Artpad New",
"Description": "Ever wanted to start a fresh with a new canvas without restarting Artpad\r\n\r\nWith a little research it may be possible to add a button to do just that whenever you want.",
"Tutorial": "Much better. A new button that looks like a folded page should now be in your tool set.\r\n\r\nBy clicking the button you should be able create a new canvas and even type in a new size for it as many times as you like without opening and closing Artpad.",
"Cost": 10,
"Requires": [
"artpad"
]
},
{
"ID": "artpadpixellimit4",
"Name": "Artpad Pixel Limit 4",
"Description": "With just two pixels you cant make very interesting artworks.\r\n\r\nDoubling the pixel limit to 4 should more than double the variety of unique creations you can make with the artpad.",
"Tutorial": "This increased pixel limit has unlocked the ability to make canvases in artpad totaling 4 whole pixels.\r\n\r\nYou can make a variety of interesting artworks such as um, a 4 pixel high tower or a 4 pixel tower lying on its side and err, other stuff.",
"Cost": 10,
"Requires": [
"artpad"
]
},
{
"ID": "artpadpixellimit8",
"Name": "Artpad Pixel Limit 8",
"Description": "Earlier I lied about 4 pixels giving you many different types of unique artistic opportunities.\r\n\r\nA pixel limit of 8 may be a little limiting though and its still dirt cheap.",
"Tutorial": "Great you can now have canvases with a total of 8 pixels.\r\n\r\nIt may not seem like much but… oh I give up, its still hopeless. On the bright side you can always buy another upgrade.",
"Cost": 20,
"Requires": [
"artpadpixellimit4"
]
},
{
"ID": "artpadpixellimit16",
"Name": "Artpad Pixel Limit 16",
"Description": "8 pixels may not be great but 16 is looking a little more pristine.\r\n\r\nIt may be a silly rhyme but its true.",
"Tutorial": "Youve just doubled your pixel limit from 8 to 16.\r\n\r\nYou can now make a very cramped smiley face without a nose or a quarter of a chess board if you put your mind to it.",
"Cost": 30,
"Requires": [
"artpadpixellimit8"
]
},
{
"ID": "artpadpixellimit64",
"Name": "Artpad Pixel Limit 64",
"Description": "Step right up to a pixel limit 4x greater than your current one.\r\n\r\nIsnt it usually double you say? Well this time around its quadruple but unfortunately it does come with a dearer price.",
"Tutorial": "Finally you are starting to make it into deeper waters.\r\n\r\nIm not quite sure what I meant by that but if youre drawing ocean scenes you could make them deeper and if youre up to it you could draw a full chessboard without and pieces on it.",
"Cost": 50,
"Requires": [
"artpadpixellimit16"
]
},
{
"ID": "artpadpixellimit256",
"Name": "Artpad Pixel Limit 256",
"Description": "Finally we are on the verge on a decent pixel limit. Think of what you could do with 256 pixels\r\n\r\nThe width and height of your canvas could be huge!",
"Tutorial": "Actually I just realized that with 256 pixels the biggest canvas size you can make is 16 by 16 pixels.\r\n\r\nStill thats enough pixels to make a picture of a grave yard with gravestones and sad faces right?",
"Cost": 75,
"Requires": [
"artpadpixellimit64"
]
},
{
"ID": "artpadpixellimit1024",
"Name": "Artpad Pixel Limit 1024",
"Description": "Ahh, now were talking. This is an upgrade that will do you a world of good.\r\n\r\nIts a shame its is so expensive but good things always come at a cost.",
"Tutorial": "Designing things like UI elements should be a breeze with this limit.\r\n\r\nMany icon designers used to make their icons at a resolution of 32 by 32 pixels so if you want to make those kind of icons then youre all set.",
"Cost": 100,
"Requires": [
"artpadpixellimit256"
]
},
{
"ID": "artpadpixellimit4096",
"Name": "Artpad Pixel Limit 4096",
"Description": " With a pixel limit of 4096 you would have the ability to make canvases 64 by 64 pixels.\r\n\r\nDo you really think you will need this high of a pixel limit?",
"Tutorial": "Finally we are nearing the point where you are able to draw freely at a zoom level of 1x.\r\n\r\nOverall though 4096 pixels is still not good for large free hand sketch-like drawings.",
"Cost": 150,
"Requires": [
"artpadpixellimit1024"
]
},
{
"ID": "artpadpixellimit16384",
"Name": "Artpad Pixel Limit 16384",
"Description": "You may think your current pixel limit is good but you arent seen nothing yet.\r\n\r\nFor some true 4x zoomed freehand drawing dont miss this upgrade.",
"Tutorial": "Awesome! Now you can try and do some free hand drawing at 4x magnification with a canvas size of 160 by 100\r\n\r\nYou may even be able to design tiny website banners.",
"Cost": 200,
"Requires": [
"artpadpixellimit4096"
]
},
{
"ID": "artpadpixellimit65536",
"Name": "Artpad Pixel Limit 65536",
"Description": "Oh come on how much higher can the pixel limit go?\r\n\r\nI doubt you actually need it but arent you curious how much higher this goes?",
"Tutorial": "Go ahead and celebrate your seemingly limitless pixel limit for a moment and dont look at the upgrade list.\r\n\r\nYou couldnt resist looking and making this upgrade seem so small could you? Thats right, youre an upgrade away from truly limitless pixels.",
"Cost": 250,
"Requires": [
"artpadpixellimit16384"
]
},
{
"ID": "artpadlimitlesspixels",
"Name": "Artpad Limitless Pixels",
"Description": "This is what youve been waiting for all this time after purchasing all those pixel limit upgrades\r\n\r\nIt may be ultra-expensive but you wont have to ever get another after this one.",
"Tutorial": "Congratulations you now have absolutely no pixel limit and can create canvases as big as you want as long as your own computer can handle it.\r\n\r\nGo ahead and make yourself a native resolution desktop background to celebrate!",
"Cost": 350,
"Requires": [
"artpadpixellimit65536"
]
},
{
"ID": "artpadpixelplacer",
"Name": "Artpad Pixel Placer",
"Description": "The pixel setter allows you to set pixels but do you really want to go around trying to pinpoint and calculate x and y coordinates\r\n\r\nClicking the pixel you want to change directly would be much more efficient dont you agree?",
"Tutorial": "Now with the new Pixel Placer you have the power to simply click any pixel to change its colour.\r\n\r\nSimply left click a colour pallette then click any pixel on your canvas to set it to that colour. You can also right click your colour pallettes to change their colour.",
"Cost": 20,
"Requires": [
"artpad"
]
},
{
"ID": "artpadppmovementmode",
"Name": "Artpad PP Movement Mode",
"Description": "Constantly clicking each individual pixel on your canvas using the Pixel Placer can be very time consuming and tiring for your hands\r\n\r\nWouldnt it be easier to just click and drag? Well theres an upgrade for that!",
"Tutorial": "The Pixel Placer now has a movement mode option. Simply Click the Pixel Placer tool and you will see the Movement Mode Switch in the options panel.\r\n\r\nWhen movement mode is on you can click and drag slowly to draw pixels with the mouse. Be slow otherwise it may skip pixels though.",
"Cost": 20,
"Requires": [
"artpadpixelplacer"
]
},
{
"ID": "artpadpencil",
"Name": "Artpad Pencil",
"Description": "Does the buggy Pixel placer movement mode annoy you when it skips pixels?\r\n\r\nWell with a little more research we may be able to develop a new tool that can draw much more smoothly.",
"Tutorial": "Fantastic! You now have a new pencil tool which you can access from the toolbox.\r\n\r\nYou can now draw as fast as you want freehand and it wont skip a single pixel. You can also draw with three different levels of thickness which can be set in the pencils option panel.",
"Cost": 30,
"Requires": [
"artpadppmovementmode"
]
},
{
"ID": "artpaderaser",
"Name": "Artpad Eraser",
"Description": "Made a little mistake and want to erase it? Sounds like you need an eraser\r\n\r\nWith a little bit of research an eraser tool may not be too far away as overall its just a paintbrush set to the colour of the canvas.",
"Tutorial": "Your toolbox now has a new addition to it, An Eraser!\r\n\r\nThe eraser tool can be circular or square and any size you want. Clicking and dragging on the canvas will remove any colour on it and replace it with the default canvas colour which in most cases will be white.",
"Cost": 20,
"Requires": [
"artpadpencil"
]
},
{
"ID": "artpadfilltool",
"Name": "Artpad Fill Tool",
"Description": "Instead of coloring in every single individual pixel sometimes it is more appropriate to simply draw an outline and instantly fill a space in.\r\n\r\nIf thats a feature youre interested in then you should definitely buy this upgrade.",
"Tutorial": "Fantastic! You now have a new fill tool which you can access from the toolbox.\r\n\r\nTo use the fill tool you simply have to click it, choose a colour then click a pixel on the canvas and it and every surrounding pixel matching its colour will become the new colour you set.",
"Cost": 60,
"Requires": [
"artpadppmovementmode"
]
},
{
"ID": "artpadlinetool",
"Name": "Artpad Line Tool",
"Description": "Having difficulty drawing strait lines? Then you obviously need a line tool.\r\n\r\nWith a line tool you will be able to draw straight lines from any point to any point on your canvas.",
"Tutorial": "Great! You got a line tool. You can begin using it by selecting the tool from your toolbox.\r\n\r\nSimply click and drag on your canvas to draw a horizontal, vertical or diagonal line on your canvas.",
"Cost": 30,
"Requires": [
"artpadppmovementmode"
]
},
{
"ID": "artpadovaltool",
"Name": "Artpad Oval Tool",
"Description": "Drawing perfect circles is a very tricky process especially if zoomed right in on the canvas\r\n\r\nWith a bit of research we may be able to discover a tool that calculates how to draw circles without much effort on our side.",
"Tutorial": "The new oval tool now allows you to draw circles and ovals with the mouse just by clicking and dragging on the canvas.\r\n\r\nYou can also change the inside and outside colour of the ovals and change their border width in the options panel.",
"Cost": 40,
"Requires": [
"artpadlinetool"
]
},
{
"ID": "artpadpaintbrush",
"Name": "Artpad Paint Brush",
"Description": "Ever wanted to paint with a tool that can paint free handedly and be big, small, circular or square?\r\n\r\nThis paint brush tool may be the tool you want then and its pretty cheap too.",
"Tutorial": "You now have access to the paintbrush tool which you can use simply by clicking on its icon in the tool box.\r\n\r\nA good thing about the paint brush is that you can set its size to a specific value in pixels making it perfect for a variety of different situations.",
"Cost": 30,
"Requires": [
"artpadpencil"
]
},
{
"ID": "artpadrectangletool",
"Name": "Artpad Rectangle Tool",
"Description": "Drawing perfect squares is a time consuming process especially if you are trying to draw them perfectly straight\r\n\r\nWith a bit of research we may be able to discover a tool that calculates how to draw squares without much effort on our side.",
"Tutorial": "The new rectangle tool now allows you to draw squares and rectangles with the mouse just by clicking and dragging on the canvas.\r\n\r\nYou can also change the inside and outside colour of the rectangles and change their border width in the options panel.",
"Cost": 40,
"Requires": [
"artpadlinetool"
]
},
{
"ID": "artpadsave",
"Name": "Artpad Save",
"Description": "Artpad may be fun to play around with but wouldnt saving be an amazing feature?\r\n\r\nSaving your pictures may even generate codepoints and the saved pictures might be able to be used for something.",
"Tutorial": "Now with your new saving ability you can save all those amazing artpad creations to be viewed at any point in the future\r\n\r\nEvery time you save a picture the amount of codepoints you earned for making it will appear briefly as title text or in an info box.",
"Cost": 50,
"Requires": [
"artpadnew",
"fileskimmer"
]
},
{
"ID": "artpadload",
"Name": "Artpad Load",
"Description": "Sometimes after making something and saving it you wish to alter it slightly to enhance it\r\n\r\nA load feature in the Artpad should let you modify saved .pic files by allowing you to load them up again with the click of a button.",
"Tutorial": "You should now be able to load old .pic files by clicking the load button in your tool box and choosing the file you want with the file opener\r\n\r\nThe image will then pop up in artpad and you can get right to editing.",
"Cost": 50,
"Requires": [
"artpadnew",
"fileskimmer"
]
},
{
"ID": "artpadtexttool",
"Name": "Artpad Text Tool",
"Description": "drawing text is very difficult but if you can pull it off then well done, nice accomplishment!\r\n\r\nFor those who cant though research into a text drawing tool would be very handy unless you dont require text in your artwork.",
"Tutorial": "A text tool is now sitting in your toolbox waiting patiently for you to use it.\r\n\r\nSimply choose a font, colour and size then type something in and click and drag the mouse to move the text around on the canvas until you are happy with its position. Once youre done release the mouse and the text will be placed in the spot you chose.",
"Cost": 45,
"Requires": [
"artpadppmovementmode"
]
},
{
"ID": "artpadundo",
"Name": "Artpad Undo",
"Description": "Ever spilt your paint over your masterpiece? Its an awful feeling right?\r\n\r\nWell in situations like these an undo feature would be very useful so for backup I would definitely get this upgrade.",
"Tutorial": "From now on a line draw too long or the wrong splash of colour cant hurt you anymore.\r\n\r\nAn undo button has been added to your toolbox and any time you make a mistake on your canvas you can fix it with a single click of that button.",
"Cost": 40,
"Requires": [
"artpad"
]
},
{
"ID": "artpadredo",
"Name": "Artpad Redo",
"Description": "Ever clicked undo too many times and found that you have lost a large portion of work\r\n\r\nFor cases like these a redo button can be quite handy but obviously you could save your codepoints by just being careful with the undo button.",
"Tutorial": "Now that you can redo any undone actions you are totally free to cycle forwards and backwards through your work.\r\n\r\nIf you really wanted you could undo all your work then keep clicking redo to watch the creation of your entire picture.",
"Cost": 40,
"Requires": [
"artpadundo"
]
"PreInstallTip": "ShiftOS can only display black and white.",
"UsageTip": "ShiftOS can display black, white and gray."
},
{
"ID": "desktoppanel",
@ -382,17 +58,6 @@
"desktoppanel"
]
},
{
"ID": "alartpad",
"Name": "AL Artpad",
"Description": "What's the point of an App Launcher if it can't launch all your apps? \r\n\r\nUse this tweak to add a shortcut to artpad in your app launcher so you can launch it at any time with just a few clicks.",
"Tutorial": "Your App Launcher is now more complete and will allow you to launch artpad at any time you like.\r\n\r\nBe sure to buy tweaks to add all your installed programs to the app launcher so you never have to use the terminal to open up a program ever again!",
"Cost": 5,
"Requires": [
"applaunchermenu",
"artpad"
]
},
{
"ID": "alknowledgeinput",
"Name": "AL Knowledge Input",
@ -816,7 +481,7 @@
"Tutorial": "Brilliant! A skinning system is now in place. You now have a new graphic picker and skin loader at your disposal.\r\n\r\nRight click colour boxes in the Shifter to bring up the graphic picker instead of the colour picker.",
"Cost": 80,
"Requires": [
"artpad",
"customgrayshades",
"fileskimmer",
"shifter"
]
@ -1053,8 +718,11 @@
"Tutorial": "Well, Isn't this heaven! The terminal will now display a scroll bar when windowed! It may not seem like much but it will certainly help if you need to backtrack on previous output in the terminal.\r\n\r\nPlease note that the scrollbar will only appear when the terminal is windowed and can't display all text at once.",
"Cost": 20,
"Requires": [
"windowedterminal"
]
"windowedterminal",
"autoscrollterminal"
],
"PreInstallTip": "The Terminal cannot be scrolled.",
"UsageTip": "The Terminal has a scroll bar on its right side that lets you scroll up and down."
},
{
"ID": "windowsanywhere",

View file

@ -90,12 +90,36 @@
<Compile Include="Programs\Clock.Designer.cs">
<DependentUpon>Clock.cs</DependentUpon>
</Compile>
<Compile Include="Programs\ColorPicker.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\ColorPicker.Designer.cs">
<DependentUpon>ColorPicker.cs</DependentUpon>
</Compile>
<Compile Include="Programs\FileSkimmer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\FileSkimmer.Designer.cs">
<DependentUpon>FileSkimmer.cs</DependentUpon>
</Compile>
<Compile Include="Programs\GraphicPicker.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\GraphicPicker.Designer.cs">
<DependentUpon>GraphicPicker.cs</DependentUpon>
</Compile>
<Compile Include="Programs\Infobox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\Infobox.Designer.cs">
<DependentUpon>Infobox.cs</DependentUpon>
</Compile>
<Compile Include="Programs\Shifter.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\Shifter.Designer.cs">
<DependentUpon>Shifter.cs</DependentUpon>
</Compile>
<Compile Include="Programs\Shiftorium.cs">
<SubType>Form</SubType>
</Compile>
@ -108,6 +132,12 @@
<Compile Include="Programs\Terminal.Designer.cs">
<DependentUpon>Terminal.cs</DependentUpon>
</Compile>
<Compile Include="Programs\TextPad.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Programs\TextPad.Designer.cs">
<DependentUpon>TextPad.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@ -135,15 +165,30 @@
<EmbeddedResource Include="Programs\Clock.resx">
<DependentUpon>Clock.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\ColorPicker.resx">
<DependentUpon>ColorPicker.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\FileSkimmer.resx">
<DependentUpon>FileSkimmer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\GraphicPicker.resx">
<DependentUpon>GraphicPicker.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\Infobox.resx">
<DependentUpon>Infobox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\Shifter.resx">
<DependentUpon>Shifter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\Shiftorium.resx">
<DependentUpon>Shiftorium.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\Terminal.resx">
<DependentUpon>Terminal.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Programs\TextPad.resx">
<DependentUpon>TextPad.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
@ -172,7 +217,8 @@
<None Include="Resources\UpgradeDatabase.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Main.usage.txt" />
<None Include="Resources\ColorPickerDefaults.txt" />
<None Include="Resources\ColorPickerLevels.txt" />
<None Include="Resources\zoombuttonpressed.png" />
<None Include="Resources\zoombutton.png" />
<None Include="Resources\writesound.wav" />

View file

@ -62,7 +62,6 @@ namespace ShiftOS
public string titletextfontfamily = "Microsoft Sans Serif";
public int titletextfontsize = 10;
public FontStyle titletextfontstyle = FontStyle.Bold;
public string titletextpos = "Left";
public int titletextfromtop = 3;
public int titletextfromside = 24;
public Color titletextcolour = Color.White;

View file

@ -28,6 +28,94 @@ namespace ShiftOS
return _skin;
}
public SkinContext MakeClone()
{
var ctx = new SkinContext();
ctx._skin = JsonConvert.DeserializeObject<Skin>(JsonConvert.SerializeObject(_skin));
ctx._skinimages = new Dictionary<string, Image>();
foreach (var kvs in _skinimages)
{
var image = kvs.Value;
if (image == null)
continue;
ctx._skinimages.Add(kvs.Key, new Bitmap(image));
}
return ctx;
}
public void SaveToDisk(FilesystemContext InFilesystem)
{
// Does the skin data folder exist?
if (InFilesystem.DirectoryExists("/Shiftum42/Skins/Loaded"))
{
InFilesystem.DeleteDirectory("/Shiftum42/Skins/Loaded", true);
}
// Create the skin data directory.
InFilesystem.CreateDirectory("/Shiftum42/Skins/Loaded");
// Serialize the data blob.
string dataJson = JsonConvert.SerializeObject(_skin);
// Write the data blob to the disk.
InFilesystem.WriteAllText("/Shiftum42/Skins/Loaded/data.dat", dataJson);
// For every loaded image...
foreach(var kvs in _skinimages)
{
// Get the GDI image.
var image = kvs.Value;
// If it's null, skip it.
if (image == null)
continue;
// Open a file stream for the image.
using (var stream = InFilesystem.Open("/Shiftum42/Skins/Loaded/" + kvs.Key, FileMode.OpenOrCreate))
{
// Save the image in PNG format.
image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
}
}
}
public void SetImage(string key, Image value)
{
if (_skinimages.ContainsKey(key))
{
if (value == null)
_skinimages.Remove(key);
else
{
_skinimages[key].Dispose();
_skinimages[key] = value;
}
}
else
{
if (value == null)
return;
_skinimages.Add(key, value);
}
}
public void Reset()
{
Console.WriteLine("Resetting skin context...");
while(_skinimages.Count > 0)
{
var kvs = _skinimages.First();
Console.WriteLine(" --> Unloading image {0}...", kvs.Key);
kvs.Value.Dispose();
_skinimages.Remove(kvs.Key);
}
Console.WriteLine(" --> Creating default skin data...");
_skin = new Skin();
Console.WriteLine(" --> Reset complete.");
}
public void LoadFromDisk(SystemContext InSystemContext)
{
var fs = InSystemContext.GetFilesystem();
@ -83,17 +171,14 @@ namespace ShiftOS
{
if (!path.EndsWith("data.dat"))
{
using (var stream = fs.OpenRead(path))
{
var image = Image.FromStream(stream);
var image = fs.LoadImage(path);
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(path);
Console.WriteLine(" --> Loaded: {0}", path);
Console.WriteLine(" --> Storing as: {0}", filenameWithoutExtension);
Console.WriteLine(" --> Loaded: {0}", path);
Console.WriteLine(" --> Storing as: {0}", filenameWithoutExtension);
_skinimages.Add(filenameWithoutExtension, image);
}
_skinimages.Add(filenameWithoutExtension, image);
}
}
}
@ -391,12 +476,7 @@ namespace ShiftOS
private Image GetImage(FilesystemContext fs, string path)
{
if (!fs.FileExists(path))
return null;
using (var stream = fs.OpenRead(path))
{
return Image.FromStream(stream);
}
return fs.LoadImage(path);
}
private void PhilLoadDesktopPanelAndClock(StreamReader stream)
@ -508,7 +588,7 @@ namespace ShiftOS
// Line 38 is a string representing the title text position - centered or
// left. Why Phil decided a string is a good idea instead of a boolean, we may never know.
_skin.titletextpos = stream.ReadLine();
_skin.titletextposition = stream.ReadLine();
// And right after that - line 39 and 40 - is the position for the title text as a 2d point.
_skin.titletextfromtop = Convert.ToInt32(stream.ReadLine());
@ -550,7 +630,7 @@ namespace ShiftOS
_skin.applicationlaunchername = stream.ReadLine();
Console.WriteLine(" --> Read Title Text Position");
_skin.titletextpos = stream.ReadLine();
_skin.titletextposition = stream.ReadLine();
}
public bool HasImage(string ImageKey)

View file

@ -12,6 +12,7 @@ using System.Threading.Tasks;
using System.Drawing;
using System.IO;
using System.Security.Cryptography;
using ShiftOS.Programs;
namespace ShiftOS
{
@ -380,6 +381,113 @@ namespace ShiftOS
return _installedUpgrades.Contains(InUpgrade);
}
public void AskForColor(string colorTitle, Color oldColor, Action<Color> callback)
{
var picker = new ColorPicker();
picker.ColorName = colorTitle;
picker.OldColor = oldColor;
picker.Callback = callback;
_windows.Add(picker);
picker.SetSystemContext(this);
picker.FormClosed += (o, a) =>
{
_windows.Remove(picker);
};
picker.Show();
}
public void AskForGraphic(string GraphicName, Image OldGraphic, ImageLayout OldLayout, Action<Image, ImageLayout> Callback)
{
var picker = new GraphicPicker();
picker.SetSystemContext(this);
picker.GraphicName = GraphicName;
picker.Callback = Callback;
picker.CurrentGraphic = OldGraphic;
picker.CurrentLayout = OldLayout;
_windows.Add(picker);
picker.Show();
picker.FormClosed += (o, a) =>
{
_windows.Remove(picker);
};
}
/// <summary>
/// Clones the specified skin context and applies it, saving it to the disk.
/// </summary>
/// <param name="InContext">The skin context containing data to apply.</param>
public void ApplySkin(SkinContext InContext)
{
_skinContext = InContext.MakeClone();
_skinContext.SaveToDisk(_filesystem);
}
public void AskForFile(string[] filters, bool save, Func<string, bool> callback)
{
var fileskimmer = new FileSkimmer();
fileskimmer.SetSystemContext(this);
fileskimmer.SetFilters(filters);
fileskimmer.Mode = (save) ? FileSkimmerMode.Save : FileSkimmerMode.Open;
fileskimmer.FileOpenCallback = callback;
_windows.Add(fileskimmer);
fileskimmer.FormClosed += (o, a) =>
{
_windows.Remove(fileskimmer);
};
fileskimmer.Show();
}
public void AskForText(string title, string message, Func<string, bool> callback)
{
var info = new Infobox();
_windows.Add(info);
info.WindowTitle = title;
info.Info = message;
info.SetSystemContext(this);
info.Mode = InfoboxMode.TextInput;
info.TextSubmitted = callback;
info.FormClosed += (o, a) =>
{
_windows.Remove(info);
};
info.Show();
}
public void AskYesNo(string title, string message, Action<bool> callback)
{
var info = new Infobox();
_windows.Add(info);
info.WindowTitle = title;
info.Info = message;
info.SetSystemContext(this);
info.Mode = InfoboxMode.YesNo;
info.ChoiceMade = callback;
info.FormClosed += (o, a) =>
{
_windows.Remove(info);
};
info.Show();
}
public void ShowInfo(string title, string message)
{
var info = new Infobox();
_windows.Add(info);
info.WindowTitle = title;
info.Info = message;
info.SetSystemContext(this);
info.FormClosed += (o, a) =>
{
_windows.Remove(info);
};
info.Show();
}
public bool LaunchProgram(string InExecutableName)
{
// Does the program exist in our typemap?
@ -633,5 +741,34 @@ namespace ShiftOS
}
}
}
public string GetProgramDescription(string InProgramExe)
{
var meta = _programMetadata.FirstOrDefault(x => x.ExecutableName == InProgramExe);
if (meta == null)
return "";
return meta.Description;
}
public IEnumerable<string> GetUsefulTips()
{
yield return "You can type in the name of a program in Terminal to open it.";
yield return "Commands will tell you their usage when you use them incorrectly.";
yield return "You can type 'help [command]' to see info about a specific command.";
foreach(var upgrade in _upgrades)
{
if(HasShiftoriumUpgrade(upgrade.ID))
{
if (!string.IsNullOrWhiteSpace(upgrade.UsageTip))
yield return upgrade.UsageTip;
}
else
{
if (!string.IsNullOrWhiteSpace(upgrade.PreInstallTip))
yield return upgrade.PreInstallTip;
}
}
}
}
}

View file

@ -16,17 +16,29 @@ namespace ShiftOS
{
CurrentSystem = InSystem;
}
public ToolStripSkinRenderer(SkinContext InSkinPreview) : base(new ToolStripSkinColorTable(InSkinPreview))
{
}
}
public class ToolStripSkinColorTable : ProfessionalColorTable
{
private SystemContext CurrentSystem;
private SkinContext _previewSkin = null;
public ToolStripSkinColorTable(SystemContext InSystem)
{
CurrentSystem = InSystem;
}
public ToolStripSkinColorTable(SkinContext InPreviewSkin)
{
_previewSkin = InPreviewSkin;
}
public SkinContext Skin => (_previewSkin == null) ? CurrentSystem.GetSkinContext() : _previewSkin;
public override Color ButtonSelectedHighlight => ButtonSelectedGradientMiddle;
public override Color ButtonSelectedHighlightBorder => ButtonSelectedBorder;
@ -71,7 +83,7 @@ namespace ShiftOS
public override Color GripLight => Color.White;
public override Color ImageMarginGradientBegin => CurrentSystem.GetSkinContext().GetSkinData().applauncherbackgroundcolour;
public override Color ImageMarginGradientBegin => Skin.GetSkinData().applauncherbackgroundcolour;
public override Color ImageMarginGradientMiddle => ImageMarginGradientBegin;
@ -83,21 +95,21 @@ namespace ShiftOS
public override Color ImageMarginRevealedGradientEnd => Color.Gray;
public override Color MenuStripGradientBegin => (CurrentSystem.GetSkinContext().HasImage("applauncher") ? Color.Transparent : CurrentSystem.GetSkinContext().GetSkinData().applauncherbuttoncolour);
public override Color MenuStripGradientBegin => (Skin.HasImage("applauncher") ? Color.Transparent : Skin.GetSkinData().applauncherbuttoncolour);
public override Color MenuStripGradientEnd => MenuStripGradientBegin;
public override Color MenuItemSelected => CurrentSystem.GetSkinContext().GetSkinData().applaunchermouseovercolour;
public override Color MenuItemSelected => Skin.GetSkinData().applaunchermouseovercolour;
public override Color MenuItemBorder => (CurrentSystem.GetSkinContext().HasImage("applauncher") ? Color.Transparent : MenuItemSelected);
public override Color MenuItemBorder => (Skin.HasImage("applauncher") ? Color.Transparent : MenuItemSelected);
public override Color MenuBorder => (CurrentSystem.GetSkinContext().HasImage("applauncher") ? Color.Transparent : CurrentSystem.GetSkinContext().GetSkinData().applauncherbackgroundcolour);
public override Color MenuBorder => (Skin.HasImage("applauncher") ? Color.Transparent : Skin.GetSkinData().applauncherbackgroundcolour);
public override Color MenuItemSelectedGradientBegin => MenuItemSelected;
public override Color MenuItemSelectedGradientBegin => (Skin.HasImage("applauncher") || Skin.HasImage("applaunchermouseover") ? Color.Transparent : MenuItemSelected);
public override Color MenuItemSelectedGradientEnd => MenuItemSelectedGradientBegin;
public override Color MenuItemPressedGradientBegin => (CurrentSystem.GetSkinContext().HasImage("applauncher") ? Color.Transparent : CurrentSystem.GetSkinContext().GetSkinData().applauncherbuttonclickedcolour);
public override Color MenuItemPressedGradientBegin => (Skin.HasImage("applauncher") || Skin.HasImage("applauncherclick") ? Color.Transparent : Skin.GetSkinData().applauncherbuttonclickedcolour);
public override Color MenuItemPressedGradientMiddle => MenuItemPressedGradientBegin;
@ -107,7 +119,7 @@ namespace ShiftOS
public override Color RaftingContainerGradientEnd => RaftingContainerGradientEnd;
public override Color SeparatorDark => Color.Black;
public override Color SeparatorDark => Skin.GetSkinData().launcheritemcolour;
public override Color SeparatorLight => SeparatorDark;
@ -117,7 +129,7 @@ namespace ShiftOS
public override Color ToolStripBorder => Color.Gray;
public override Color ToolStripDropDownBackground => MenuStripGradientBegin;
public override Color ToolStripDropDownBackground => Skin.GetSkinData().applauncherbackgroundcolour;
public override Color ToolStripGradientBegin => Color.Gray;

View file

@ -15,6 +15,11 @@ namespace ShiftOS
private int _codepoints;
private string[] _dependencies;
private bool _finalized = false;
private string _prebuyTip = null;
private string _installedTip = null;
public string UsageTip { get => _installedTip; set => _installedTip = value; }
public string PreInstallTip { get => _prebuyTip; set => _prebuyTip = value; }
public string ImageResource { get; set; }

View file

@ -65,7 +65,7 @@ namespace ShiftOS.Windowing
// Set the title text position.
this.TitleText.Top = skindata.titletextfromtop;
if(skindata.titletextpos == "Left")
if(skindata.titletextposition == "Left")
{
this.TitleText.Left = skindata.titletextfromside;
}