TODO features:
- Move Select and Baseline buttons right - Display RectSelection width and width
This commit is contained in:
36
McBitFont/Form1.Designer.cs
generated
36
McBitFont/Form1.Designer.cs
generated
@@ -103,6 +103,8 @@
|
|||||||
chkHexCodes = new System.Windows.Forms.CheckBox();
|
chkHexCodes = new System.Windows.Forms.CheckBox();
|
||||||
chkRectSelect = new System.Windows.Forms.CheckBox();
|
chkRectSelect = new System.Windows.Forms.CheckBox();
|
||||||
label3 = new System.Windows.Forms.Label();
|
label3 = new System.Windows.Forms.Label();
|
||||||
|
lblSelectionLabel = new System.Windows.Forms.Label();
|
||||||
|
lblSelection = new System.Windows.Forms.Label();
|
||||||
((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
|
((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
|
((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
|
||||||
panel1.SuspendLayout();
|
panel1.SuspendLayout();
|
||||||
@@ -889,7 +891,7 @@
|
|||||||
btnBaseline.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
btnBaseline.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||||
btnBaseline.Image = Properties.Resources.fam_base;
|
btnBaseline.Image = Properties.Resources.fam_base;
|
||||||
btnBaseline.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
btnBaseline.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
btnBaseline.Location = new System.Drawing.Point(718, 92);
|
btnBaseline.Location = new System.Drawing.Point(812, 93);
|
||||||
btnBaseline.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
btnBaseline.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
btnBaseline.Name = "btnBaseline";
|
btnBaseline.Name = "btnBaseline";
|
||||||
btnBaseline.Size = new System.Drawing.Size(88, 27);
|
btnBaseline.Size = new System.Drawing.Size(88, 27);
|
||||||
@@ -951,9 +953,9 @@
|
|||||||
chkRectSelect.Appearance = System.Windows.Forms.Appearance.Button;
|
chkRectSelect.Appearance = System.Windows.Forms.Appearance.Button;
|
||||||
chkRectSelect.Image = Properties.Resources.fam_rectt;
|
chkRectSelect.Image = Properties.Resources.fam_rectt;
|
||||||
chkRectSelect.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
chkRectSelect.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
chkRectSelect.Location = new System.Drawing.Point(620, 92);
|
chkRectSelect.Location = new System.Drawing.Point(718, 93);
|
||||||
chkRectSelect.Name = "chkRectSelect";
|
chkRectSelect.Name = "chkRectSelect";
|
||||||
chkRectSelect.Size = new System.Drawing.Size(74, 27);
|
chkRectSelect.Size = new System.Drawing.Size(87, 27);
|
||||||
chkRectSelect.TabIndex = 23;
|
chkRectSelect.TabIndex = 23;
|
||||||
chkRectSelect.Text = " Select";
|
chkRectSelect.Text = " Select";
|
||||||
chkRectSelect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
chkRectSelect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
@@ -972,11 +974,37 @@
|
|||||||
label3.TabIndex = 21;
|
label3.TabIndex = 21;
|
||||||
label3.Text = "Cursor:";
|
label3.Text = "Cursor:";
|
||||||
//
|
//
|
||||||
|
// lblSelectionLabel
|
||||||
|
//
|
||||||
|
lblSelectionLabel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
lblSelectionLabel.AutoSize = true;
|
||||||
|
lblSelectionLabel.Location = new System.Drawing.Point(616, 93);
|
||||||
|
lblSelectionLabel.Name = "lblSelectionLabel";
|
||||||
|
lblSelectionLabel.Size = new System.Drawing.Size(58, 15);
|
||||||
|
lblSelectionLabel.TabIndex = 25;
|
||||||
|
lblSelectionLabel.Text = "Selection:";
|
||||||
|
lblSelectionLabel.Visible = false;
|
||||||
|
//
|
||||||
|
// lblSelection
|
||||||
|
//
|
||||||
|
lblSelection.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
lblSelection.AutoSize = true;
|
||||||
|
lblSelection.Location = new System.Drawing.Point(617, 108);
|
||||||
|
lblSelection.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
lblSelection.Name = "lblSelection";
|
||||||
|
lblSelection.Size = new System.Drawing.Size(30, 15);
|
||||||
|
lblSelection.TabIndex = 24;
|
||||||
|
lblSelection.Text = "W,H";
|
||||||
|
lblSelection.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||||
|
lblSelection.Visible = false;
|
||||||
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
ClientSize = new System.Drawing.Size(915, 647);
|
ClientSize = new System.Drawing.Size(915, 647);
|
||||||
|
Controls.Add(lblSelectionLabel);
|
||||||
|
Controls.Add(lblSelection);
|
||||||
Controls.Add(chkRectSelect);
|
Controls.Add(chkRectSelect);
|
||||||
Controls.Add(chkHexCodes);
|
Controls.Add(chkHexCodes);
|
||||||
Controls.Add(label3);
|
Controls.Add(label3);
|
||||||
@@ -1099,6 +1127,8 @@
|
|||||||
private System.Windows.Forms.CheckBox chkRectSelect;
|
private System.Windows.Forms.CheckBox chkRectSelect;
|
||||||
private System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem importTextToolStripMenuItem1;
|
private System.Windows.Forms.ToolStripMenuItem importTextToolStripMenuItem1;
|
||||||
|
private System.Windows.Forms.Label lblSelectionLabel;
|
||||||
|
private System.Windows.Forms.Label lblSelection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ namespace McBitFont {
|
|||||||
public bool monospaced = false;
|
public bool monospaced = false;
|
||||||
private bool modified = false;
|
private bool modified = false;
|
||||||
private bool prjModified = false;
|
private bool prjModified = false;
|
||||||
public const string version = "2.1";
|
public const string version = "2.2";
|
||||||
public string prjName = "Untitled";
|
public string prjName = "Untitled";
|
||||||
public string prjFileName = "";
|
public string prjFileName = "";
|
||||||
private int codepage = 1251;
|
private int codepage = 1251;
|
||||||
@@ -79,6 +79,10 @@ namespace McBitFont {
|
|||||||
h = pixelOffset + dotHeight * (cellSize + gap);
|
h = pixelOffset + dotHeight * (cellSize + gap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateSelectionLabel(int width, int height) {
|
||||||
|
lblSelection.Text = width.ToString() + ',' + height.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e) {
|
private void Form1_Load(object sender, EventArgs e) {
|
||||||
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
|
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
|
||||||
tsmiMakeVarWidth.Visible = monospaced;
|
tsmiMakeVarWidth.Visible = monospaced;
|
||||||
@@ -88,6 +92,7 @@ namespace McBitFont {
|
|||||||
|
|
||||||
selection1 = new Point(0, 0);
|
selection1 = new Point(0, 0);
|
||||||
selection2 = new Point(dotWidth - 1, dotHeight - 1);
|
selection2 = new Point(dotWidth - 1, dotHeight - 1);
|
||||||
|
UpdateSelectionLabel(dotWidth, dotHeight);
|
||||||
|
|
||||||
gap = (cellSize < 5) ? 0 : 1;
|
gap = (cellSize < 5) ? 0 : 1;
|
||||||
SetNewWH();
|
SetNewWH();
|
||||||
@@ -240,8 +245,14 @@ namespace McBitFont {
|
|||||||
f = FrameResize(f, ww, hh);
|
f = FrameResize(f, ww, hh);
|
||||||
dotWidth = ww;
|
dotWidth = ww;
|
||||||
dotHeight = hh;
|
dotHeight = hh;
|
||||||
if (selection2.X > dotWidth - 1) selection2.X = dotWidth - 1;
|
if (selection2.X > dotWidth - 1) {
|
||||||
if (selection2.Y > dotHeight - 1) selection2.Y = dotHeight - 1;
|
selection2.X = dotWidth - 1;
|
||||||
|
UpdateSelectionLabel(selection2.X - selection1.X + 1, selection2.Y - selection1.Y + 1);
|
||||||
|
}
|
||||||
|
if (selection2.Y > dotHeight - 1) {
|
||||||
|
selection2.Y = dotHeight - 1;
|
||||||
|
UpdateSelectionLabel(selection2.X - selection1.X + 1, selection2.Y - selection1.Y + 1);
|
||||||
|
}
|
||||||
SetNewWH();
|
SetNewWH();
|
||||||
cbZoom_SelectedIndexChanged(cbZoom, null);
|
cbZoom_SelectedIndexChanged(cbZoom, null);
|
||||||
|
|
||||||
@@ -456,6 +467,9 @@ namespace McBitFont {
|
|||||||
Point p1 = new(selection1.X, selection1.Y);
|
Point p1 = new(selection1.X, selection1.Y);
|
||||||
Point p2 = new(selection2.X, selection2.Y);
|
Point p2 = new(selection2.X, selection2.Y);
|
||||||
NormPoints(ref p1, ref p2);
|
NormPoints(ref p1, ref p2);
|
||||||
|
|
||||||
|
UpdateSelectionLabel(p2.X - p1.X + 1, p2.Y - p1.Y + 1);
|
||||||
|
|
||||||
x = pixelOffset + (p1.X - 1) * (cellSize + gap) - hScroll.Value - 1;
|
x = pixelOffset + (p1.X - 1) * (cellSize + gap) - hScroll.Value - 1;
|
||||||
y = pixelOffset + (p1.Y - 1) * (cellSize + gap) - vScroll.Value - 1;
|
y = pixelOffset + (p1.Y - 1) * (cellSize + gap) - vScroll.Value - 1;
|
||||||
x2 = pixelOffset + (p2.X + 2) * (cellSize + gap) - hScroll.Value - 1;
|
x2 = pixelOffset + (p2.X + 2) * (cellSize + gap) - hScroll.Value - 1;
|
||||||
@@ -1242,6 +1256,7 @@ namespace McBitFont {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void chkRectSelect_CheckedChanged(object sender, EventArgs e) {
|
private void chkRectSelect_CheckedChanged(object sender, EventArgs e) {
|
||||||
|
lblSelection.Visible = lblSelectionLabel.Visible = chkRectSelect.Checked;
|
||||||
dotPanel.Refresh();
|
dotPanel.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,9 +20,9 @@
|
|||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||||
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
||||||
<AssemblyVersion>2.1.0.0</AssemblyVersion>
|
<AssemblyVersion>2.2.0.0</AssemblyVersion>
|
||||||
<FileVersion>2.1.0.0</FileVersion>
|
<FileVersion>2.2.0.0</FileVersion>
|
||||||
<Version>$(VersionPrefix)2.1.0</Version>
|
<Version>$(VersionPrefix)2.2.0</Version>
|
||||||
<Copyright>Anton Mukhin</Copyright>
|
<Copyright>Anton Mukhin</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
Reference in New Issue
Block a user