WIP: dialog box

This commit is contained in:
Ray 2020-04-27 13:17:13 +01:00
parent 7fd6c06c78
commit caec9c7317
109 changed files with 7397 additions and 62 deletions

View File

@ -67,6 +67,70 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Drawing\Rectangoid.cs" />
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.Designer.cs">
<DependentUpon>HorizontalSeparator.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\Forms\ImageBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\Button.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\Button.designer.cs">
<DependentUpon>Button.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\ButtonState.cs" />
<Compile Include="RyzStudio\Windows\ThemedForms\ButtonStyle.cs" />
<Compile Include="RyzStudio\Windows\ThemedForms\DialogForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\DialogForm.Designer.cs">
<DependentUpon>DialogForm.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\BorderlessToolForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\BorderlessToolForm.Designer.cs">
<DependentUpon>BorderlessToolForm.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\Form.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\Form.Designer.cs">
<DependentUpon>Form.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\PickerBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\PickerBox.designer.cs">
<DependentUpon>PickerBox.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\TextBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\TextBox.designer.cs">
<DependentUpon>TextBox.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\TextButtonBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\TextButtonBox.designer.cs">
<DependentUpon>TextButtonBox.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\ThemeStyle.cs" />
<Compile Include="RyzStudio\Windows\ThemedForms\UserControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\UserControl.designer.cs">
<DependentUpon>UserControl.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Forms\EditTileForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\Forms\AForm.cs">
<SubType>Form</SubType>
</Compile>
@ -107,6 +171,30 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\Button.resx">
<DependentUpon>Button.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\DialogForm.resx">
<DependentUpon>DialogForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\BorderlessToolForm.resx">
<DependentUpon>BorderlessToolForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\Form.resx">
<DependentUpon>Form.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\PickerBox.resx">
<DependentUpon>PickerBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\TextBox.resx">
<DependentUpon>TextBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RyzStudio\Windows\ThemedForms\TextButtonBox.resx">
<DependentUpon>TextButtonBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\EditTileForm.resx">
<DependentUpon>EditTileForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\Tile\TileGroupLabel.resx">
<DependentUpon>TileGroupLabel.cs</DependentUpon>
</EmbeddedResource>
@ -157,5 +245,47 @@
<ItemGroup>
<Folder Include="DTO\" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_close.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_close2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_maximise.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_maximise2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_menu.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_menu2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_minimise.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_minimise2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_restore.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\form16_restore2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\button16_file_add.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\button16_file_add2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\button16_folder_add.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\button16_folder_add2.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>

79
MainForm.Designer.cs generated
View File

@ -29,30 +29,16 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.button1 = new System.Windows.Forms.Button();
this.titlePanel1 = new AppLauncher.Windows.Forms.TitlePanel();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.button2 = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button3 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button3 = new System.Windows.Forms.Button();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(710, 243);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(78, 40);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// titlePanel1
//
this.titlePanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -63,7 +49,7 @@
this.titlePanel1.MainMenu = this.contextMenuStrip1;
this.titlePanel1.MinimumSize = new System.Drawing.Size(40, 40);
this.titlePanel1.Name = "titlePanel1";
this.titlePanel1.Size = new System.Drawing.Size(800, 40);
this.titlePanel1.Size = new System.Drawing.Size(1088, 40);
this.titlePanel1.TabIndex = 8;
this.titlePanel1.TitleText = "Launcher";
//
@ -74,25 +60,27 @@
this.toolStripSeparator1,
this.exitToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 76);
this.contextMenuStrip1.Size = new System.Drawing.Size(153, 54);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem1.Text = "Always On &Top";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(710, 289);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(78, 40);
this.button2.TabIndex = 21;
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
@ -111,58 +99,29 @@
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// pictureBox1
//
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.Location = new System.Drawing.Point(695, 96);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(100, 109);
this.pictureBox1.TabIndex = 29;
this.pictureBox1.TabStop = false;
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem1.Text = "Always On &Top";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(83)))), ((int)(((byte)(93)))));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(800, 440);
this.Controls.Add(this.pictureBox1);
this.ClientSize = new System.Drawing.Size(1088, 440);
this.Controls.Add(this.button3);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.button2);
this.Controls.Add(this.titlePanel1);
this.Controls.Add(this.button1);
this.Name = "MainForm";
this.Text = "Form1";
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
private Windows.Forms.TitlePanel titlePanel1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
}

View File

@ -25,8 +25,6 @@ namespace AppLauncher
public MainForm() : base()
{
InitializeComponent();
//headingPanel2.Checked = true;
}
private async void button1_Click(object sender, EventArgs e)
@ -205,5 +203,11 @@ namespace AppLauncher
}
private void button1_Click_1(object sender, EventArgs e)
{
EditTileForm addTileForm = new EditTileForm();
addTileForm.ShowDialog();
}
}
}

View File

@ -70,6 +70,46 @@ namespace AppLauncher.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap button16_file_add {
get {
object obj = ResourceManager.GetObject("button16_file_add", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap button16_file_add2 {
get {
object obj = ResourceManager.GetObject("button16_file_add2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap button16_folder_add {
get {
object obj = ResourceManager.GetObject("button16_folder_add", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap button16_folder_add2 {
get {
object obj = ResourceManager.GetObject("button16_folder_add2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -90,6 +130,106 @@ namespace AppLauncher.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_close {
get {
object obj = ResourceManager.GetObject("form16_close", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_close2 {
get {
object obj = ResourceManager.GetObject("form16_close2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_maximise {
get {
object obj = ResourceManager.GetObject("form16_maximise", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_maximise2 {
get {
object obj = ResourceManager.GetObject("form16_maximise2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_menu {
get {
object obj = ResourceManager.GetObject("form16_menu", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_menu2 {
get {
object obj = ResourceManager.GetObject("form16_menu2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_minimise {
get {
object obj = ResourceManager.GetObject("form16_minimise", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_minimise2 {
get {
object obj = ResourceManager.GetObject("form16_minimise2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_restore {
get {
object obj = ResourceManager.GetObject("form16_restore", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap form16_restore2 {
get {
object obj = ResourceManager.GetObject("form16_restore2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -121,12 +121,54 @@
<data name="arrow_right_ea_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-right-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="button16_file_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\button16_file_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="button16_file_add2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\button16_file_add2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="button16_folder_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\button16_folder_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="button16_folder_add2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\button16_folder_add2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="chrome_ea_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\chrome-ea-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder_ea_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\folder-ea-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_close" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_close2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_close2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_maximise" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_maximise.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_maximise2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_maximise2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_menu" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_menu.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_menu2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_menu2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_minimise" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_minimise.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_minimise2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_minimise2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_restore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_restore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="form16_restore2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\form16_restore2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="grid_ea_24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\grid-ea-24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
Resources/form16_close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

BIN
Resources/form16_close2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
Resources/form16_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

BIN
Resources/form16_menu2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

View File

@ -0,0 +1,444 @@
using System;
using System.ComponentModel;
using System.Data;
using System.IO;
namespace RyzStudio.Data.SQLite
{
public class SQLiteDatabase
{
#region static methods
public static string escapeSQL(string query)
{
return query.Replace("'", "''").Trim();
}
public static string escapeValue(string text)
{
return text.Replace("\"", "\\\"").Replace("\t", "\\t").Replace("\r", " \\r").Replace("\n", "\\n");
}
public static string PrepareQuery(string query, params string[] arguments)
{
string rv = query;
if (string.IsNullOrEmpty(rv))
{
return string.Empty;
}
for (int i = 0; i < arguments.Length; i++)
{
rv = rv.Replace("[^" + (i + 1).ToString() + "]", escapeSQL(arguments[i]));
}
return rv;
}
#endregion
protected SQLiteWrapper.SQLiteBase database = null;
protected string databaseLocation = ":memory:";
protected string lastError = "";
protected string[] requiredTableList = new string[0];
protected const string tableNameConfig = "ryz_app_xxxx_config";
#region public properties
[Browsable(false)]
public SQLiteWrapper.SQLiteBase Database
{
get { return database; }
set { database = value; }
}
[Browsable(false)]
public string DatabaseLocation
{
get { return databaseLocation; }
set { databaseLocation = value; }
}
[Browsable(false)]
public string LastError
{
get { return lastError; }
}
[Browsable(false)]
public int LastInsertID
{
get
{
if (database == null)
{
return 0;
}
DataTable dt = this.DoQuery("SELECT last_insert_rowid() AS ccc;");
if (dt == null)
{
return 0;
}
if (dt.Rows.Count <= 0)
{
return 0;
}
return int.Parse(dt.Rows[0]["ccc"].ToString());
}
}
#endregion
#region public methods
public bool Create(bool use_memory = true)
{
lastError = string.Empty;
if (string.IsNullOrEmpty(databaseLocation))
{
return false;
}
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(((use_memory) ? ":memory:" : databaseLocation));
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
bool rv = Prepare();
if (!rv)
{
return false;
}
return CheckRequiredTables();
}
public bool Create(string filename, bool override_file = false)
{
lastError = string.Empty;
databaseLocation = filename;
if (string.IsNullOrEmpty(databaseLocation))
{
return false;
}
if (File.Exists(databaseLocation) && override_file)
{
try
{
File.Delete(databaseLocation);
}
catch (Exception xc)
{
lastError = xc.Message;
return false;
}
}
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(databaseLocation);
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
bool rv = CheckRequiredTables();
if (!rv)
{
Prepare();
}
return CheckRequiredTables();
}
public bool Load(string filename)
{
if (!File.Exists(filename))
{
return false;
}
lastError = string.Empty;
databaseLocation = filename;
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(databaseLocation);
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
return CheckRequiredTables();
}
public void Close()
{
if (database != null)
{
database.CloseDatabase();
}
}
public DataTable DoQuery(string query)
{
lastError = string.Empty;
if (database == null)
{
return null;
}
try
{
return database.ExecuteQuery(query);
}
catch (Exception exc)
{
lastError = exc.Message;
return null;
}
}
public DataTable DoQuery(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQuery(sql);
}
public bool DoNonQuery(string query)
{
lastError = string.Empty;
if (database == null)
{
return false;
}
try
{
database.ExecuteNonQuery(query);
return true;
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
}
public bool DoNonQuery(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoNonQuery(sql);
}
public string DoQuerySingle(string query)
{
lastError = string.Empty;
if (database == null)
{
return string.Empty;
}
DataTable tbl = DoQuery(query);
if (tbl == null)
{
return string.Empty;
}
if (tbl.Columns.Count <= 0)
{
return string.Empty;
}
if (tbl.Rows.Count <= 0)
{
return string.Empty;
}
return tbl.Rows[0][0].ToString();
}
public string DoQuerySingle(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQuerySingle(sql);
}
public int DoQueryCount(string query)
{
if (database == null)
{
return -1;
}
DataTable tbl = DoQuery(query);
if (tbl == null)
{
return -1;
}
if (tbl.Rows.Count <= 0)
{
return 0;
}
return tbl.Rows.Count;
}
public int DoQueryCount(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQueryCount(sql);
}
public bool DoQueryExist(string query)
{
int rv = DoQueryCount(query);
return (rv > 0);
}
public bool DoQueryExist(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQueryExist(sql);
}
public bool HasTable(string table_name)
{
lastError = string.Empty;
if (database == null)
{
return false;
}
int rv = this.DoQueryCount("SELECT 1 FROM sqlite_master WHERE type='table' AND name='" + escapeSQL(table_name) + "'");
return (rv > 0);
}
public bool CheckRequiredTables()
{
bool rv = true;
foreach (string tbl in requiredTableList)
{
if (string.IsNullOrEmpty(tbl))
{
continue;
}
if (!this.HasTable(tbl))
{
rv = false;
break;
}
}
return rv;
}
protected bool PrepareConfig()
{
if (HasTable(tableNameConfig))
{
return true;
}
bool rv = this.DoNonQuery(@"
BEGIN TRANSACTION;
CREATE TABLE " + tableNameConfig + @" (cfg_name TEXT, cfg_value TEXT);
COMMIT;
");
return rv;
}
public bool SetConfig(string name, string value)
{
if (!PrepareConfig())
{
return false;
}
string sql = string.Empty;
int rv = this.DoQueryCount("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
if (rv <= 0)
{
sql = "INSERT INTO " + tableNameConfig + " (cfg_name, cfg_value) VALUES ('[^1]', '[^2]');";
}
else
{
sql = "UPDATE " + tableNameConfig + " SET cfg_value='[^2]' WHERE cfg_name='[^1]';";
}
sql = PrepareQuery(sql, new string[] { name, value });
return this.DoNonQuery(sql);
}
public string GetConfig(string name, string default_value = "")
{
if (!PrepareConfig())
{
return default_value;
}
bool rv = this.DoQueryExist("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
if (!rv)
{
return default_value;
}
return this.DoQuerySingle("SELECT cfg_value FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
}
#endregion
protected virtual bool Prepare()
{
return true;
}
}
}

View File

@ -0,0 +1,137 @@
namespace RyzStudio.Drawing
{
using System.Drawing;
using System.Drawing.Drawing2D;
public struct LeftRectangoid
{
private int X;
private int Y;
private int Width;
private int Height;
private int Radius;
public LeftRectangoid(Rectangle rect, int radius)
{
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public LeftRectangoid(Rectangle rect, int radius, int borderWidth)
{
rect.Inflate((-1 * borderWidth), (-1 * borderWidth));
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public LeftRectangoid(int x, int y, int width, int height, int radius)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = radius;
}
public LeftRectangoid(int x, int y, int width, int height)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = 0;
}
public LeftRectangoid(int width, int height, int radius)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = radius;
}
public LeftRectangoid(int width, int height)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = 0;
}
public LeftRectangoid(int width)
{
X = 0;
Y = 0;
Width = width;
Height = width;
Radius = 0;
}
public GraphicsPath ToGraphicsPath()
{
GraphicsPath rv = new GraphicsPath();
rv.AddLine(X + Width, Y + Height, X + this.Radius, Y + Height);
if (this.Radius > 0)
{
rv.AddArc(X, Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 90, 90);
}
rv.AddLine(X, Y + Height - (this.Radius * 2), X, Y + this.Radius);
if (this.Radius > 0)
{
rv.AddArc(X, Y, this.Radius * 2, this.Radius * 2, 180, 90);
}
rv.AddLine(X + Width, Y, X + this.Radius, Y);
return rv;
}
public GraphicsPath ToClosedGraphicsPath()
{
GraphicsPath rv = new GraphicsPath();
rv.AddLine(X + this.Radius, Y, X + Width, Y);
rv.AddLine(X + Width + this.Radius, Y + this.Radius, X + Width + this.Radius, Y + Height);
rv.AddLine(X + Width + this.Radius, Y + Height, X + this.Radius, Y + Height);
if (this.Radius > 0)
{
rv.AddArc(X, Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 90, 90);
}
rv.AddLine(X, Y + Height - (this.Radius * 2), X, Y + this.Radius);
if (this.Radius > 0)
{
rv.AddArc(X, Y, this.Radius * 2, this.Radius * 2, 180, 90);
}
rv.AddLine(X + Width + this.Radius, Y, X + this.Radius, Y);
return rv;
}
public PointF GetOrigin()
{
PointF rv = new PointF();
rv.X = ((float)Width / 2) + X;
rv.Y = ((float)Height / 2) + Y;
return rv;
}
}
}

View File

@ -0,0 +1,124 @@
using System.Drawing;
using System.Drawing.Drawing2D;
namespace RyzStudio.Drawing
{
public struct Rectangoid
{
private int X;
private int Y;
private int Width;
private int Height;
private int Radius;
public Rectangoid(Rectangle rect, int radius)
{
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public Rectangoid(Rectangle rect, int radius, int borderWidth)
{
rect.Inflate((-1 * borderWidth), (-1 * borderWidth));
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public Rectangoid(int x, int y, int width, int height, int radius)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = radius;
}
public Rectangoid(int x, int y, int width, int height)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = 0;
}
public Rectangoid(int width, int height, int radius)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = radius;
}
public Rectangoid(int width, int height)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = 0;
}
public Rectangoid(int width)
{
X = 0;
Y = 0;
Width = width;
Height = width;
Radius = 0;
}
public GraphicsPath ToGraphicsPath()
{
GraphicsPath rv = new GraphicsPath();
rv.AddLine(X + this.Radius, Y, X + Width - (this.Radius * 2), Y);
if (this.Radius > 0)
{
rv.AddArc(X + Width - (this.Radius * 2), Y, this.Radius * 2, this.Radius * 2, 270, 90);
}
rv.AddLine(X + Width, Y + this.Radius, X + Width, Y + Height - (this.Radius * 2));
if (this.Radius > 0)
{
rv.AddArc(X + Width - (this.Radius * 2), Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 0, 90);
}
rv.AddLine(X + Width - (this.Radius * 2), Y + Height, X + this.Radius, Y + Height);
if (this.Radius > 0)
{
rv.AddArc(X, Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 90, 90);
}
rv.AddLine(X, Y + Height - (this.Radius * 2), X, Y + this.Radius);
if (this.Radius > 0)
{
rv.AddArc(X, Y, this.Radius * 2, this.Radius * 2, 180, 90);
}
rv.CloseFigure();
return rv;
}
public PointF GetOrigin()
{
PointF rv = new PointF();
rv.X = ((float)Width / 2) + X;
rv.Y = ((float)Height / 2) + Y;
return rv;
}
}
}

56
RyzStudio/IO/FileType.cs Normal file
View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RyzStudio.IO
{
public class FileType
{
protected static readonly byte[] BMP = { 66, 77 };
protected static readonly byte[] GIF = { 71, 73, 70, 56 };
protected static readonly byte[] ICO = { 0, 0, 1, 0 };
protected static readonly byte[] JPG = { 255, 216, 255 };
protected static readonly byte[] PNG = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82 };
public static bool IsImage(byte[] byteArray)
{
if (byteArray == null)
{
return false;
}
if (byteArray.Length <= 0)
{
return false;
}
if (byteArray.Take(2).SequenceEqual(BMP))
{
return true;
}
if (byteArray.Take(4).SequenceEqual(GIF))
{
return true;
}
if (byteArray.Take(4).SequenceEqual(ICO))
{
return true;
}
if (byteArray.Take(3).SequenceEqual(JPG))
{
return true;
}
if (byteArray.Take(16).SequenceEqual(PNG))
{
return true;
}
return false;
}
}
}

View File

@ -0,0 +1,290 @@
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using ICSharpCode.SharpZipLib.Zip;
namespace RyzStudio.IO
{
public abstract class SessionFileFormatBase
{
protected string CONST_KEYPASS = "";
protected string CONST_PRODUCT = "";
protected string CONST_STREAM_FILE_NAME = "";
protected bool enableErrorReporting = false;
protected string lastUsedFileName = "";
#region public properties
public string passkey
{
get { return CONST_KEYPASS; }
set { CONST_KEYPASS = value; }
}
/*public string LastFilename
{
get { return lastUsedFileName; }
set { lastUsedFileName = value; }
}*/
#endregion
#region public methods
/* public bool loadFromRyz()
{
return loadFromRyz(lastUsedFileName);
}*/
public bool loadFromRyz(string file_name)
{
lastUsedFileName = file_name;
if (!File.Exists(file_name))
{
return false;
}
bool rv = false;
try
{
ZipInputStream zipIn = new ZipInputStream(File.OpenRead(file_name));
zipIn.Password = CONST_KEYPASS;
ZipEntry theEntry = null;
while ((theEntry = zipIn.GetNextEntry()) != null)
{
string streamFileName = Path.GetFileName(theEntry.Name);
if (streamFileName.Equals(CONST_STREAM_FILE_NAME))
{
MemoryStream oxStream = new MemoryStream();
StreamWriter streamWriter = new StreamWriter(oxStream);
int size = 2048;
byte[] data = new byte[size];
while (true)
{
size = zipIn.Read(data, 0, data.Length);
if (size <= 0) break;
streamWriter.BaseStream.Write(data, 0, size);
}
oxStream.Position = 0;
StreamReader sr2 = new StreamReader(oxStream, Encoding.UTF8);
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sr2.ReadToEnd());
loadFromXmlDocument(ref xDoc);
}
}
zipIn.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
public bool loadFromXml()
{
return loadFromXml(lastUsedFileName);
}
public bool loadFromXml(string file_name)
{
lastUsedFileName = file_name;
if (!File.Exists(file_name))
{
return false;
}
bool rv = false;
try
{
StreamReader sr2 = new StreamReader(file_name, Encoding.UTF8);
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sr2.ReadToEnd());
loadFromXmlDocument(ref xDoc);
sr2.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
/* public bool saveToRyz()
{
return saveToRyz(lastUsedFileName);
}
*/
public bool saveToRyz(string file_name)
{
bool rv = false;
lastUsedFileName = file_name;
byte[] buffer = new byte[4096];
try
{
File.Delete(file_name);
FileInfo fileinfo1 = new FileInfo(file_name);
if (!Directory.Exists(fileinfo1.DirectoryName))
{
Directory.CreateDirectory(fileinfo1.DirectoryName);
}
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
try
{
ZipOutputStream zipOutStream1 = new ZipOutputStream(File.Create(file_name));
zipOutStream1.SetLevel(9);
zipOutStream1.Password = CONST_KEYPASS;
MemoryStream oxIndexStream = new MemoryStream();
XmlTextWriter oxTW = new XmlTextWriter(oxIndexStream, Encoding.UTF8);
saveToXmlTextWriter(ref oxTW);
oxTW.Flush();
// write to file
zipOutStream1.PutNextEntry(new ZipEntry(CONST_STREAM_FILE_NAME));
oxIndexStream.Position = 0;
StreamReader sr2 = new StreamReader(oxIndexStream, Encoding.UTF8);
int sourceBytes;
do
{
sourceBytes = sr2.BaseStream.Read(buffer, 0, buffer.Length);
zipOutStream1.Write(buffer, 0, sourceBytes);
}
while (sourceBytes > 0);
sr2.Close();
oxTW.Close();
zipOutStream1.Finish();
zipOutStream1.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
public bool saveToXml()
{
return saveToXml(lastUsedFileName);
}
public bool saveToXml(string file_name)
{
bool rv = false;
lastUsedFileName = file_name;
try
{
File.Delete(file_name);
FileInfo fileinfo1 = new FileInfo(file_name);
if (!Directory.Exists(fileinfo1.DirectoryName))
{
Directory.CreateDirectory(fileinfo1.DirectoryName);
}
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
try
{
XmlTextWriter oxTW = new XmlTextWriter(file_name, Encoding.UTF8);
saveToXmlTextWriter(ref oxTW);
oxTW.Flush();
oxTW.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
#endregion
protected virtual void loadFromXmlDocument(ref XmlDocument xml_doc) { }
protected virtual void saveToXmlTextWriter(ref XmlTextWriter writer) { }
#region public methods (conversions)
public int[] convIntArrayString(string s1, char c)
{
string[] sarr = s1.Split(c);
int[] iarr = new int[sarr.Length];
for (int i = 0; i < sarr.Length; i++)
{
iarr[i] = Int32.Parse(sarr[i]);
}
return iarr;
}
public string convStringIntArray(int[] r, char s)
{
string t = null;
for (int i = 0; i < r.Length; i++)
{
if (i != 0)
{
t += s.ToString();
}
t += r[i].ToString();
}
return t;
}
#endregion
}
}

View File

@ -0,0 +1,76 @@
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
namespace RyzStudio.IO
{
public class SharpZipLib
{
/// <summary>
/// Is zip file encrypted
/// </summary>
/// <param name="fn">Filename</param>
/// <returns>Is encrypted</returns>
public static bool IsZipEncrypted(string fn)
{
bool ret_val = false;
try
{
ZipInputStream zipIn = new ZipInputStream(System.IO.File.OpenRead(fn));
ZipEntry theEntry = null;
while ((theEntry = zipIn.GetNextEntry()) != null)
{
if (theEntry.IsCrypted)
{
ret_val = true;
}
break;
}
zipIn.Close();
}
catch
{
// do nothing
}
return ret_val;
}
public static void AddFile(ZipOutputStream zipstream, string filename, string prefixpath = null)
{
byte[] buffer = new byte[4096];
string f1 = "";
if (prefixpath != null)
{
f1 = Path.GetDirectoryName(filename).TrimEnd('\\') + "\\";
f1 = f1.Replace(prefixpath, "").TrimEnd('\\') + "\\";
f1 = f1 + Path.GetFileName(filename);
f1 = f1.TrimStart('\\');
}
ZipEntry entry = new ZipEntry(f1);
entry.DateTime = DateTime.Now;
zipstream.PutNextEntry(entry);
FileStream fs = File.OpenRead(filename);
int sourceBytes;
do
{
sourceBytes = fs.Read(buffer, 0, buffer.Length);
zipstream.Write(buffer, 0, sourceBytes);
}
while (sourceBytes > 0);
}
public static void AddFolder(ZipOutputStream zipstream, string folderpath, string prefixpath = null)
{
foreach (string fn in Directory.GetFiles(folderpath, "*.*", System.IO.SearchOption.AllDirectories))
{
AddFile(zipstream, fn, prefixpath);
}
}
}
}

168
RyzStudio/Net/HttpWeb.cs Normal file
View File

@ -0,0 +1,168 @@
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace RyzStudio.Net
{
public class HttpWeb
{
public string defaultUserAgent = "Momozilla/5.0 (" + Environment.OSVersion.Platform.ToString() + " ; " + Environment.OSVersion.VersionString + "; " + Application.CurrentCulture.TwoLetterISOLanguageName + ")";
public int defaultTimeout = 6000;
public int defaultMaxRedirect = 8;
public bool defaultAllowRedirect = true;
public CookieContainer defaultCookierContainer = null;
public HttpWeb()
{
}
public HttpWebRequest CreateRequest(string url)
{
return this.CreateRequest(url, url);
}
public HttpWebRequest CreateRequest(string url, string referrerURL)
{
if (defaultCookierContainer == null)
{
defaultCookierContainer = new CookieContainer();
}
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
webRequest.MaximumAutomaticRedirections = defaultMaxRedirect;
webRequest.CookieContainer = defaultCookierContainer;
webRequest.UserAgent = defaultUserAgent;
webRequest.AllowAutoRedirect = defaultAllowRedirect;
webRequest.Timeout = defaultTimeout;
return webRequest;
}
public int GetResponse(out string sourceCode, string url, string referrerURL = "")
{
HttpWebRequest webRequest = this.CreateRequest(url, referrerURL);
return GetResponse(out sourceCode, webRequest);
}
public int GetResponse(out string sourceCode, HttpWebRequest webRequest)
{
sourceCode = string.Empty;
int rv = 0;
try
{
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
rv = (int)webResponse.StatusCode;
StreamReader readContent = new StreamReader(webResponse.GetResponseStream());
sourceCode = readContent.ReadToEnd();
webResponse.Close();
webResponse = null;
}
catch (WebException xc)
{
if (xc.Response is HttpWebResponse)
{
HttpWebResponse rs = xc.Response as HttpWebResponse;
StreamReader readContent = new StreamReader(rs.GetResponseStream());
if (readContent != null)
{
sourceCode = readContent.ReadToEnd();
}
rv = (int)rs.StatusCode;
}
else
{
rv = (int)xc.Status;
sourceCode = xc.Message;
}
}
catch (Exception xc)
{
sourceCode = xc.Message;
}
return rv;
}
public static HttpWebRequest AddBasicAuthentication(HttpWebRequest webRequest, string username, string password)
{
webRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(string.Concat(username, ":", password)));
webRequest.PreAuthenticate = true;
return webRequest;
}
public int GetPOSTResponse(out string sourceCode, HttpWebRequest webRequest, string postData)
{
sourceCode = "";
int rv = 0;
byte[] buffer = Encoding.UTF8.GetBytes(postData);
webRequest.ContentLength = buffer.Length;
try
{
Stream dataStream = webRequest.GetRequestStream();
dataStream.Write(buffer, 0, buffer.Length);
dataStream.Close();
}
catch (Exception xc)
{
sourceCode = xc.Message;
return rv;
}
return this.GetResponse(out sourceCode, webRequest);
}
public int GetHeader(out WebHeaderCollection headerCollection, string url, string referrerURL = "")
{
headerCollection = null;
int rv = 0;
HttpWebRequest webRequest = this.CreateRequest(url, referrerURL);
webRequest.Method = "HEAD";
try
{
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
headerCollection = webResponse.Headers;
rv = (int)webResponse.StatusCode;
webResponse.Close();
webResponse = null;
}
catch (WebException xc)
{
if (xc.Response is HttpWebResponse)
{
HttpWebResponse rs = xc.Response as HttpWebResponse;
rv = (int)rs.StatusCode;
}
else
{
rv = (int)xc.Status;
}
}
catch
{
// do nothing
}
return rv;
}
}
}

36
RyzStudio/String.cs Normal file
View File

@ -0,0 +1,36 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace RyzStudio
{
public class String
{
public static string EncodeTo64(string value)
{
try
{
byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(value);
return System.Convert.ToBase64String(toEncodeAsBytes);
}
catch
{
return string.Empty;
}
}
public static string DecodeFrom64(string value)
{
try
{
byte[] encodedDataAsBytes = System.Convert.FromBase64String(value);
return System.Text.ASCIIEncoding.ASCII.GetString(encodedDataAsBytes);
}
catch
{
return string.Empty;
}
}
}
}

View File

@ -0,0 +1,37 @@
namespace RyzStudio.Windows.Forms
{
partial class HorizontalSeparator
{
/// <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 Component 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()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public partial class HorizontalSeparator : System.Windows.Forms.UserControl
{
public HorizontalSeparator()
{
InitializeComponent();
this.MaximumSize = new Size(SystemInformation.VirtualScreen.Width, 2);
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
Graphics g = e.Graphics;
g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 0, this.DisplayRectangle.Width, 1));
g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 1, this.DisplayRectangle.Width, 1));
}
}
}

View File

@ -0,0 +1,54 @@
using System;
using System.ComponentModel;
using System.Drawing;
namespace RyzStudio.Windows.Forms
{
public class ImageBox : System.Windows.Forms.PictureBox
{
public ImageBox() : base()
{
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.ErrorImage = null;
this.InitialImage = null;
this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
}
protected override void OnCreateControl()
{
OnMouseLeave(null);
base.OnCreateControl();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Image Image { get => base.Image; set { base.Image = value; } }
[Category("Appearance"), Browsable(true)]
public Image NormalImage { get; set; }
[Category("Appearance"), Browsable(true)]
public Image HighlightImage { get; set; }
protected override void OnMouseEnter(EventArgs e)
{
this.Image = this.HighlightImage;
base.OnMouseEnter(e);
}
protected override void OnMouseLeave(EventArgs e)
{
this.Image = this.NormalImage;
base.OnMouseLeave(e);
}
protected override void OnLostFocus(EventArgs e)
{
this.Image = this.NormalImage;
base.OnLostFocus(e);
}
}
}

View File

@ -0,0 +1,37 @@
namespace RyzStudio.Windows.Forms
{
partial class PanelBook
{
/// <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 Component 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()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@ -0,0 +1,159 @@
namespace RyzStudio.Windows.Forms
{
using System;
using System.ComponentModel;
using System.Windows.Forms;
[ToolboxItem(true)]
public partial class PanelBook : UserControl
{
protected PanelCollection panelCollection = null;
public PanelBook()
{
InitializeComponent();
panelCollection = new PanelCollection(this);
}
public Panel ActivePanel { get; set; } = null;
[Category("Collection")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PanelCollection Pages
{
get { return panelCollection; }
}
[Category("Collection")]
public int SelectedIndex
{
get
{
if (panelCollection.Count <= 0)
{
return -1;
}
return panelCollection.IndexOf(this.ActivePanel);
}
set
{
if (panelCollection.Count <= 0)
{
return;
}
if (value < 0)
{
return;
}
if (value > (panelCollection.Count - 1))
{
return;
}
if (value == this.SelectedIndex)
{
return;
}
ActivatePanel(value);
}
}
protected internal int PageIndex
{
get
{
return panelCollection.IndexOf(this.ActivePanel);
}
set
{
if (panelCollection.Count <= 0)
{
ActivatePanel(-1);
return;
}
if ((value < -1) || (value >= panelCollection.Count))
{
throw new ArgumentOutOfRangeException("PageIndex", value, "The page index must be between 0 and " + Convert.ToString(panelCollection.Count - 1));
}
ActivatePanel(value);
}
}
protected internal void ActivatePanel(int index)
{
if ((panelCollection.Count == 0) && (index >= panelCollection.Count) && (index <= 0))
{
return;
}
Panel p = (Panel)panelCollection[index];
ActivatePage(p);
}
protected internal void ActivatePage(Panel page)
{
if (this.ActivePanel != null)
{
this.ActivePanel.Visible = false;
}
this.ActivePanel = page;
if (this.ActivePanel != null)
{
this.ActivePanel.Parent = this;
if (!this.Contains(this.ActivePanel))
{
this.Container.Add(this.ActivePanel);
}
this.ActivePanel.Dock = DockStyle.Fill;
this.ActivePanel.Visible = true;
this.ActivePanel.BringToFront();
}
if (this.ActivePanel != null)
{
this.ActivePanel.Invalidate();
}
else
{
this.Invalidate();
}
}
#if DEBUG
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
if (this.DesignMode)
{
this.Invalidate();
}
}
#endif
protected override void DestroyHandle()
{
base.DestroyHandle();
foreach (Panel p in panelCollection)
{
p.Dispose();
}
}
}
}

View File

@ -0,0 +1,80 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
[ToolboxItem(true)]
public class PanelCollection : CollectionBase
{
protected PanelBook panelBook = null;
public PanelCollection()
{
}
public PanelCollection(PanelBook parent) : base()
{
panelBook = parent;
}
public PanelBook Parent => panelBook;
public Panel this[int index] { get => (Panel)List[index]; set => List[index] = value; }
public int Add(Panel value) => List.Add(value);
public void AddRange(Panel[] pages)
{
foreach (Panel page in pages)
{
this.Add(page);
}
}
public int IndexOf(Panel value) => (List.IndexOf(value));
public void Insert(int index, Panel value) => List.Insert(index, value);
public void Remove(Panel value) => List.Remove(value);
public bool Contains(Panel value) => List.Contains(value);
protected override void OnInsertComplete(int index, object value)
{
base.OnInsertComplete(index, value);
if (panelBook != null)
{
panelBook.PageIndex = index;
}
}
protected override void OnRemoveComplete(int index, object value)
{
base.OnRemoveComplete(index, value);
if (panelBook != null)
{
if (panelBook.PageIndex == index)
{
if (index < InnerList.Count)
{
panelBook.PageIndex = index;
}
else
{
panelBook.PageIndex = InnerList.Count - 1;
}
}
}
}
}
}

View File

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class StackLayoutPanel : FlowLayoutPanel
{
public StackLayoutPanel() : base()
{
this.AutoScroll = true;
this.FlowDirection = FlowDirection.TopDown;
this.WrapContents = false;
}
protected override void OnResize(EventArgs eventargs)
{
base.OnResize(eventargs);
//int w = this.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth;
int w = this.ClientRectangle.Width - 1;
foreach (Control item in this.Controls)
{
if (item.Width != w)
{
item.Width = w;
}
}
}
protected override void OnControlAdded(ControlEventArgs e)
{
base.OnControlAdded(e);
OnResize(null);
}
protected override void OnControlRemoved(ControlEventArgs e)
{
base.OnControlRemoved(e);
OnResize(null);
}
public void AddControl(Control value)
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() =>
{
value.Margin = new Padding(0, 3, 0, 3);
this.Controls.Add(value);
}));
}
else
{
value.Margin = new Padding(0, 3, 0, 3);
this.Controls.Add(value);
}
}
}
}

View File

@ -0,0 +1,191 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class BorderlessForm
{
/// <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(BorderlessForm));
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.area1 = new System.Windows.Forms.Panel();
this.pictureBox4 = new RyzStudio.Windows.Forms.ImageBox();
this.pictureBox2 = new RyzStudio.Windows.Forms.ImageBox();
this.pictureBox1 = new RyzStudio.Windows.Forms.ImageBox();
this.pictureBox3 = new RyzStudio.Windows.Forms.ImageBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(241)))), ((int)(((byte)(241)))));
this.label1.Location = new System.Drawing.Point(1, 1);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(48, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(454, 48);
this.label1.TabIndex = 148;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.DoubleClick += new System.EventHandler(this.label1_DoubleClick);
this.label1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick);
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
this.label1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
this.label1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.panel1.Location = new System.Drawing.Point(594, 674);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(6, 6);
this.panel1.TabIndex = 150;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
//
// area1
//
this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.area1.BackColor = System.Drawing.Color.Transparent;
this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.area1.Location = new System.Drawing.Point(1, 674);
this.area1.Name = "area1";
this.area1.Size = new System.Drawing.Size(592, 6);
this.area1.TabIndex = 152;
this.area1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
this.area1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
this.area1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
//
// pictureBox4
//
this.pictureBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox4.BackColor = System.Drawing.Color.Transparent;
this.pictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox4.ErrorImage = null;
this.pictureBox4.HighlightImage = global::hiim.dply.Properties.Resources.form20_menu2;
this.pictureBox4.Image = global::hiim.dply.Properties.Resources.form20_menu;
this.pictureBox4.InitialImage = null;
this.pictureBox4.Location = new System.Drawing.Point(460, 11);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.NormalImage = global::hiim.dply.Properties.Resources.form20_menu;
this.pictureBox4.Size = new System.Drawing.Size(28, 28);
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox4.TabIndex = 149;
this.pictureBox4.TabStop = false;
//
// pictureBox2
//
this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox2.ErrorImage = null;
this.pictureBox2.HighlightImage = global::hiim.dply.Properties.Resources.form20_maximise2;
this.pictureBox2.Image = global::hiim.dply.Properties.Resources.form20_maximise;
this.pictureBox2.InitialImage = null;
this.pictureBox2.Location = new System.Drawing.Point(528, 11);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.NormalImage = global::hiim.dply.Properties.Resources.form20_maximise;
this.pictureBox2.Size = new System.Drawing.Size(28, 28);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox2.TabIndex = 147;
this.pictureBox2.TabStop = false;
//
// pictureBox1
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.ErrorImage = null;
this.pictureBox1.HighlightImage = global::hiim.dply.Properties.Resources.form20_minimise2;
this.pictureBox1.Image = global::hiim.dply.Properties.Resources.form20_minimise;
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(494, 11);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.NormalImage = global::hiim.dply.Properties.Resources.form20_minimise;
this.pictureBox1.Size = new System.Drawing.Size(28, 28);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 146;
this.pictureBox1.TabStop = false;
//
// pictureBox3
//
this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
this.pictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox3.ErrorImage = null;
this.pictureBox3.HighlightImage = global::hiim.dply.Properties.Resources.form20_close2;
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
this.pictureBox3.InitialImage = null;
this.pictureBox3.Location = new System.Drawing.Point(562, 11);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.NormalImage = ((System.Drawing.Image)(resources.GetObject("pictureBox3.NormalImage")));
this.pictureBox3.Size = new System.Drawing.Size(28, 28);
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox3.TabIndex = 145;
this.pictureBox3.TabStop = false;
//
// BorderlessForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(600, 680);
this.Controls.Add(this.area1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.pictureBox4);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.pictureBox3);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "BorderlessForm";
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
this.ResumeLayout(false);
}
#endregion
protected internal Forms.ImageBox pictureBox2;
protected internal Forms.ImageBox pictureBox1;
protected internal Forms.ImageBox pictureBox3;
protected internal System.Windows.Forms.Label label1;
protected internal Forms.ImageBox pictureBox4;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;
}
}

View File

@ -0,0 +1,410 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using Resources = hiim.dply.Properties.Resources;
public partial class BorderlessForm : System.Windows.Forms.Form
{
protected bool isBusy = false;
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 48;
protected Color bottomFillColour = Color.FromArgb(15, 15, 15);
protected int bottomFillMargin = 19;
protected int bottomLeftMargin = 20;
protected int borderWidth = 1;
protected int menuFillWidth = 160;
protected Color menuFillColour = Color.FromArgb(179, 179, 179);
private bool windowDragging = false;
private Point windowOffset = new Point();
private Point windowSize = new Point();
public BorderlessForm() : base()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(247, 247, 247);
this.FormBorderStyle = FormBorderStyle.None;
this.Padding = new Padding(1);
this.topFillColour = Color.FromArgb(51, 51, 51);
this.topFillHeight = 48;
this.bottomFillColour = Color.FromArgb(0, 152, 167);
this.bottomFillMargin = 6;
pictureBox1.Click += pictureBox1_Click;
pictureBox2.Click += pictureBox2_Click;
pictureBox3.Click += pictureBox3_Click;
pictureBox4.Click += pictureBox4_Click;
updatePictureBox2Image();
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.IsBusy)
{
e.Cancel = true;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBottom = new Rectangle(this.DisplayRectangle.Left, (this.DisplayRectangle.Height - bottomFillMargin + this.Padding.Top), this.DisplayRectangle.Width, bottomFillMargin);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
Rectangle areaMenu = new Rectangle(this.DisplayRectangle.Left, this.DisplayRectangle.Top + topFillHeight, menuFillWidth, (this.DisplayRectangle.Height - bottomFillMargin - topFillHeight));
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
// fill menu
g.FillRectangle(new SolidBrush(menuFillColour), areaMenu);
// draw footer
if (bottomFillMargin > 0)
{
g.FillRectangle(new SolidBrush(bottomFillColour), areaBottom);
}
// draw logo
if (this.TitleLogo != null)
{
g.DrawImageUnscaled(this.TitleLogo, this.Padding.Left, this.Padding.Top);
}
if (this.Banner != null)
{
g.DrawImageUnscaled(this.Banner, this.Padding.Left + bottomLeftMargin, (this.DisplayRectangle.Height - this.Banner.Height - bottomFillMargin + this.Padding.Top), (this.DisplayRectangle.Width - (this.Padding.Left + this.Padding.Right)), this.Banner.Height);
}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
updatePictureBox2Image();
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance"), Browsable(true)]
public string Description
{
get
{
return label1.Text?.Replace("\n", "\\n");
}
set
{
label1.Text = value?.Replace("\\n", "\n");
}
}
[Category("Appearance"), Browsable(true)]
public Image TitleLogo { get; set; }
[Category("Appearance"), Browsable(true)]
public Image Banner { get; set; }
[Category("Appearance"), Browsable(true)]
public bool ShowMenuButton { get => pictureBox4.Visible; set => pictureBox4.Visible = value; }
protected virtual bool IsBusy { get => isBusy; set => isBusy = value; }
private void pictureBox4_Click(object sender, System.EventArgs e)
{
//this.WindowState = FormWindowState.Minimized;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.WindowState = FormWindowState.Minimized;
}
private void pictureBox2_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
pictureBox2.NormalImage = Resources.form20_maximise;
pictureBox2.HighlightImage = Resources.form20_maximise2;
}
else
{
this.WindowState = FormWindowState.Maximized;
pictureBox2.NormalImage = Resources.form20_restore;
pictureBox2.HighlightImage = Resources.form20_restore2;
}
}
private void pictureBox3_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.Close();
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void AddControl(FlowLayoutPanel sender, Control value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() =>
{
sender.Controls.Add(value);
}));
}
else
{
sender.Controls.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
protected void updatePictureBox2Image()
{
if (this.WindowState == FormWindowState.Maximized)
{
pictureBox2.NormalImage = Resources.form20_restore;
pictureBox2.HighlightImage = Resources.form20_restore2;
}
else
{
pictureBox2.NormalImage = Resources.form20_maximise;
pictureBox2.HighlightImage = Resources.form20_maximise2;
}
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new Point(currentScreenPos.X - windowOffset.X, currentScreenPos.Y - windowOffset.Y);
}
}
private void label1_DoubleClick(object sender, EventArgs e) => pictureBox2_Click(sender, e);
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Middle)
{
this.TopMost = !this.TopMost;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(e.X - windowOffset.X + this.Width, e.Y - windowOffset.Y + this.Height);
}
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel2_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel2_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(windowSize.X, e.Y - windowOffset.Y + this.Height);
}
}
}
}

View File

@ -0,0 +1,158 @@
<?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>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADnSURBVDhP1ZVB
DoIwEEW7whNo9Cri/QCv5Y4YEoTWxK71Gvqn+W2AgEkbNvxkYPgzfWkpKcpau9NaX/u+/yC+iSFjK3Ay
RdhcU0qUChc3s67rzipRGJ8T+JYHR2ctWYGzXSC8Gzbs3rbtgZaSXDyp0QoKnJBMBK8WH5vVCUhCcvbX
bAuivwxsmmaP2TxYfyE3zJ/Ij2wLYu3/OxQoah4kYedgIt8TDTTGnFgeyfcsAodLxn205Dlo4IRkInjr
bgq8dT+bWG0L6A/WnLVo4b1eyHDHV8WHNaJwvwAkJeI9KMSGjC201tkP+AimzgF8cMEAAAAASUVORK5C
YII=
</value>
</data>
<data name="pictureBox3.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADnSURBVDhP1ZVB
DoIwEEW7whNo9Cri/QCv5Y4YEoTWxK71Gvqn+W2AgEkbNvxkYPgzfWkpKcpau9NaX/u+/yC+iSFjK3Ay
RdhcU0qUChc3s67rzipRGJ8T+JYHR2ctWYGzXSC8Gzbs3rbtgZaSXDyp0QoKnJBMBK8WH5vVCUhCcvbX
bAuivwxsmmaP2TxYfyE3zJ/Ij2wLYu3/OxQoah4kYedgIt8TDTTGnFgeyfcsAodLxn205Dlo4IRkInjr
bgq8dT+bWG0L6A/WnLVo4b1eyHDHV8WHNaJwvwAkJeI9KMSGjC201tkP+AimzgF8cMEAAAAASUVORK5C
YII=
</value>
</data>
</root>

View File

@ -0,0 +1,191 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class BorderlessToolForm
{
/// <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.lblDescription = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.imgbxMenu = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxMaximise = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxMinimise = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxClose = new RyzStudio.Windows.Forms.ImageBox();
this.area1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.imgbxMenu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMaximise)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMinimise)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//
// lblDescription
//
this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblDescription.BackColor = System.Drawing.Color.Transparent;
this.lblDescription.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDescription.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(241)))), ((int)(((byte)(241)))));
this.lblDescription.Location = new System.Drawing.Point(1, 1);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lblDescription.Size = new System.Drawing.Size(194, 30);
this.lblDescription.TabIndex = 148;
this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblDescription.DoubleClick += new System.EventHandler(this.label1_DoubleClick);
this.lblDescription.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick);
this.lblDescription.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
this.lblDescription.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
this.lblDescription.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.panel1.Location = new System.Drawing.Point(335, 595);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(5, 5);
this.panel1.TabIndex = 150;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
//
// imgbxMenu
//
this.imgbxMenu.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMenu.BackColor = System.Drawing.Color.Transparent;
this.imgbxMenu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMenu.ErrorImage = null;
this.imgbxMenu.HighlightImage = global::AppLauncher.Properties.Resources.form16_menu2;
this.imgbxMenu.Image = global::AppLauncher.Properties.Resources.form16_menu;
this.imgbxMenu.InitialImage = null;
this.imgbxMenu.Location = new System.Drawing.Point(224, 4);
this.imgbxMenu.Name = "imgbxMenu";
this.imgbxMenu.NormalImage = global::AppLauncher.Properties.Resources.form16_menu;
this.imgbxMenu.Size = new System.Drawing.Size(24, 24);
this.imgbxMenu.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMenu.TabIndex = 149;
this.imgbxMenu.TabStop = false;
//
// imgbxMaximise
//
this.imgbxMaximise.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMaximise.BackColor = System.Drawing.Color.Transparent;
this.imgbxMaximise.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMaximise.ErrorImage = null;
this.imgbxMaximise.HighlightImage = global::AppLauncher.Properties.Resources.form16_maximise2;
this.imgbxMaximise.Image = global::AppLauncher.Properties.Resources.form16_maximise;
this.imgbxMaximise.InitialImage = null;
this.imgbxMaximise.Location = new System.Drawing.Point(280, 4);
this.imgbxMaximise.Name = "imgbxMaximise";
this.imgbxMaximise.NormalImage = global::AppLauncher.Properties.Resources.form16_maximise;
this.imgbxMaximise.Size = new System.Drawing.Size(24, 24);
this.imgbxMaximise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMaximise.TabIndex = 147;
this.imgbxMaximise.TabStop = false;
//
// imgbxMinimise
//
this.imgbxMinimise.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMinimise.BackColor = System.Drawing.Color.Transparent;
this.imgbxMinimise.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMinimise.ErrorImage = null;
this.imgbxMinimise.HighlightImage = global::AppLauncher.Properties.Resources.form16_minimise2;
this.imgbxMinimise.Image = global::AppLauncher.Properties.Resources.form16_minimise;
this.imgbxMinimise.InitialImage = null;
this.imgbxMinimise.Location = new System.Drawing.Point(252, 4);
this.imgbxMinimise.Name = "imgbxMinimise";
this.imgbxMinimise.NormalImage = global::AppLauncher.Properties.Resources.form16_minimise;
this.imgbxMinimise.Size = new System.Drawing.Size(24, 24);
this.imgbxMinimise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMinimise.TabIndex = 146;
this.imgbxMinimise.TabStop = false;
//
// imgbxClose
//
this.imgbxClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxClose.BackColor = System.Drawing.Color.Transparent;
this.imgbxClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxClose.ErrorImage = null;
this.imgbxClose.HighlightImage = global::AppLauncher.Properties.Resources.form16_close2;
this.imgbxClose.Image = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.InitialImage = null;
this.imgbxClose.Location = new System.Drawing.Point(308, 4);
this.imgbxClose.Name = "imgbxClose";
this.imgbxClose.NormalImage = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.Size = new System.Drawing.Size(24, 24);
this.imgbxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxClose.TabIndex = 145;
this.imgbxClose.TabStop = false;
//
// area1
//
this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.area1.BackColor = System.Drawing.Color.Transparent;
this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.area1.Location = new System.Drawing.Point(0, 595);
this.area1.Name = "area1";
this.area1.Size = new System.Drawing.Size(334, 5);
this.area1.TabIndex = 151;
this.area1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
this.area1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
this.area1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
//
// BorderlessToolForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(340, 600);
this.Controls.Add(this.area1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.imgbxMenu);
this.Controls.Add(this.lblDescription);
this.Controls.Add(this.imgbxMaximise);
this.Controls.Add(this.imgbxMinimise);
this.Controls.Add(this.imgbxClose);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MinimumSize = new System.Drawing.Size(40, 0);
this.Name = "BorderlessToolForm";
((System.ComponentModel.ISupportInitialize)(this.imgbxMenu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMaximise)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMinimise)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
this.ResumeLayout(false);
}
#endregion
protected internal Forms.ImageBox imgbxMaximise;
protected internal Forms.ImageBox imgbxMinimise;
protected internal Forms.ImageBox imgbxClose;
protected internal System.Windows.Forms.Label lblDescription;
protected internal Forms.ImageBox imgbxMenu;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;
}
}

View File

@ -0,0 +1,394 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using Resources = AppLauncher.Properties.Resources;
public partial class BorderlessToolForm : System.Windows.Forms.Form
{
protected bool isBusy = false;
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 32;
protected int borderWidth = 1;
private bool windowDragging = false;
private Point windowOffset = new Point();
private Point windowSize = new Point();
public BorderlessToolForm() : base()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(246, 246, 246);
this.Padding = new Padding(1);
this.topFillColour = Color.FromArgb(51, 51, 51);
this.topFillHeight = 32;
this.BackColor = Color.FromArgb(179, 179, 179);
this.FormBorderStyle = FormBorderStyle.None;
imgbxMinimise.Click += pictureBox1_Click;
imgbxMaximise.Click += pictureBox2_Click;
imgbxClose.Click += pictureBox3_Click;
imgbxMenu.Click += pictureBox4_Click;
updatePictureBox2Image();
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.IsBusy)
{
e.Cancel = true;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
// draw logo
//if (this.TitleLogo != null)
//{
// g.DrawImageUnscaled(this.TitleLogo, this.Padding.Left, this.Padding.Top);
//}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
updatePictureBox2Image();
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance"), Browsable(true)]
public string Description
{
get
{
return lblDescription.Text?.Replace("\n", "\\n");
}
set
{
lblDescription.Text = value?.Replace("\\n", "\n");
}
}
//[Category("Appearance"), Browsable(true)]
//public Image TitleLogo { get; set; }
[Category("Appearance"), Browsable(true)]
public Image Banner { get; set; }
[Category("Appearance"), Browsable(true)]
public bool ShowMenuButton { get => imgbxMenu.Visible; set => imgbxMenu.Visible = value; }
[Category("Appearance"), Browsable(true)]
public bool ShowMinimiseButton { get => imgbxMinimise.Visible; set => imgbxMinimise.Visible = value; }
[Category("Appearance"), Browsable(true)]
public bool ShowMaximiseButton { get => imgbxMaximise.Visible; set => imgbxMaximise.Visible = value; }
protected virtual bool IsBusy { get => isBusy; set => isBusy = value; }
private void pictureBox4_Click(object sender, System.EventArgs e)
{
//this.WindowState = FormWindowState.Minimized;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.WindowState = FormWindowState.Minimized;
}
private void pictureBox2_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
imgbxMaximise.NormalImage = Resources.form16_maximise;
imgbxMaximise.HighlightImage = Resources.form16_maximise2;
}
else
{
this.WindowState = FormWindowState.Maximized;
imgbxMaximise.NormalImage = Resources.form16_restore;
imgbxMaximise.HighlightImage = Resources.form16_restore2;
}
}
private void pictureBox3_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.Close();
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void AddControl(FlowLayoutPanel sender, Control value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() =>
{
sender.Controls.Add(value);
}));
}
else
{
sender.Controls.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
protected void updatePictureBox2Image()
{
if (this.WindowState == FormWindowState.Maximized)
{
imgbxMaximise.NormalImage = Resources.form16_restore;
imgbxMaximise.HighlightImage = Resources.form16_restore2;
}
else
{
imgbxMaximise.NormalImage = Resources.form16_maximise;
imgbxMaximise.HighlightImage = Resources.form16_maximise2;
}
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new Point(currentScreenPos.X - windowOffset.X, currentScreenPos.Y - windowOffset.Y);
}
}
private void label1_DoubleClick(object sender, EventArgs e) => pictureBox2_Click(sender, e);
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Middle)
{
this.TopMost = !this.TopMost;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(e.X - windowOffset.X + this.Width, e.Y - windowOffset.Y + this.Height);
}
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel2_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel2_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(windowSize.X, e.Y - windowOffset.Y + this.Height);
}
}
}
}

View File

@ -0,0 +1,138 @@
<?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>
<metadata name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMenu.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMaximise.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMinimise.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxClose.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,103 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
public partial class Button : RyzStudio.Windows.ThemedForms.UserControl
{
protected ButtonState buttonState = ButtonState.Normal;
public Button() : base()
{
InitializeComponent();
label1.ImageAlign = ContentAlignment.MiddleCenter;
label1.Click += delegate { this.OnClick(null); };
label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; };
label1.MouseLeave += delegate { this.VisualState = ButtonState.Normal; };
label1.MouseDown += delegate { this.VisualState = ButtonState.Down; };
label1.MouseUp += delegate { this.VisualState = ButtonState.Normal; };
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// customise
this.StyleOver = new ButtonStyle(Color.FromArgb(51, 51, 51), Color.White, this.OverImage);
this.StyleDown = new ButtonStyle(Color.FromArgb(179, 179, 179), Color.Black, this.DownImage);
this.StyleDefault = new ButtonStyle(Color.White, Color.Black, this.DefaultImage);
this.VisualState = ButtonState.Normal;
}
protected ButtonState VisualState
{
get { return buttonState; }
set
{
switch (value)
{
case ButtonState.Normal:
if (this.VisualState == ButtonState.Down)
{
updateButton(StyleOver);
}
else
{
updateButton(StyleDefault);
}
break;
case ButtonState.Hover:
updateButton(StyleOver);
break;
case ButtonState.Down:
updateButton(StyleDown);
break;
default:
updateButton(StyleDefault);
break;
}
buttonState = value;
}
}
protected void updateButton(ButtonStyle style)
{
label1.ForeColor = style.PenColour;
label1.BackColor = style.BackColour;
label1.Image = style.ForeImage;
}
[Browsable(true)]
[Category("Appearance")]
public string LabelText { get => label1.Text; set => label1.Text = value; }
[Browsable(true)]
[Category("Appearance")]
public Image OverImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DownImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DefaultImage { get; set; } = null;
[Browsable(false)]
public ButtonStyle StyleOver { get; set; } = new ButtonStyle(Color.FromArgb(71, 142, 203), Color.FromArgb(250, 250, 250));
[Browsable(false)]
public ButtonStyle StyleDown { get; set; } = new ButtonStyle(Color.FromArgb(61, 132, 193), Color.FromArgb(250, 250, 250));
[Browsable(false)]
public ButtonStyle StyleDefault { get; set; } = new ButtonStyle(Color.FromArgb(51, 122, 183), Color.FromArgb(250, 250, 250));
public void PerformClick() => this.OnClick(null);
}
}

View File

@ -0,0 +1,61 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class Button
{
/// <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 Component 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.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(4, 4);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 25);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Button
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
this.Name = "Button";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
}
}

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,9 @@
namespace RyzStudio.Windows.ThemedForms
{
public enum ButtonState
{
Normal = 0,
Hover,
Down
}
}

View File

@ -0,0 +1,25 @@
namespace RyzStudio.Windows.ThemedForms
{
using System.Drawing;
public class ButtonStyle
{
public Color BackColour { get; set; }
public Color PenColour { get; set; }
public Image ForeImage { get; set; } = null;
public ButtonStyle(Color backColour, Color penColour)
{
this.BackColour = backColour;
this.PenColour = penColour;
this.ForeImage = null;
}
public ButtonStyle(Color backColour, Color penColour, Image foreImage)
{
this.BackColour = backColour;
this.PenColour = penColour;
this.ForeImage = foreImage;
}
}
}

View File

@ -0,0 +1,123 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class DialogForm
{
/// <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.lblDescription = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.imgbxClose = new RyzStudio.Windows.Forms.ImageBox();
this.area1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//
// lblDescription
//
this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblDescription.BackColor = System.Drawing.Color.Transparent;
this.lblDescription.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDescription.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(241)))), ((int)(((byte)(241)))));
this.lblDescription.Location = new System.Drawing.Point(1, 1);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lblDescription.Size = new System.Drawing.Size(301, 30);
this.lblDescription.TabIndex = 148;
this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblDescription.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick);
this.lblDescription.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
this.lblDescription.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
this.lblDescription.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.panel1.Location = new System.Drawing.Point(335, 595);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(5, 5);
this.panel1.TabIndex = 150;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
//
// imgbxClose
//
this.imgbxClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxClose.BackColor = System.Drawing.Color.Transparent;
this.imgbxClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxClose.ErrorImage = null;
this.imgbxClose.HighlightImage = global::AppLauncher.Properties.Resources.form16_close2;
this.imgbxClose.Image = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.InitialImage = null;
this.imgbxClose.Location = new System.Drawing.Point(308, 4);
this.imgbxClose.Name = "imgbxClose";
this.imgbxClose.NormalImage = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.Size = new System.Drawing.Size(24, 24);
this.imgbxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxClose.TabIndex = 145;
this.imgbxClose.TabStop = false;
//
// area1
//
this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.area1.BackColor = System.Drawing.Color.Transparent;
this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.area1.Location = new System.Drawing.Point(0, 595);
this.area1.Name = "area1";
this.area1.Size = new System.Drawing.Size(334, 5);
this.area1.TabIndex = 151;
this.area1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
this.area1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
this.area1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
//
// DialogForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(249)))), ((int)(((byte)(250)))));
this.ClientSize = new System.Drawing.Size(340, 600);
this.Controls.Add(this.area1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.lblDescription);
this.Controls.Add(this.imgbxClose);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MinimumSize = new System.Drawing.Size(40, 0);
this.Name = "DialogForm";
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
this.ResumeLayout(false);
}
#endregion
protected internal Forms.ImageBox imgbxClose;
protected internal System.Windows.Forms.Label lblDescription;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;
}
}

View File

@ -0,0 +1,306 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using Resources = AppLauncher.Properties.Resources;
public partial class DialogForm : System.Windows.Forms.Form
{
protected bool isBusy = false;
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 32;
protected int borderWidth = 1;
private bool windowDragging = false;
private Point windowOffset = new Point();
private Point windowSize = new Point();
public DialogForm() : base()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(246, 246, 246);
this.Padding = new Padding(1);
this.topFillColour = Color.FromArgb(51, 51, 51);
this.topFillHeight = 32;
this.BackColor = Color.FromArgb(248, 249, 250);
this.FormBorderStyle = FormBorderStyle.None;
imgbxClose.Click += pictureBox3_Click;
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.IsBusy)
{
e.Cancel = true;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance"), Browsable(true)]
public string Description
{
get
{
return lblDescription.Text?.Replace("\n", "\\n");
}
set
{
lblDescription.Text = value?.Replace("\\n", "\n");
}
}
protected virtual bool IsBusy { get => isBusy; set => isBusy = value; }
private void pictureBox3_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.Close();
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void AddControl(FlowLayoutPanel sender, Control value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() =>
{
sender.Controls.Add(value);
}));
}
else
{
sender.Controls.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new Point(currentScreenPos.X - windowOffset.X, currentScreenPos.Y - windowOffset.Y);
}
}
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Middle)
{
this.TopMost = !this.TopMost;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(e.X - windowOffset.X + this.Width, e.Y - windowOffset.Y + this.Height);
}
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel2_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel2_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(windowSize.X, e.Y - windowOffset.Y + this.Height);
}
}
}
}

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>
<metadata name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxClose.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,52 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class Form
{
/// <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.SuspendLayout();
//
// Form
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(584, 381);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimumSize = new System.Drawing.Size(600, 420);
this.Name = "Form";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,173 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class Form : System.Windows.Forms.Form
{
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 52;
protected Color bottomFillColour = Color.FromArgb(15, 15, 15);
protected int bottomFillMargin = 19;
protected int borderWidth = 1;
public Form()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(246, 246, 246);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBottom = new Rectangle(this.DisplayRectangle.Left, (this.DisplayRectangle.Height - bottomFillMargin), this.DisplayRectangle.Width, bottomFillMargin);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
// draw footer
if (bottomFillMargin > 0)
{
g.FillRectangle(new SolidBrush(bottomFillColour), areaBottom);
}
// draw logo
if (this.TitleLogo != null)
{
g.DrawImageUnscaled(this.TitleLogo, this.Padding.Left, this.Padding.Top);
}
if (this.Banner != null)
{
g.DrawImageUnscaled(this.Banner, this.Padding.Left, (this.DisplayRectangle.Height - this.Banner.Height - bottomFillMargin), (this.DisplayRectangle.Width - (this.Padding.Left + this.Padding.Right)), this.Banner.Height);
}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set { base.BackColor = value; } }
[Category("Appearance"), Browsable(true)]
public Image TitleLogo { get; set; }
[Category("Appearance"), Browsable(true)]
public Image Banner { get; set; }
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
}
}

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,111 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
public partial class LeftButton : RyzStudio.Windows.ThemedForms.LeftUserControl
{
protected ButtonState buttonState = ButtonState.Normal;
public LeftButton() : base()
{
InitializeComponent();
label1.ImageAlign = ContentAlignment.MiddleCenter;
label1.Click += delegate { this.OnClick(null); };
label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; };
label1.MouseLeave += delegate { this.VisualState = ButtonState.Normal; };
label1.MouseDown += delegate { this.VisualState = ButtonState.Down; };
label1.MouseUp += delegate { this.VisualState = ButtonState.Normal; };
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// customise
this.StyleOver = new ButtonStyle(Color.FromArgb(0, 152, 167), Color.White, this.OverImage);
this.StyleDown = new ButtonStyle(Color.FromArgb(179, 179, 179), Color.Black, this.DownImage);
this.StyleDefault = new ButtonStyle(Color.White, Color.Black, this.DefaultImage);
//this.StyleOver.ForeImage = this.OverImage;
//this.StyleDown.ForeImage = this.DownImage;
//this.StyleDefault.ForeImage = this.DefaultImage;
this.VisualState = ButtonState.Normal;
}
protected ButtonState VisualState
{
get { return buttonState; }
set
{
switch (value)
{
case ButtonState.Normal:
if (this.VisualState == ButtonState.Down)
{
updateButton(StyleOver);
}
else
{
updateButton(StyleDefault);
}
break;
case ButtonState.Hover:
updateButton(StyleOver);
break;
case ButtonState.Down:
updateButton(StyleDown);
break;
default:
updateButton(StyleDefault);
break;
}
buttonState = value;
}
}
protected void updateButton(ButtonStyle style)
{
label1.ForeColor = style.PenColour;
label1.BackColor = style.BackColour;
label1.Image = style.ForeImage;
}
[Browsable(true)]
[Category("Appearance")]
public string LabelText { get => label1.Text; set => label1.Text = value; }
[Browsable(true)]
[Category("Appearance")]
public System.Windows.Forms.Label Label { get => label1; set => label1 = value; }
[Browsable(true)]
[Category("Appearance")]
public Image OverImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DownImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DefaultImage { get; set; } = null;
[Browsable(false)]
public ButtonStyle StyleOver { get; set; } = new ButtonStyle(Color.FromArgb(71, 142, 203), Color.FromArgb(250, 250, 250));
[Browsable(false)]
public ButtonStyle StyleDown { get; set; } = new ButtonStyle(Color.FromArgb(61, 132, 193), Color.FromArgb(250, 250, 250));
[Browsable(false)]
public ButtonStyle StyleDefault { get; set; } = new ButtonStyle(Color.FromArgb(51, 122, 183), Color.FromArgb(250, 250, 250));
public void PerformClick() => this.OnClick(null);
}
}

View File

@ -0,0 +1,61 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class LeftButton
{
/// <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 Component 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.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(4, 4);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 25);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Button
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
this.Name = "Button";
this.Padding = new System.Windows.Forms.Padding(4, 4, 0, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
}
}

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,53 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.Drawing;
using System.Windows.Forms;
using RyzStudio.Drawing;
using System.ComponentModel;
public partial class LeftUserControl : System.Windows.Forms.UserControl
{
protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White);
public LeftUserControl()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.BackColor = Color.Transparent;
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
Graphics g = e.Graphics;
//// g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
//// g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
//// g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
//// g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
updateBackground(g, styleActive);
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
protected virtual void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding(b, b, 0, (b - 1));
LeftRectangoid area = new LeftRectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToClosedGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
}
}

View File

@ -0,0 +1,37 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class LeftUserControl
{
/// <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 Component 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()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@ -0,0 +1,98 @@
namespace RyzStudio.Windows.ThemedForms
{
using RyzStudio.Drawing;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class PickerBox : RyzStudio.Windows.ThemedForms.UserControl
{
protected readonly Padding textboxPadding = new Padding(6, 2, 4, 2);
public PickerBox() : base()
{
InitializeComponent();
this.Font = new Font(this.Font, FontStyle.Regular);
this.Margin = new Padding(10, 4, 10, 4);
comboBox1.Font = this.Font;
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.PreviewKeyDown += textBox_PreviewKeyDown;
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Height = comboBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom);
}
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
comboBox1.Focus();
}
protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Enter:
if (this.SubmitButton != null)
{
this.SubmitButton.PerformClick();
}
break;
case Keys.Escape:
tryClose();
break;
default: break;
}
}
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public System.Windows.Forms.ComboBox ComboBox { get => comboBox1; set => comboBox1 = value; }
//[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
//[Category("Appearance")]
//public new string Text
//{
// get => textBox1.Text;
// set
// {
// textBox1.Text = value;
// textBox1.SelectionStart = textBox1.Text.Length;
// }
//}
//[Browsable(true)]
//[Category("Appearance")]
//public ComboBox.ObjectCollection Items { get => comboBox1.Items; set => comboBox1.Items = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public Button SubmitButton { get; set; } = null;
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get => base.Margin; set => base.Margin = value; }
protected override void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom));
Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
}
}

View File

@ -0,0 +1,59 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class PickerBox
{
/// <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 Component 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.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.comboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(4, 4);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
//
// PickerBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.comboBox1);
this.Name = "PickerBox";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ComboBox comboBox1;
}
}

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,72 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class ProgressBar
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component 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.label3 = new System.Windows.Forms.Label();
this.userControl1 = new RyzStudio.Windows.ThemedForms.ProgressBarInner();
this.SuspendLayout();
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("Segoe UI", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(4, 4);
this.label3.Margin = new System.Windows.Forms.Padding(0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(803, 47);
this.label3.TabIndex = 144;
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// userControl1
//
this.userControl1.BarColour = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(225)))), ((int)(((byte)(249)))));
this.userControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.userControl1.Location = new System.Drawing.Point(4, 4);
this.userControl1.Margin = new System.Windows.Forms.Padding(0);
this.userControl1.Maximum = 100;
this.userControl1.Minimum = 0;
this.userControl1.Name = "userControl1";
this.userControl1.Size = new System.Drawing.Size(803, 47);
this.userControl1.TabIndex = 145;
this.userControl1.Value = 50;
//
// ProgressBar
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.userControl1);
this.Controls.Add(this.label3);
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "ProgressBar";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(810, 54);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label3;
private ProgressBarInner userControl1;
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Drawing;
namespace RyzStudio.Windows.ThemedForms
{
public partial class ProgressBar : RyzStudio.Windows.ThemedForms.UserControl
{
public ProgressBar() : base()
{
InitializeComponent();
styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White);
}
public int Minimum { get => userControl1.Minimum; set => userControl1.Minimum = value; }
public int Maximum { get => userControl1.Maximum; set => userControl1.Maximum = value; }
public int Value { get => userControl1.Value; set => userControl1.Value = value; }
public Color BarColour { get => userControl1.BarColour; set => userControl1.BarColour = value; }
public Color BarTextColour { get => userControl1.BarTextColour; set => userControl1.BarTextColour = value; }
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
this.Invalidate();
}
}
}

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,63 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class ProgressBarInner
{
/// <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 Component 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.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("Segoe UI", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(4, 4);
this.label3.Margin = new System.Windows.Forms.Padding(0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(803, 47);
this.label3.TabIndex = 144;
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// ProgressBarInner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label3);
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "ProgressBarInner";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(810, 54);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label3;
}
}

View File

@ -0,0 +1,197 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace RyzStudio.Windows.ThemedForms
{
public partial class ProgressBarInner : System.Windows.Forms.UserControl
{
protected int minimum = 0;
protected int maximum = 100;
protected int value = 0;
public ProgressBarInner() : base()
{
InitializeComponent();
this.Padding = new Padding(0);
}
public int Minimum
{
get
{
return minimum;
}
set
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() => {
setMinimum(value);
}));
}
else
{
setMinimum(value);
}
}
}
public int Maximum
{
get
{
return maximum;
}
set
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() => {
setMaximum(value);
}));
}
else
{
setMaximum(value);
}
}
}
public int Value
{
get
{
return value;
}
set
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() => {
setValue(value);
}));
}
else
{
setValue(value);
}
}
}
public Color BarColour { get; set; } = Color.FromArgb(158, 225, 249);
public Color BarTextColour
{
get => label3.ForeColor;
set => label3.ForeColor = value;
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Rectangle canvas = this.DisplayRectangle;
Graphics g = e.Graphics;
if (this.Value > 0)
{
decimal result = decimal.Divide(canvas.Width, this.Maximum) * this.Value;
canvas.Width = (int)Math.Round(result);
g.FillRectangle(new SolidBrush(this.BarColour), canvas);
}
}
protected void updateText()
{
if (label3.InvokeRequired)
{
label3.Invoke(new MethodInvoker(() =>
{
label3.Text = string.Format("{0}/{1}", this.Value.ToString(), this.Maximum.ToString());
}));
}
else
{
label3.Text = string.Format("{0}/{1}", this.Value.ToString(), this.Maximum.ToString());
}
}
protected void setMinimum(int value)
{
int m = value;
if (m < 0)
{
m = 0;
}
if (m > this.Maximum)
{
m = this.Maximum;
}
if (this.Value < m)
{
this.Value = m;
}
if (this.value > this.Maximum)
{
this.value = this.Maximum;
}
minimum = m;
updateText();
this.Invalidate();
}
protected void setMaximum(int value)
{
int m = value;
if (m < 0)
{
m = 0;
}
if (m < this.Minimum)
{
m = this.Minimum;
}
if (this.Value > m)
{
this.Value = m;
}
if (this.value < this.Minimum)
{
this.value = this.Minimum;
}
maximum = m;
updateText();
this.Invalidate();
}
protected void setValue(int value)
{
int m = value;
if (m < this.Minimum)
{
m = this.Minimum;
}
if (m > this.Maximum)
{
m = this.Maximum;
}
this.value = m;
updateText();
this.Invalidate();
}
}
}

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,96 @@
namespace RyzStudio.Windows.ThemedForms
{
using RyzStudio.Drawing;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class TextBox : RyzStudio.Windows.ThemedForms.UserControl
{
protected readonly Padding textboxPadding = new Padding(6, 6, 6, 6);
public TextBox() : base()
{
InitializeComponent();
this.Margin = new Padding(10, 6, 10, 6);
this.Font = new Font(this.Font, FontStyle.Regular);
textBox1.Font = this.Font;
textBox1.PreviewKeyDown += textBox_PreviewKeyDown;
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Height = textBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom);
}
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
textBox1.Focus();
}
protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Enter:
if (this.SubmitButton != null)
{
this.SubmitButton.PerformClick();
}
break;
case Keys.Escape:
tryClose();
break;
default: break;
}
}
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public System.Windows.Forms.TextBox InnerTextBox { get => textBox1; set => textBox1 = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public new string Text
{
get => textBox1.Text;
set
{
textBox1.Text = value;
textBox1.SelectionStart = textBox1.Text.Length;
}
}
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public bool UseSystemPasswordChar { get => textBox1.UseSystemPasswordChar; set => textBox1.UseSystemPasswordChar = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public Button SubmitButton { get; set; } = null;
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } }
protected override void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom));
Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
}
}

View File

@ -0,0 +1,60 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class TextBox
{
/// <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 Component 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.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.HideSelection = false;
this.textBox1.Location = new System.Drawing.Point(4, 4);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(121, 13);
this.textBox1.TabIndex = 0;
//
// TextBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.textBox1);
this.Name = "TextBox";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
}
}

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,127 @@
namespace RyzStudio.Windows.ThemedForms
{
using RyzStudio.Drawing;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class TextButtonBox : RyzStudio.Windows.ThemedForms.UserControl
{
protected readonly Padding textboxPadding = new Padding(6, 6, 6, 6);
public TextButtonBox() : base()
{
InitializeComponent();
//this.Margin = new Padding(10, 6, 10, 6);
this.Margin = new Padding(10, 3, 3, 3);
this.Font = new Font(this.Font, FontStyle.Regular);
textBox1.Font = this.Font;
textBox1.Left = this.Margin.Left;
textBox1.PreviewKeyDown += textBox_PreviewKeyDown;
imageBox1.Click += imageBox1_Click;
OnResize(null);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Height = textBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom);
imageBox1.Width = 18;
imageBox1.Height = textBox1.Height + textboxPadding.Top + textboxPadding.Bottom;
imageBox1.Left = this.Width - (this.Margin.Right + b + imageBox1.Width);
textBox1.Left = this.Margin.Left;
textBox1.Width = imageBox1.Left - textBox1.Left - 3;
textBox1.Top = (int)Math.Ceiling(decimal.Divide((this.Height - textBox1.Height), 2));
}
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
textBox1.Focus();
}
protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Enter:
if (this.SubmitButton != null)
{
this.SubmitButton.PerformClick();
}
break;
case Keys.Escape:
tryClose();
break;
default: break;
}
}
private void imageBox1_Click(object sender, EventArgs e) => OnButtonClick?.Invoke(sender, e);
[Category("Action")]
[Browsable(true)]
public event EventHandler OnButtonClick;
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public Forms.ImageBox InnerImageBox { get => imageBox1; set => imageBox1 = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public System.Windows.Forms.TextBox InnerTextBox { get => textBox1; set => textBox1 = value; }
[Category("Appearance"), Browsable(true)]
public Image NormalImage { get => imageBox1.NormalImage; set => imageBox1.NormalImage = value; }
[Category("Appearance"), Browsable(true)]
public Image HighlightImage { get => imageBox1.HighlightImage; set => imageBox1.HighlightImage = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public new string Text
{
get => textBox1.Text;
set
{
textBox1.Text = value;
textBox1.SelectionStart = textBox1.Text.Length;
}
}
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public bool UseSystemPasswordChar { get => textBox1.UseSystemPasswordChar; set => textBox1.UseSystemPasswordChar = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public Button SubmitButton { get; set; } = null;
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } }
protected override void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom));
Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
}
}

View File

@ -0,0 +1,81 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class TextButtonBox
{
/// <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 Component 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.textBox1 = new System.Windows.Forms.TextBox();
this.imageBox1 = new RyzStudio.Windows.Forms.ImageBox();
((System.ComponentModel.ISupportInitialize)(this.imageBox1)).BeginInit();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.Window;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.HideSelection = false;
this.textBox1.Location = new System.Drawing.Point(7, 7);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(68, 13);
this.textBox1.TabIndex = 0;
//
// imageBox1
//
this.imageBox1.BackColor = System.Drawing.Color.Transparent;
this.imageBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imageBox1.ErrorImage = null;
this.imageBox1.HighlightImage = null;
this.imageBox1.Image = null;
this.imageBox1.InitialImage = null;
this.imageBox1.Location = new System.Drawing.Point(107, 4);
this.imageBox1.Name = "imageBox1";
this.imageBox1.NormalImage = null;
this.imageBox1.Size = new System.Drawing.Size(18, 25);
this.imageBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imageBox1.TabIndex = 1;
this.imageBox1.TabStop = false;
//
// TextBox2
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.imageBox1);
this.Controls.Add(this.textBox1);
this.Name = "TextBox2";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
((System.ComponentModel.ISupportInitialize)(this.imageBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private Forms.ImageBox imageBox1;
}
}

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,34 @@
namespace RyzStudio.Windows.ThemedForms
{
using System.Drawing;
public struct ThemeStyle
{
public int BorderWidth;
public int BorderRadius;
public int BorderPadding;
public Color BorderColour;
public Color BackColour;
public Color ForeColour;
public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour)
{
this.BorderWidth = borderWidth;
this.BorderRadius = borderRadius;
this.BorderPadding = borderPadding;
this.BorderColour = borderColour;
this.BackColour = backColour;
this.ForeColour = Color.Black;
}
public ThemeStyle(int borderWidth, int borderRadius, int borderPadding, Color borderColour, Color backColour, Color foreColour)
{
this.BorderWidth = borderWidth;
this.BorderRadius = borderRadius;
this.BorderPadding = borderPadding;
this.BorderColour = borderColour;
this.BackColour = backColour;
this.ForeColour = foreColour;
}
}
}

View File

@ -0,0 +1,89 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.Drawing;
using System.Windows.Forms;
using RyzStudio.Drawing;
using System.ComponentModel;
public partial class UserControl : System.Windows.Forms.UserControl
{
//protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(112, 112, 112), Color.White);
protected ThemeStyle styleActive = new ThemeStyle(1, 3, 2, Color.FromArgb(212, 212, 212), Color.White);
public UserControl()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.BackColor = Color.Transparent;
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
Graphics g = e.Graphics;
//// g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
//// g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
//// g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
//// g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
updateBackground(g, styleActive);
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
protected virtual void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding(b, b, (b - 1), (b - 1));
Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
protected virtual void tryClose()
{
if (this.Parent == null)
{
return;
}
if (this.Parent is Form)
{
(this.Parent as Form).Close();
return;
}
if (this.Parent.GetType().IsSubclassOf(typeof(System.Windows.Forms.Form)))
{
System.Windows.Forms.Form parentForm = (System.Windows.Forms.Form)this.Parent;
if (parentForm != null)
{
parentForm.Close();
}
}
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
}
}

View File

@ -0,0 +1,37 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class UserControl
{
/// <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 Component 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()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Some files were not shown because too many files have changed in this diff Show More