TODO feature: Context menu in symbol navigator

This commit is contained in:
Anton Mukhin
2025-05-22 10:30:36 +03:00
parent 8c08c9a897
commit ce21792088
8 changed files with 304 additions and 125 deletions

View File

@@ -24,103 +24,128 @@
/// </summary>
private void InitializeComponent() {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
this.lblVersion = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
lblVersion = new System.Windows.Forms.Label();
label1 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label();
pictureBox1 = new System.Windows.Forms.PictureBox();
linkLabel1 = new System.Windows.Forms.LinkLabel();
button1 = new System.Windows.Forms.Button();
linkLabel2 = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout();
//
// lblVersion
//
this.lblVersion.AutoSize = true;
this.lblVersion.Location = new System.Drawing.Point(12, 189);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(63, 13);
this.lblVersion.TabIndex = 0;
this.lblVersion.Text = "Version: 1.1";
lblVersion.AutoSize = true;
lblVersion.Location = new System.Drawing.Point(14, 218);
lblVersion.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
lblVersion.Name = "lblVersion";
lblVersion.Size = new System.Drawing.Size(66, 15);
lblVersion.TabIndex = 0;
lblVersion.Text = "Version: 0.0";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label1.Location = new System.Drawing.Point(0, 80);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(384, 35);
this.label1.TabIndex = 1;
this.label1.Text = "McBitFont";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
label1.Location = new System.Drawing.Point(0, 77);
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(448, 36);
label1.TabIndex = 1;
label1.Text = "McBitFont";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label2.Location = new System.Drawing.Point(0, 115);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(384, 25);
this.label2.TabIndex = 2;
this.label2.Text = "McFLY\'s Bit Font and Image Editor";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
label2.Location = new System.Drawing.Point(0, 111);
label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(448, 29);
label2.TabIndex = 2;
label2.Text = "McFLY's Bit Font and Image Editor";
label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.pictureBox1.Image = global::McBitFont.Properties.Resources.icon_64;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(384, 75);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
pictureBox1.Image = Properties.Resources.icon_64;
pictureBox1.Location = new System.Drawing.Point(0, 0);
pictureBox1.Margin = new System.Windows.Forms.Padding(4, 12, 4, 3);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(448, 74);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
pictureBox1.TabIndex = 3;
pictureBox1.TabStop = false;
//
// linkLabel1
//
this.linkLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkLabel1.Location = new System.Drawing.Point(0, 140);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(384, 23);
this.linkLabel1.TabIndex = 4;
this.linkLabel1.Text = "mcfly@mcflyer.ru";
this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
linkLabel1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
linkLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 204);
linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
linkLabel1.Location = new System.Drawing.Point(0, 140);
linkLabel1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
linkLabel1.Name = "linkLabel1";
linkLabel1.Size = new System.Drawing.Size(448, 24);
linkLabel1.TabIndex = 4;
linkLabel1.TabStop = true;
linkLabel1.Text = "mcfly@mcflyer.ru";
linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
linkLabel1.LinkClicked += linkLabel1_LinkClicked;
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.button1.Location = new System.Drawing.Point(146, 175);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(89, 27);
this.button1.TabIndex = 5;
this.button1.Text = "OK";
this.button1.UseVisualStyleBackColor = true;
button1.DialogResult = System.Windows.Forms.DialogResult.OK;
button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
button1.Location = new System.Drawing.Point(170, 202);
button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
button1.Name = "button1";
button1.Size = new System.Drawing.Size(104, 31);
button1.TabIndex = 5;
button1.Text = "OK";
button1.UseVisualStyleBackColor = true;
//
// linkLabel2
//
linkLabel2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
linkLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 204);
linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
linkLabel2.Location = new System.Drawing.Point(0, 164);
linkLabel2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
linkLabel2.Name = "linkLabel2";
linkLabel2.Size = new System.Drawing.Size(448, 24);
linkLabel2.TabIndex = 6;
linkLabel2.TabStop = true;
linkLabel2.Text = "https://gitea.mcflyer.ru/McFLY/McBitFont";
linkLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// About
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 211);
this.Controls.Add(this.button1);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblVersion);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "About";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "About";
this.Load += new System.EventHandler(this.About_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
AcceptButton = button1;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(448, 243);
Controls.Add(linkLabel2);
Controls.Add(button1);
Controls.Add(linkLabel1);
Controls.Add(pictureBox1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(lblVersion);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MaximizeBox = false;
MinimizeBox = false;
Name = "About";
ShowInTaskbar = false;
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
Text = "About";
Load += About_Load;
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false);
PerformLayout();
}
@@ -132,5 +157,6 @@
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.LinkLabel linkLabel2;
}
}

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
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
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>
@@ -26,36 +26,36 @@
<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
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
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
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
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
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
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
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->

View File

@@ -23,6 +23,7 @@
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
components = new System.ComponentModel.Container();
rbShiftLeft = new System.Windows.Forms.RadioButton();
rbShiftRight = new System.Windows.Forms.RadioButton();
rbSpecify = new System.Windows.Forms.RadioButton();
@@ -32,6 +33,7 @@
btnCancel = new System.Windows.Forms.Button();
lblMessage = new System.Windows.Forms.Label();
lblRange = new System.Windows.Forms.Label();
toolTip1 = new System.Windows.Forms.ToolTip(components);
((System.ComponentModel.ISupportInitialize)nudValue).BeginInit();
SuspendLayout();
//
@@ -43,6 +45,7 @@
rbShiftLeft.Size = new System.Drawing.Size(134, 19);
rbShiftLeft.TabIndex = 0;
rbShiftLeft.Text = "Shift Left (towards 0)";
toolTip1.SetToolTip(rbShiftLeft, "Shift all symbols left on the code sequence decreasing codes");
rbShiftLeft.UseVisualStyleBackColor = true;
rbShiftLeft.CheckedChanged += ModeChanged;
//
@@ -54,6 +57,7 @@
rbShiftRight.Size = new System.Drawing.Size(154, 19);
rbShiftRight.TabIndex = 1;
rbShiftRight.Text = "Shift Right (towards 255)";
toolTip1.SetToolTip(rbShiftRight, "Shift all symbols right on the code sequence increasing codes");
rbShiftRight.UseVisualStyleBackColor = true;
rbShiftRight.CheckedChanged += ModeChanged;
//
@@ -65,6 +69,7 @@
rbSpecify.Size = new System.Drawing.Size(118, 19);
rbSpecify.TabIndex = 2;
rbSpecify.Text = "Specify start code";
toolTip1.SetToolTip(rbSpecify, "Specify the code for the first symbol in sequence");
rbSpecify.UseVisualStyleBackColor = true;
rbSpecify.CheckedChanged += ModeChanged;
//
@@ -131,6 +136,12 @@
lblRange.TabIndex = 9;
lblRange.Text = "min: 222\r\nmax: 222";
//
// toolTip1
//
toolTip1.AutoPopDelay = 10000;
toolTip1.InitialDelay = 500;
toolTip1.ReshowDelay = 100;
//
// CodeShift
//
AcceptButton = btnOK;
@@ -171,5 +182,6 @@
public System.Windows.Forms.NumericUpDown nudValue;
private System.Windows.Forms.Label lblMessage;
private System.Windows.Forms.Label lblRange;
private System.Windows.Forms.ToolTip toolTip1;
}
}

View File

@@ -117,4 +117,7 @@
<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>17, 17</value>
</metadata>
</root>

View File

@@ -44,6 +44,14 @@
btnShiftLeft = new System.Windows.Forms.Button();
btnExport = new System.Windows.Forms.Button();
miniList = new System.Windows.Forms.ListView();
cmMinilist = new System.Windows.Forms.ContextMenuStrip(components);
tsmiMakeVarWidth = new System.Windows.Forms.ToolStripMenuItem();
tsmiPrepensSymbol = new System.Windows.Forms.ToolStripMenuItem();
tsmiAppendSymbol = new System.Windows.Forms.ToolStripMenuItem();
tsmiRemoveSymbol = new System.Windows.Forms.ToolStripMenuItem();
tsmiRemoveBefore = new System.Windows.Forms.ToolStripMenuItem();
tsmiRemoveAfter = new System.Windows.Forms.ToolStripMenuItem();
tsmiCodeShift = new System.Windows.Forms.ToolStripMenuItem();
ilMiniatures = new System.Windows.Forms.ImageList(components);
btnApply = new System.Windows.Forms.Button();
hScroll = new System.Windows.Forms.HScrollBar();
@@ -69,6 +77,7 @@
removeSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
removeBeforeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
removeAfterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
CodeShiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
canvasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
ClearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
shiftUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -86,10 +95,10 @@
toolTip1 = new System.Windows.Forms.ToolTip(components);
chkLeftSide = new System.Windows.Forms.CheckBox();
chkTopSide = new System.Windows.Forms.CheckBox();
CodeShiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
panel1.SuspendLayout();
cmMinilist.SuspendLayout();
menuStrip1.SuspendLayout();
SuspendLayout();
//
@@ -331,6 +340,7 @@
// miniList
//
miniList.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
miniList.ContextMenuStrip = cmMinilist;
miniList.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
miniList.GridLines = true;
miniList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
@@ -349,6 +359,80 @@
miniList.UseCompatibleStateImageBehavior = false;
miniList.SelectedIndexChanged += MiniList_SelectedIndexChanged;
//
// cmMinilist
//
cmMinilist.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { tsmiMakeVarWidth, tsmiPrepensSymbol, tsmiAppendSymbol, tsmiRemoveSymbol, tsmiRemoveBefore, tsmiRemoveAfter, tsmiCodeShift });
cmMinilist.Name = "cmMinilist";
cmMinilist.Size = new System.Drawing.Size(216, 180);
//
// tsmiMakeVarWidth
//
tsmiMakeVarWidth.Image = Properties.Resources.z_asterisk;
tsmiMakeVarWidth.Name = "tsmiMakeVarWidth";
tsmiMakeVarWidth.Size = new System.Drawing.Size(215, 22);
tsmiMakeVarWidth.Text = "Make Variable Width";
tsmiMakeVarWidth.ToolTipText = "Make Font Variable width one";
tsmiMakeVarWidth.Click += makeVarWidthToolStripMenuItem_Click;
//
// tsmiPrepensSymbol
//
tsmiPrepensSymbol.Enabled = false;
tsmiPrepensSymbol.Image = Properties.Resources.add;
tsmiPrepensSymbol.Name = "tsmiPrepensSymbol";
tsmiPrepensSymbol.Size = new System.Drawing.Size(215, 22);
tsmiPrepensSymbol.Text = "Prepend symbol";
tsmiPrepensSymbol.ToolTipText = "Add a symbol to the beginning of the sequence";
tsmiPrepensSymbol.Click += prependSymbolToolStripMenuItem_Click;
//
// tsmiAppendSymbol
//
tsmiAppendSymbol.Enabled = false;
tsmiAppendSymbol.Image = Properties.Resources.add;
tsmiAppendSymbol.Name = "tsmiAppendSymbol";
tsmiAppendSymbol.Size = new System.Drawing.Size(215, 22);
tsmiAppendSymbol.Text = "Append symbol";
tsmiAppendSymbol.ToolTipText = "Add a symbol to the end of the sequence";
tsmiAppendSymbol.Click += prependSymbolToolStripMenuItem_Click;
//
// tsmiRemoveSymbol
//
tsmiRemoveSymbol.Enabled = false;
tsmiRemoveSymbol.Image = Properties.Resources.delete;
tsmiRemoveSymbol.Name = "tsmiRemoveSymbol";
tsmiRemoveSymbol.Size = new System.Drawing.Size(215, 22);
tsmiRemoveSymbol.Text = "Remove symbol";
tsmiRemoveSymbol.ToolTipText = "Remove selected symbol";
tsmiRemoveSymbol.Click += removeSymbolToolStripMenuItem_Click;
//
// tsmiRemoveBefore
//
tsmiRemoveBefore.Enabled = false;
tsmiRemoveBefore.Image = Properties.Resources.delete;
tsmiRemoveBefore.Name = "tsmiRemoveBefore";
tsmiRemoveBefore.Size = new System.Drawing.Size(215, 22);
tsmiRemoveBefore.Text = "Remove all before selected";
tsmiRemoveBefore.ToolTipText = "Remove all symbols before current one";
tsmiRemoveBefore.Click += removeBeforeToolStripMenuItem_Click;
//
// tsmiRemoveAfter
//
tsmiRemoveAfter.Enabled = false;
tsmiRemoveAfter.Image = Properties.Resources.delete;
tsmiRemoveAfter.Name = "tsmiRemoveAfter";
tsmiRemoveAfter.Size = new System.Drawing.Size(215, 22);
tsmiRemoveAfter.Text = "Remove all after selected";
tsmiRemoveAfter.ToolTipText = "Remove all symbols after current one";
tsmiRemoveAfter.Click += removeAfterToolStripMenuItem_Click;
//
// tsmiCodeShift
//
tsmiCodeShift.Image = Properties.Resources.z_align_center;
tsmiCodeShift.Name = "tsmiCodeShift";
tsmiCodeShift.Size = new System.Drawing.Size(215, 22);
tsmiCodeShift.Text = "Code Shift";
tsmiCodeShift.ToolTipText = "Shift the font on the code line";
tsmiCodeShift.Click += CodeShiftToolStripMenuItem_Click;
//
// ilMiniatures
//
ilMiniatures.ColorDepth = System.Windows.Forms.ColorDepth.Depth4Bit;
@@ -607,6 +691,15 @@
removeAfterToolStripMenuItem.ToolTipText = "Remove all symbols after current one";
removeAfterToolStripMenuItem.Click += removeAfterToolStripMenuItem_Click;
//
// CodeShiftToolStripMenuItem
//
CodeShiftToolStripMenuItem.Image = Properties.Resources.z_align_center;
CodeShiftToolStripMenuItem.Name = "CodeShiftToolStripMenuItem";
CodeShiftToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
CodeShiftToolStripMenuItem.Text = "Code shift";
CodeShiftToolStripMenuItem.ToolTipText = "Shift the font on the code line";
CodeShiftToolStripMenuItem.Click += CodeShiftToolStripMenuItem_Click;
//
// canvasToolStripMenuItem
//
canvasToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ClearToolStripMenuItem, shiftUpToolStripMenuItem, shiftDownToolStripMenuItem, shiftLeftToolStripMenuItem, shiftRightToolStripMenuItem, invertToolStripMenuItem, mirrorXToolStripMenuItem, mirrorYToolStripMenuItem, applyToolStripMenuItem });
@@ -771,15 +864,6 @@
toolTip1.SetToolTip(chkTopSide, "Height changes will be made on Top/Bottom side");
chkTopSide.UseVisualStyleBackColor = true;
//
// CodeShiftToolStripMenuItem
//
CodeShiftToolStripMenuItem.Image = Properties.Resources.z_align_center;
CodeShiftToolStripMenuItem.Name = "CodeShiftToolStripMenuItem";
CodeShiftToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
CodeShiftToolStripMenuItem.Text = "Code shift";
CodeShiftToolStripMenuItem.ToolTipText = "Shift the font on the code line";
CodeShiftToolStripMenuItem.Click += CodeShiftToolStripMenuItem_Click;
//
// MainForm
//
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -816,6 +900,7 @@
((System.ComponentModel.ISupportInitialize)nudX).EndInit();
((System.ComponentModel.ISupportInitialize)nudY).EndInit();
panel1.ResumeLayout(false);
cmMinilist.ResumeLayout(false);
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
ResumeLayout(false);
@@ -887,6 +972,14 @@
private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fontToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem CodeShiftToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip cmMinilist;
private System.Windows.Forms.ToolStripMenuItem tsmiRemoveBefore;
private System.Windows.Forms.ToolStripMenuItem tsmiRemoveAfter;
private System.Windows.Forms.ToolStripMenuItem tsmiRemoveSymbol;
private System.Windows.Forms.ToolStripMenuItem tsmiPrepensSymbol;
private System.Windows.Forms.ToolStripMenuItem tsmiAppendSymbol;
private System.Windows.Forms.ToolStripMenuItem tsmiCodeShift;
private System.Windows.Forms.ToolStripMenuItem tsmiMakeVarWidth;
}
}

View File

@@ -73,6 +73,8 @@ namespace McBitFont {
private void Form1_Load(object sender, EventArgs e) {
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
tsmiMakeVarWidth.Visible = monospaced;
makeVarWidthToolStripMenuItem.Visible = monospaced;
dotWidth = (int)nudX.Value;
dotHeight = (int)nudY.Value;
@@ -101,6 +103,11 @@ namespace McBitFont {
if (Environment.GetCommandLineArgs().Length > 1) {
LoadProject(Environment.GetCommandLineArgs()[1]);
}
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
tsmiMakeVarWidth.Visible = monospaced;
makeVarWidthToolStripMenuItem.Visible = monospaced;
tsmiCodeShift.Visible = frames.Count > 1;
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@@ -635,7 +642,9 @@ namespace McBitFont {
monospaced = form.rbMono.Checked;
}
makeVarWidthToolStripMenuItem.Visible = monospaced;
tsmiMakeVarWidth.Visible = monospaced;
CodeShiftToolStripMenuItem.Visible = !form.cbSingle.Checked;
tsmiCodeShift.Visible = !form.cbSingle.Checked;
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
codepage = (form.cbEncoding.SelectedItem as New.EncodingItem).Code;
foreach (FrameMiniature ff in frames) {
@@ -653,7 +662,7 @@ namespace McBitFont {
prjFileName = "";
this.Text = "McBitFont " + version + " - " + prjName;
modified = false;
checkForAdd();
CheckForAdd();
fbuffer = false;
miniList.Items[0].Selected = true;
miniList.Refresh();
@@ -673,6 +682,9 @@ namespace McBitFont {
removeSymbolToolStripMenuItem.Enabled = false;
removeBeforeToolStripMenuItem.Enabled = false;
removeAfterToolStripMenuItem.Enabled = false;
tsmiRemoveSymbol.Enabled = false;
tsmiRemoveBefore.Enabled = false;
tsmiRemoveAfter.Enabled = false;
copyToolStripMenuItem.Enabled = false;
pasteToolStripMenuItem.Enabled = false;
return;
@@ -692,19 +704,27 @@ namespace McBitFont {
ff = frames.Find(x => x.code == code);
if (frames.Count > 1 && (ff.Equals(frames.First()) || ff.Equals(frames.Last()))) {
removeSymbolToolStripMenuItem.Enabled = true;
tsmiRemoveSymbol.Enabled = true;
} else {
removeSymbolToolStripMenuItem.Enabled = false;
tsmiRemoveSymbol.Enabled = false;
}
copyToolStripMenuItem.Enabled = true;
if (ff.Equals(frames.First())) {
removeBeforeToolStripMenuItem.Enabled = false;
removeAfterToolStripMenuItem.Enabled = true;
tsmiRemoveBefore.Enabled = false;
tsmiRemoveAfter.Enabled = true;
} else if (ff.Equals(frames.Last())) {
removeBeforeToolStripMenuItem.Enabled = true;
removeAfterToolStripMenuItem.Enabled = false;
tsmiRemoveBefore.Enabled = true;
tsmiRemoveAfter.Enabled = false;
} else {
removeBeforeToolStripMenuItem.Enabled = true;
removeAfterToolStripMenuItem.Enabled = true;
tsmiRemoveBefore.Enabled = true;
tsmiRemoveAfter.Enabled = true;
}
if (fbuffer) pasteToolStripMenuItem.Enabled = true;
@@ -731,6 +751,7 @@ namespace McBitFont {
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
frames = sav.frames;
makeVarWidthToolStripMenuItem.Visible = monospaced;
tsmiMakeVarWidth.Visible = monospaced;
miniList.Items.Clear();
ilMiniatures.Images.Clear();
foreach (FrameMiniature ff in frames) {
@@ -755,8 +776,16 @@ namespace McBitFont {
prjFileName = filename;
prjName = Path.GetFileNameWithoutExtension(filename);
this.Text = "McBitFont " + version + " - " + prjName;
checkForAdd();
CheckForAdd();
fbuffer = false;
// Re-create history object
history = new CanvasHistory();
tsmiMakeVarWidth.Visible = monospaced;
makeVarWidthToolStripMenuItem.Visible = monospaced;
tsmiCodeShift.Visible = frames.Count > 1;
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
}
private void SaveProject(string filename) {
@@ -803,7 +832,7 @@ namespace McBitFont {
private void prependSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
FrameMiniature ff;
if (sender == prependSymbolToolStripMenuItem) {
if (sender == prependSymbolToolStripMenuItem || sender == tsmiPrepensSymbol) {
ff = new FrameMiniature(frames.First().code - 1, dotWidth, dotHeight);
frames.Insert(0, ff);
} else {
@@ -815,18 +844,30 @@ namespace McBitFont {
ilMiniatures.Images.Add(s, (Image)getMiniPictue(ff));
var sss = decodeSymbol(ff.code);
miniList.Items.Add(s, s + ' ' + sss, s);
checkForAdd();
CheckForAdd();
}
private void checkForAdd() {
private void CheckForAdd() {
if (frames.Count > 1) {
if (frames.First().code > 0) prependSymbolToolStripMenuItem.Enabled = true;
else prependSymbolToolStripMenuItem.Enabled = false;
if (frames.Last().code < 255) appendSymbolToolStripMenuItem.Enabled = true;
else appendSymbolToolStripMenuItem.Enabled = false;
if (frames.First().code > 0) {
prependSymbolToolStripMenuItem.Enabled = true;
tsmiPrepensSymbol.Enabled = true;
}else {
prependSymbolToolStripMenuItem.Enabled = false;
tsmiPrepensSymbol.Enabled = false;
}
if (frames.Last().code < 255) {
appendSymbolToolStripMenuItem.Enabled = true;
tsmiAppendSymbol.Enabled = true;
} else {
appendSymbolToolStripMenuItem.Enabled = false;
tsmiAppendSymbol.Enabled = false;
}
} else {
prependSymbolToolStripMenuItem.Enabled = false;
appendSymbolToolStripMenuItem.Enabled = false;
tsmiPrepensSymbol.Enabled = false;
tsmiAppendSymbol.Enabled = false;
}
}
@@ -940,6 +981,7 @@ namespace McBitFont {
private void makeVarWidthToolStripMenuItem_Click(object sender, EventArgs e) {
monospaced = false;
makeVarWidthToolStripMenuItem.Visible = false;
tsmiMakeVarWidth.Visible = false;
lblType.Text = "Variable width / Single";
prjModified = true;
}
@@ -998,13 +1040,13 @@ namespace McBitFont {
miniList.Refresh();
miniList.Items[sel].Selected = true;
dotPanel.Refresh();
Cursor.Current = Cursors.Default;
}
csform.Dispose();
history.Clear();
checkForAdd();
CheckForAdd();
prjModified = true;
}

View File

@@ -120,6 +120,9 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>436, 17</value>
</metadata>
<metadata name="cmMinilist.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>534, 17</value>
</metadata>
<metadata name="ilMiniatures.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

View File

@@ -7,7 +7,7 @@ V Change Menu icons
V Re-arranged menu items
Functionality:
- Context menu in symbol navigator
V Context menu in symbol navigator
V Delete symbols before/after selected
V Shift all symbols on code line (change symbol codes)
V Specify starting code (extends the shift)