Initial population
BIN
JRCookbookControls/Bar0.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Bar1.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Bar2.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Bar3.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Bar4.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Delete.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
JRCookbookControls/Handle.bmp
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
JRCookbookControls/Heading.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
73
JRCookbookControls/JRCookbookAutoVerticalGrowTextBox.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
[System.Serializable()]
|
||||
public class JRCookbookAutoVerticalGrowTextBox : TextBox
|
||||
{
|
||||
private int _MinCharactersToMultiLine = 0;
|
||||
|
||||
public JRCookbookAutoVerticalGrowTextBox()
|
||||
{
|
||||
this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
|
||||
|
||||
this.TextChanged += JRCookbookAutoVerticalGrowTextBox_TextChanged;
|
||||
this.MultilineChanged += JRCookbookAutoVerticalGrowTextBox_MultilineChanged;
|
||||
this.Resize += JRCookbookAutoVerticalGrowTextBox_Resize;
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public int MinCharactersToMultiLine
|
||||
{
|
||||
get
|
||||
{
|
||||
return _MinCharactersToMultiLine;
|
||||
}
|
||||
set
|
||||
{
|
||||
_MinCharactersToMultiLine = value;
|
||||
this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void JRCookbookAutoVerticalGrowTextBox_Resize(object sender, EventArgs e)
|
||||
{
|
||||
RecalculateTextBoxHeight();
|
||||
}
|
||||
|
||||
private void JRCookbookAutoVerticalGrowTextBox_TextChanged(System.Object sender, System.EventArgs e)
|
||||
{
|
||||
this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
|
||||
RecalculateTextBoxHeight();
|
||||
}
|
||||
|
||||
private void JRCookbookAutoVerticalGrowTextBox_MultilineChanged(System.Object sender, System.EventArgs e)
|
||||
{
|
||||
//while we can't hide the multiline property, we can at least enforce its value.
|
||||
this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
|
||||
}
|
||||
|
||||
private void RecalculateTextBoxHeight()
|
||||
{
|
||||
// amount of padding to add
|
||||
const int padding = 3;
|
||||
// get number of lines (first line is 0, so add 1)
|
||||
int numLines = this.GetLineFromCharIndex(this.TextLength) + 1;
|
||||
// get border thickness
|
||||
int border = this.Height - this.ClientSize.Height;
|
||||
// set height (height of one line * number of lines + spacing)
|
||||
this.Height = this.Font.Height * numLines + padding + border;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
38
JRCookbookControls/JRCookbookControls.csproj
Normal file
@@ -0,0 +1,38 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows7.0</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>JRCookbookStrongNameKey.snk</AssemblyOriginatorKeyFile>
|
||||
<DelaySign>false</DelaySign>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<Platforms>x86</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JRCookbookBusiness\JRCookbookBusiness.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="JRCookbookEditRecipeIngredient.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="JRCookbookEditTip.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
16
JRCookbookControls/JRCookbookControlsEnums.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
public enum InsertLocation
|
||||
{
|
||||
InsertNone,
|
||||
InsertBefore,
|
||||
InsertAfter
|
||||
}
|
||||
|
||||
}
|
||||
100
JRCookbookControls/JRCookbookEditProcedure.Designer.cs
generated
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
partial class JRCookbookEditProcedure
|
||||
{
|
||||
/// <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();
|
||||
txtProcedureText = new JRCookbookAutoVerticalGrowTextBox();
|
||||
btnHeading = new System.Windows.Forms.Button();
|
||||
btnDelete = new System.Windows.Forms.Button();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
SuspendLayout();
|
||||
//
|
||||
// txtProcedureText
|
||||
//
|
||||
txtProcedureText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
txtProcedureText.Location = new System.Drawing.Point(110, 3);
|
||||
txtProcedureText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
txtProcedureText.MinCharactersToMultiLine = 0;
|
||||
txtProcedureText.Multiline = true;
|
||||
txtProcedureText.Name = "txtProcedureText";
|
||||
txtProcedureText.Size = new System.Drawing.Size(1476, 47);
|
||||
txtProcedureText.TabIndex = 0;
|
||||
txtProcedureText.TextChanged += txtProcedureText_TextChanged;
|
||||
//
|
||||
// btnHeading
|
||||
//
|
||||
btnHeading.ImageKey = "(none)";
|
||||
btnHeading.Location = new System.Drawing.Point(43, 3);
|
||||
btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnHeading.Name = "btnHeading";
|
||||
btnHeading.Size = new System.Drawing.Size(56, 63);
|
||||
btnHeading.TabIndex = 2;
|
||||
toolTip1.SetToolTip(btnHeading, "Toggle Header");
|
||||
btnHeading.UseVisualStyleBackColor = true;
|
||||
btnHeading.Click += btnHeading_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnDelete.ImageKey = "(none)";
|
||||
btnDelete.Location = new System.Drawing.Point(1591, 3);
|
||||
btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new System.Drawing.Size(56, 63);
|
||||
btnDelete.TabIndex = 1;
|
||||
toolTip1.SetToolTip(btnDelete, "Delete");
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Visible = false;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// JRCookbookEditProcedure
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
Controls.Add(txtProcedureText);
|
||||
Controls.Add(btnHeading);
|
||||
Controls.Add(btnDelete);
|
||||
Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
Name = "JRCookbookEditProcedure";
|
||||
Size = new System.Drawing.Size(1647, 134);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private JRCookbookAutoVerticalGrowTextBox txtProcedureText;
|
||||
private System.Windows.Forms.Button btnHeading;
|
||||
private System.Windows.Forms.Button btnDelete;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
}
|
||||
}
|
||||
244
JRCookbookControls/JRCookbookEditProcedure.cs
Normal file
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using JRCookbookBusiness;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
public partial class JRCookbookEditProcedure : UserControl
|
||||
{
|
||||
private RecipeProcedure _recipeProcedure;
|
||||
private bool _DeleteAllowed = true;
|
||||
private bool _IsEmptyValue = true;
|
||||
public event EventHandler DeleteRequested;
|
||||
public event EventHandler IsEmpty_Changed;
|
||||
|
||||
private static ImageList _allButtonImagesList = new ImageList();
|
||||
private static ImageList _allHandleImagesList = new ImageList();
|
||||
private static bool _ImagesAlreadyLoaded = false;
|
||||
|
||||
private static Point _HandleLocationPoint = new Point(0, 0);
|
||||
private static bool _isHandleLocationSet = false;
|
||||
|
||||
private const string HEADING_IMAGE = "Heading.bmp";
|
||||
private const string NOT_HEADING_IMAGE = "NotHeading.bmp";
|
||||
private const string DELETE_IMAGE = "Delete.bmp";
|
||||
private const string HANDLE_IMAGE = "Handle.bmp";
|
||||
|
||||
public JRCookbookEditProcedure()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadImages();
|
||||
}
|
||||
|
||||
public JRCookbookEditProcedure(RecipeProcedure procedureToEdit)
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadImages();
|
||||
recipeProcedure = procedureToEdit;
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public RecipeProcedure recipeProcedure
|
||||
{
|
||||
get
|
||||
{
|
||||
return _recipeProcedure;
|
||||
}
|
||||
set
|
||||
{
|
||||
_recipeProcedure = value;
|
||||
LoadControlFromObject();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsEmptyValue;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool DeleteAllowed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _DeleteAllowed;
|
||||
}
|
||||
set
|
||||
{
|
||||
_DeleteAllowed = value;
|
||||
btnDelete.Enabled = _DeleteAllowed;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.DeleteRequested != null)
|
||||
this.DeleteRequested(this, new EventArgs());
|
||||
}
|
||||
|
||||
private void LoadControlFromObject()
|
||||
{
|
||||
if (_recipeProcedure == null)
|
||||
{
|
||||
txtProcedureText.Text = string.Empty;
|
||||
txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Regular);
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtProcedureText.Text = _recipeProcedure.procedureText;
|
||||
if (_recipeProcedure.isHeading)
|
||||
{
|
||||
txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Bold);
|
||||
btnHeading.ImageKey = HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Regular);
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnHeading_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_recipeProcedure != null)
|
||||
{
|
||||
_recipeProcedure.isHeading = !_recipeProcedure.isHeading;
|
||||
}
|
||||
LoadControlFromObject();
|
||||
}
|
||||
|
||||
private void txtProcedureText_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_recipeProcedure.procedureText = txtProcedureText.Text;
|
||||
CheckForData();
|
||||
}
|
||||
|
||||
private void CheckForData()
|
||||
{
|
||||
var blnNewIsEmpty = true;
|
||||
|
||||
if (txtProcedureText.Text.Trim() != String.Empty)
|
||||
{
|
||||
blnNewIsEmpty = false;
|
||||
}
|
||||
|
||||
if (_recipeProcedure.isHeading)
|
||||
{
|
||||
btnHeading.ImageKey = HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
|
||||
if (blnNewIsEmpty != _IsEmptyValue)
|
||||
{
|
||||
_IsEmptyValue = blnNewIsEmpty;
|
||||
|
||||
if (blnNewIsEmpty)
|
||||
{
|
||||
btnDelete.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnDelete.Visible = true;
|
||||
}
|
||||
|
||||
if (this.IsEmpty_Changed != null)
|
||||
this.IsEmpty_Changed(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowInsertionBar(JRCookbookControls.InsertLocation insertLocation)
|
||||
{
|
||||
modSharedRoutines.ShowInsertionBar(this, insertLocation);
|
||||
}
|
||||
|
||||
public void HideInsertionBar()
|
||||
{
|
||||
modSharedRoutines.HideInsertionBar(this);
|
||||
}
|
||||
|
||||
public void DragStarted()
|
||||
{
|
||||
modSharedRoutines.DragStarted(this);
|
||||
}
|
||||
|
||||
public void DragEnded()
|
||||
{
|
||||
modSharedRoutines.DragEnded(this);
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
// If there is an image and it has a location,
|
||||
// paint it when the Form is repainted.
|
||||
base.OnPaint(e);
|
||||
|
||||
Image myBackgroundImage = _allHandleImagesList.Images[HANDLE_IMAGE];
|
||||
|
||||
if (!_isHandleLocationSet)
|
||||
{
|
||||
_isHandleLocationSet = true;
|
||||
|
||||
int verticalMidpointImage = myBackgroundImage.Height / 2;
|
||||
int verticalMidpointButton = btnHeading.Height / 2;
|
||||
int newTop = verticalMidpointButton - verticalMidpointImage + btnHeading.Top;
|
||||
|
||||
_HandleLocationPoint = new Point(0, newTop);
|
||||
}
|
||||
|
||||
|
||||
e.Graphics.DrawImage(myBackgroundImage, _HandleLocationPoint.X, _HandleLocationPoint.Y, new Rectangle(0, 0, myBackgroundImage.Width, myBackgroundImage.Height), GraphicsUnit.Pixel);
|
||||
|
||||
}
|
||||
|
||||
private void LoadImages()
|
||||
{
|
||||
if (!_ImagesAlreadyLoaded)
|
||||
{
|
||||
_allButtonImagesList = new ImageList();
|
||||
_allButtonImagesList.ImageSize = btnDelete.ClientSize;
|
||||
_allButtonImagesList.Images.Clear();
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.Delete);
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.Heading);
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.NotHeading);
|
||||
_allButtonImagesList.Images.SetKeyName(0, DELETE_IMAGE);
|
||||
_allButtonImagesList.Images.SetKeyName(1, HEADING_IMAGE);
|
||||
_allButtonImagesList.Images.SetKeyName(2, NOT_HEADING_IMAGE);
|
||||
|
||||
_allHandleImagesList = new ImageList();
|
||||
|
||||
double handleWidthToHeightRatio = (double)(Properties.Resources.Handle.Width) / (double)(Properties.Resources.Handle.Height);
|
||||
int handleWidth = (int)((double)(btnHeading.Left) * 0.75);
|
||||
int handleHeight = (int)((double)(handleWidth) / handleWidthToHeightRatio);
|
||||
_allHandleImagesList.ImageSize = new Size(handleWidth, handleHeight);
|
||||
_allHandleImagesList.Images.Clear();
|
||||
_allHandleImagesList.Images.Add(Properties.Resources.Handle);
|
||||
_allHandleImagesList.Images.SetKeyName(0, HANDLE_IMAGE);
|
||||
|
||||
_ImagesAlreadyLoaded = true;
|
||||
}
|
||||
|
||||
this.btnDelete.ImageList = _allButtonImagesList;
|
||||
this.btnDelete.ImageKey = DELETE_IMAGE;
|
||||
this.btnHeading.ImageList = _allButtonImagesList;
|
||||
this.btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
123
JRCookbookControls/JRCookbookEditProcedure.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>118, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
151
JRCookbookControls/JRCookbookEditRecipeIngredient.Designer.cs
generated
Normal file
@@ -0,0 +1,151 @@
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
partial class JRCookbookEditRecipeIngredient
|
||||
{
|
||||
/// <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();
|
||||
txtIngredientText = new JRCookbookAutoVerticalGrowTextBox();
|
||||
btnHeading = new System.Windows.Forms.Button();
|
||||
btnDelete = new System.Windows.Forms.Button();
|
||||
btnIngredientLink = new System.Windows.Forms.Button();
|
||||
txtUnitText = new JRCookbookAutoVerticalGrowTextBox();
|
||||
txtQuantityText = new JRCookbookAutoVerticalGrowTextBox();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
SuspendLayout();
|
||||
//
|
||||
// txtIngredientText
|
||||
//
|
||||
txtIngredientText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
txtIngredientText.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
|
||||
txtIngredientText.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
|
||||
txtIngredientText.Location = new System.Drawing.Point(487, 8);
|
||||
txtIngredientText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
txtIngredientText.MinCharactersToMultiLine = 60;
|
||||
txtIngredientText.Name = "txtIngredientText";
|
||||
txtIngredientText.PlaceholderText = "Ingredient";
|
||||
txtIngredientText.Size = new System.Drawing.Size(1025, 47);
|
||||
txtIngredientText.TabIndex = 2;
|
||||
txtIngredientText.TextChanged += txtIngredientText_TextChanged;
|
||||
//
|
||||
// btnHeading
|
||||
//
|
||||
btnHeading.ImageKey = "(none)";
|
||||
btnHeading.Location = new System.Drawing.Point(43, 0);
|
||||
btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnHeading.Name = "btnHeading";
|
||||
btnHeading.Size = new System.Drawing.Size(56, 63);
|
||||
btnHeading.TabIndex = 5;
|
||||
toolTip1.SetToolTip(btnHeading, "Toggle Header");
|
||||
btnHeading.UseVisualStyleBackColor = true;
|
||||
btnHeading.Click += btnHeading_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnDelete.ImageKey = "(none)";
|
||||
btnDelete.Location = new System.Drawing.Point(1593, 3);
|
||||
btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new System.Drawing.Size(56, 63);
|
||||
btnDelete.TabIndex = 4;
|
||||
toolTip1.SetToolTip(btnDelete, "Delete");
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Visible = false;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnIngredientLink
|
||||
//
|
||||
btnIngredientLink.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnIngredientLink.ImageKey = "(none)";
|
||||
btnIngredientLink.Location = new System.Drawing.Point(1535, 3);
|
||||
btnIngredientLink.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnIngredientLink.Name = "btnIngredientLink";
|
||||
btnIngredientLink.Size = new System.Drawing.Size(56, 63);
|
||||
btnIngredientLink.TabIndex = 3;
|
||||
toolTip1.SetToolTip(btnIngredientLink, "Link Ingredient");
|
||||
btnIngredientLink.UseVisualStyleBackColor = true;
|
||||
btnIngredientLink.Visible = false;
|
||||
btnIngredientLink.Click += btnIngredientLink_Click;
|
||||
//
|
||||
// txtUnitText
|
||||
//
|
||||
txtUnitText.AutoCompleteCustomSource.AddRange(new string[] { "10 oz", "11-oz", "15-oz", "8-ounce", "8-oz", "can", "can (11 oz)", "can (15 oz)", "can (6 oz)", "cans", "cup", "cups", "dash", "dashes", "gallon", "gallons", "lb", "lbs", "ounces", "oz", "pinch", "pinches", "pint", "pints", "quart", "quarts", "recipe", "slices", "small", "Tbs", "Tbsp", "teaspoon", "tsp" });
|
||||
txtUnitText.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
|
||||
txtUnitText.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
|
||||
txtUnitText.Location = new System.Drawing.Point(278, 8);
|
||||
txtUnitText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
txtUnitText.MinCharactersToMultiLine = 8;
|
||||
txtUnitText.Name = "txtUnitText";
|
||||
txtUnitText.PlaceholderText = "Unit";
|
||||
txtUnitText.Size = new System.Drawing.Size(198, 47);
|
||||
txtUnitText.TabIndex = 1;
|
||||
txtUnitText.TextChanged += txtUnitText_TextChanged;
|
||||
//
|
||||
// txtQuantityText
|
||||
//
|
||||
txtQuantityText.Location = new System.Drawing.Point(116, 8);
|
||||
txtQuantityText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
txtQuantityText.MinCharactersToMultiLine = 0;
|
||||
txtQuantityText.Multiline = true;
|
||||
txtQuantityText.Name = "txtQuantityText";
|
||||
txtQuantityText.PlaceholderText = "Qty";
|
||||
txtQuantityText.Size = new System.Drawing.Size(150, 47);
|
||||
txtQuantityText.TabIndex = 0;
|
||||
txtQuantityText.TextChanged += txtQuantityText_TextChanged;
|
||||
//
|
||||
// JRCookbookEditRecipeIngredient
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
Controls.Add(btnDelete);
|
||||
Controls.Add(btnHeading);
|
||||
Controls.Add(btnIngredientLink);
|
||||
Controls.Add(txtIngredientText);
|
||||
Controls.Add(txtUnitText);
|
||||
Controls.Add(txtQuantityText);
|
||||
Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
Name = "JRCookbookEditRecipeIngredient";
|
||||
Size = new System.Drawing.Size(1647, 134);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private JRCookbookAutoVerticalGrowTextBox txtIngredientText;
|
||||
private System.Windows.Forms.Button btnHeading;
|
||||
private System.Windows.Forms.Button btnDelete;
|
||||
private System.Windows.Forms.Button btnIngredientLink;
|
||||
private JRCookbookControls.JRCookbookAutoVerticalGrowTextBox txtUnitText;
|
||||
private JRCookbookAutoVerticalGrowTextBox txtQuantityText;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
}
|
||||
}
|
||||
2698
JRCookbookControls/JRCookbookEditRecipeIngredient.cs
Normal file
126
JRCookbookControls/JRCookbookEditRecipeIngredient.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>118, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>118, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
100
JRCookbookControls/JRCookbookEditTip.Designer.cs
generated
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
partial class JRCookbookEditTip
|
||||
{
|
||||
/// <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();
|
||||
txtTipText = new JRCookbookAutoVerticalGrowTextBox();
|
||||
btnHeading = new System.Windows.Forms.Button();
|
||||
btnDelete = new System.Windows.Forms.Button();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
SuspendLayout();
|
||||
//
|
||||
// txtTipText
|
||||
//
|
||||
txtTipText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
txtTipText.Location = new System.Drawing.Point(112, 3);
|
||||
txtTipText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
txtTipText.MinCharactersToMultiLine = 0;
|
||||
txtTipText.Multiline = true;
|
||||
txtTipText.Name = "txtTipText";
|
||||
txtTipText.Size = new System.Drawing.Size(1461, 47);
|
||||
txtTipText.TabIndex = 0;
|
||||
txtTipText.TextChanged += txtTipText_TextChanged;
|
||||
//
|
||||
// btnHeading
|
||||
//
|
||||
btnHeading.ImageKey = "(none)";
|
||||
btnHeading.Location = new System.Drawing.Point(43, 3);
|
||||
btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnHeading.Name = "btnHeading";
|
||||
btnHeading.Size = new System.Drawing.Size(56, 63);
|
||||
btnHeading.TabIndex = 2;
|
||||
toolTip1.SetToolTip(btnHeading, "Toggle Header");
|
||||
btnHeading.UseVisualStyleBackColor = true;
|
||||
btnHeading.Click += btnHeading_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnDelete.ImageKey = "(none)";
|
||||
btnDelete.Location = new System.Drawing.Point(1591, 3);
|
||||
btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new System.Drawing.Size(56, 63);
|
||||
btnDelete.TabIndex = 1;
|
||||
toolTip1.SetToolTip(btnDelete, "Delete");
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Visible = false;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// JRCookbookEditTip
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
Controls.Add(txtTipText);
|
||||
Controls.Add(btnHeading);
|
||||
Controls.Add(btnDelete);
|
||||
Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
|
||||
Name = "JRCookbookEditTip";
|
||||
Size = new System.Drawing.Size(1647, 134);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private JRCookbookAutoVerticalGrowTextBox txtTipText;
|
||||
private System.Windows.Forms.Button btnHeading;
|
||||
private System.Windows.Forms.Button btnDelete;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
}
|
||||
}
|
||||
247
JRCookbookControls/JRCookbookEditTip.cs
Normal file
@@ -0,0 +1,247 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using JRCookbookBusiness;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
public partial class JRCookbookEditTip : UserControl
|
||||
{
|
||||
private RecipeTip _recipeTip;
|
||||
private bool _DeleteAllowed = true;
|
||||
private bool _IsEmptyValue = true;
|
||||
public event EventHandler DeleteRequested;
|
||||
public event EventHandler IsEmpty_Changed;
|
||||
|
||||
private static ImageList _allButtonImagesList = new ImageList();
|
||||
private static ImageList _allHandleImagesList = new ImageList();
|
||||
private static bool _ImagesAlreadyLoaded = false;
|
||||
|
||||
private static Point _HandleLocationPoint = new Point(0, 0);
|
||||
private static bool _isHandleLocationSet = false;
|
||||
|
||||
private const string HEADING_IMAGE = "Heading.bmp";
|
||||
private const string NOT_HEADING_IMAGE = "NotHeading.bmp";
|
||||
private const string DELETE_IMAGE = "Delete.bmp";
|
||||
private const string HANDLE_IMAGE = "Handle.bmp";
|
||||
|
||||
public JRCookbookEditTip()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadImages();
|
||||
}
|
||||
|
||||
public JRCookbookEditTip(RecipeTip TipToEdit)
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadImages();
|
||||
recipeTip = TipToEdit;
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public RecipeTip recipeTip
|
||||
{
|
||||
get
|
||||
{
|
||||
return _recipeTip;
|
||||
}
|
||||
set
|
||||
{
|
||||
_recipeTip = value;
|
||||
LoadControlFromObject();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsEmptyValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool DeleteAllowed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _DeleteAllowed;
|
||||
}
|
||||
set
|
||||
{
|
||||
_DeleteAllowed = value;
|
||||
btnDelete.Enabled = _DeleteAllowed;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.DeleteRequested != null)
|
||||
this.DeleteRequested(this, new EventArgs());
|
||||
}
|
||||
|
||||
private void LoadControlFromObject()
|
||||
{
|
||||
if (_recipeTip == null)
|
||||
{
|
||||
txtTipText.Text = string.Empty;
|
||||
txtTipText.Font = new Font(txtTipText.Font, FontStyle.Regular);
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtTipText.Text = _recipeTip.tipText;
|
||||
if (_recipeTip.isHeading)
|
||||
{
|
||||
txtTipText.Font = new Font(txtTipText.Font, FontStyle.Bold);
|
||||
btnHeading.ImageKey = HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtTipText.Font = new Font(txtTipText.Font, FontStyle.Regular);
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnHeading_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(_recipeTip != null)
|
||||
{
|
||||
_recipeTip.isHeading = !_recipeTip.isHeading;
|
||||
}
|
||||
LoadControlFromObject();
|
||||
}
|
||||
|
||||
private void txtTipText_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_recipeTip.tipText = txtTipText.Text;
|
||||
CheckForData();
|
||||
}
|
||||
|
||||
private void CheckForData()
|
||||
{
|
||||
var blnNewIsEmpty = true;
|
||||
|
||||
if (txtTipText.Text.Trim() != String.Empty)
|
||||
{
|
||||
blnNewIsEmpty = false;
|
||||
}
|
||||
|
||||
if (_recipeTip.isHeading)
|
||||
{
|
||||
btnHeading.ImageKey = HEADING_IMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
}
|
||||
|
||||
|
||||
if (blnNewIsEmpty != _IsEmptyValue)
|
||||
{
|
||||
_IsEmptyValue = blnNewIsEmpty;
|
||||
|
||||
if (blnNewIsEmpty)
|
||||
{
|
||||
btnDelete.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnDelete.Visible = true;
|
||||
}
|
||||
|
||||
if (this.IsEmpty_Changed != null)
|
||||
this.IsEmpty_Changed(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ShowInsertionBar(JRCookbookControls.InsertLocation insertLocation)
|
||||
{
|
||||
modSharedRoutines.ShowInsertionBar(this, insertLocation);
|
||||
}
|
||||
|
||||
public void HideInsertionBar()
|
||||
{
|
||||
modSharedRoutines.HideInsertionBar(this);
|
||||
}
|
||||
|
||||
public void DragStarted()
|
||||
{
|
||||
modSharedRoutines.DragStarted(this);
|
||||
}
|
||||
|
||||
public void DragEnded()
|
||||
{
|
||||
modSharedRoutines.DragEnded(this);
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
// If there is an image and it has a location,
|
||||
// paint it when the Form is repainted.
|
||||
base.OnPaint(e);
|
||||
|
||||
Image myBackgroundImage = _allHandleImagesList.Images[HANDLE_IMAGE];
|
||||
|
||||
if (!_isHandleLocationSet)
|
||||
{
|
||||
_isHandleLocationSet = true;
|
||||
|
||||
int verticalMidpointImage = myBackgroundImage.Height / 2;
|
||||
int verticalMidpointButton = btnHeading.Height / 2;
|
||||
int newTop = verticalMidpointButton - verticalMidpointImage + btnHeading.Top;
|
||||
|
||||
_HandleLocationPoint = new Point(0, newTop);
|
||||
}
|
||||
|
||||
|
||||
e.Graphics.DrawImage(myBackgroundImage, _HandleLocationPoint.X, _HandleLocationPoint.Y, new Rectangle(0, 0, myBackgroundImage.Width, myBackgroundImage.Height), GraphicsUnit.Pixel);
|
||||
|
||||
}
|
||||
|
||||
private void LoadImages()
|
||||
{
|
||||
if (!_ImagesAlreadyLoaded)
|
||||
{
|
||||
_allButtonImagesList = new ImageList();
|
||||
_allButtonImagesList.ImageSize = btnDelete.ClientSize;
|
||||
_allButtonImagesList.Images.Clear();
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.Delete);
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.Heading);
|
||||
_allButtonImagesList.Images.Add(Properties.Resources.NotHeading);
|
||||
_allButtonImagesList.Images.SetKeyName(0, DELETE_IMAGE);
|
||||
_allButtonImagesList.Images.SetKeyName(1, HEADING_IMAGE);
|
||||
_allButtonImagesList.Images.SetKeyName(2, NOT_HEADING_IMAGE);
|
||||
|
||||
_allHandleImagesList = new ImageList();
|
||||
|
||||
double handleWidthToHeightRatio = (double)(Properties.Resources.Handle.Width) / (double)(Properties.Resources.Handle.Height);
|
||||
int handleWidth = (int)((double)(btnHeading.Left) * 0.75);
|
||||
int handleHeight = (int)((double)(handleWidth) / handleWidthToHeightRatio);
|
||||
_allHandleImagesList.ImageSize = new Size(handleWidth, handleHeight);
|
||||
_allHandleImagesList.Images.Clear();
|
||||
_allHandleImagesList.Images.Add(Properties.Resources.Handle);
|
||||
_allHandleImagesList.Images.SetKeyName(0, HANDLE_IMAGE);
|
||||
|
||||
_ImagesAlreadyLoaded = true;
|
||||
}
|
||||
|
||||
this.btnDelete.ImageList = _allButtonImagesList;
|
||||
this.btnDelete.ImageKey = DELETE_IMAGE;
|
||||
this.btnHeading.ImageList = _allButtonImagesList;
|
||||
this.btnHeading.ImageKey = NOT_HEADING_IMAGE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
123
JRCookbookControls/JRCookbookEditTip.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>118, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
60
JRCookbookControls/JRCookbookMaskedTextBox.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
public class JRCookbookMaskedTextBox: System.Windows.Forms.MaskedTextBox
|
||||
{
|
||||
private bool _blnMaskFullOnEnter = false;
|
||||
private bool _blnAutoTab = false;
|
||||
|
||||
public JRCookbookMaskedTextBox()
|
||||
{
|
||||
this.Enter += new System.EventHandler(this.MaskedTextBox_Enter);
|
||||
this.TextChanged += new System.EventHandler(this.MaskedTextBox_TextChanged);
|
||||
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool AutoTab
|
||||
{
|
||||
get
|
||||
{
|
||||
return _blnAutoTab;
|
||||
}
|
||||
set
|
||||
{
|
||||
_blnAutoTab = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void MaskedTextBox_Enter(System.Object sender, System.EventArgs eventArgs)
|
||||
{
|
||||
_blnMaskFullOnEnter = this.MaskFull;
|
||||
}
|
||||
|
||||
private void MaskedTextBox_TextChanged(System.Object sender, System.EventArgs eventArgs)
|
||||
{
|
||||
//Auto-tab if the mask is full
|
||||
if (AutoTab)
|
||||
{
|
||||
if (_blnMaskFullOnEnter == false)
|
||||
{
|
||||
if (this.Focused)
|
||||
{
|
||||
if (this.MaskFull)
|
||||
{
|
||||
this.Parent.SelectNextControl(this, true, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
158
JRCookbookControls/JRCookbookNumericTextBox.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
[System.Serializable()]
|
||||
public class JRCookbookNumericTextBox: TextBox
|
||||
{
|
||||
private String _strLastValue = String.Empty;
|
||||
private bool _blnAllowNegative = true;
|
||||
private bool _blnAllowDecimal = true;
|
||||
private bool _blnAllowEmpty = true;
|
||||
|
||||
public JRCookbookNumericTextBox()
|
||||
{
|
||||
this.TextChanged += new System.EventHandler(this.NumericTextBox_TextChanged);
|
||||
this.Validating += new System.ComponentModel.CancelEventHandler(this.NumericTextBox_Validating);
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool AllowDecimal
|
||||
{
|
||||
get
|
||||
{
|
||||
return _blnAllowDecimal;
|
||||
}
|
||||
set
|
||||
{
|
||||
_blnAllowDecimal = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool AllowNegative
|
||||
{
|
||||
get
|
||||
{
|
||||
return _blnAllowNegative;
|
||||
}
|
||||
set
|
||||
{
|
||||
_blnAllowNegative = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public bool AllowEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return _blnAllowEmpty;
|
||||
}
|
||||
set
|
||||
{
|
||||
_blnAllowEmpty = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void NumericTextBox_TextChanged(System.Object sender, System.EventArgs e)
|
||||
{
|
||||
bool blnValueIsOK = true;
|
||||
Int32 intPosition = 0;
|
||||
bool blnAlreadySeenDecimal = false;
|
||||
|
||||
//Allow digits, one decimal point, and minus sign (if first character only)
|
||||
foreach (char chrCharacter in this.Text)
|
||||
{
|
||||
switch (chrCharacter)
|
||||
{
|
||||
case char x when (x >= '0' && x <= '9'):
|
||||
//OK
|
||||
break;
|
||||
case '-':
|
||||
if (intPosition > 0 || AllowNegative == false)
|
||||
{
|
||||
blnValueIsOK = false;
|
||||
}
|
||||
break;
|
||||
case '.':
|
||||
if (blnAlreadySeenDecimal)
|
||||
{
|
||||
blnValueIsOK = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
blnAlreadySeenDecimal = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
blnValueIsOK = false;
|
||||
break;
|
||||
}
|
||||
|
||||
intPosition += 1;
|
||||
|
||||
if (!blnValueIsOK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (blnValueIsOK)
|
||||
{
|
||||
_strLastValue = this.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
Int32 oldSelectionStart = this.SelectionStart - 1;
|
||||
this.Text = _strLastValue;
|
||||
if (oldSelectionStart >= 0 && oldSelectionStart <= this.Text.Length)
|
||||
{
|
||||
this.SelectionStart = oldSelectionStart;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void NumericTextBox_Validating(System.Object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if (this.Text == String.Empty)
|
||||
{
|
||||
if (AllowEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Now that we know it's not empty, make sure we have a digit
|
||||
foreach (char chrCharacter in this.Text)
|
||||
{
|
||||
switch (chrCharacter)
|
||||
{
|
||||
case char x when (x >= '0' && x <= '9'):
|
||||
//OK
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//If we got here, we have hyphen or period, but no digits
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
BIN
JRCookbookControls/JRCookbookStrongNameKey.snk
Normal file
BIN
JRCookbookControls/NotHeading.bmp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
153
JRCookbookControls/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,153 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace JRCookbookControls.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JRCookbookControls.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Bar0 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Bar0", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Bar1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Bar1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Bar2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Bar2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Bar3 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Bar3", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Bar4 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Bar4", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Delete {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Delete", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Handle {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Handle", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Heading {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Heading", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap NotHeading {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("NotHeading", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
148
JRCookbookControls/Properties/Resources.resx
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Bar0" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Bar0.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Bar1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Bar1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Bar2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Bar2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Bar3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Bar3.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Bar4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Bar4.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Delete.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Handle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Handle.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Heading" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Heading.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="NotHeading" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\NotHeading.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
JRCookbookControls/Search.BMP
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
56
JRCookbookControls/modSharedRoutines.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JRCookbookControls
|
||||
{
|
||||
|
||||
internal static class modSharedRoutines
|
||||
{
|
||||
internal static void ShowInsertionBar(Control control, JRCookbookControls.InsertLocation insertLocation)
|
||||
{
|
||||
if (insertLocation == InsertLocation.InsertBefore)
|
||||
{
|
||||
DrawLine(control, 0, 0, control.Width - 1, 0, System.Drawing.SystemColors.MenuHighlight);
|
||||
}
|
||||
else if (insertLocation == InsertLocation.InsertAfter)
|
||||
{
|
||||
DrawLine(control, 0, control.Height - 1, control.Width - 1, control.Height - 1, System.Drawing.SystemColors.MenuHighlight);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void HideInsertionBar(Control control)
|
||||
{
|
||||
DrawLine(control, 0, 0, control.Width - 1, 0, System.Drawing.SystemColors.Control);
|
||||
DrawLine(control, 0, control.Height - 1, control.Width - 1, control.Height - 1, System.Drawing.SystemColors.Control);
|
||||
}
|
||||
|
||||
internal static void DragStarted(Control control)
|
||||
{
|
||||
control.BackColor = System.Drawing.SystemColors.MenuHighlight;
|
||||
}
|
||||
|
||||
internal static void DragEnded(Control control)
|
||||
{
|
||||
control.BackColor = System.Drawing.SystemColors.Control;
|
||||
}
|
||||
|
||||
private static void DrawLine(Control control, int x1, int y1, int x2, int y2, Color color)
|
||||
{
|
||||
System.Drawing.Pen myPen;
|
||||
myPen = new System.Drawing.Pen(color, 1);
|
||||
System.Drawing.Graphics line = control.CreateGraphics();
|
||||
line.DrawLine(myPen, x1, y1, x2, y2);
|
||||
|
||||
//control.Refresh();
|
||||
|
||||
myPen.Dispose();
|
||||
line.Dispose();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||