From 9d1ca65f34c06b52716dc7f4cebab622b9a30cc4 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Wed, 5 Jul 2023 02:22:58 +0300 Subject: [PATCH] Added modified check before project save --- McBitFont/Form1.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/McBitFont/Form1.cs b/McBitFont/Form1.cs index dd95308..8de50dd 100644 --- a/McBitFont/Form1.cs +++ b/McBitFont/Form1.cs @@ -51,7 +51,7 @@ namespace McBitFont { public bool monospaced = false; bool modified = false; bool prjModified = false; - public const string version = "1.4"; + public const string version = "1.5"; public string prjName = "Untitled"; public int codepage = 1251; private FrameMiniature fbuf; @@ -163,6 +163,7 @@ namespace McBitFont { ilMiniatures.Images.Add(s, (Image)bmp); miniList.Items[s].ImageKey = s; } + if (nudY.Focused) modified = true; prjModified = true; dotResize(dotWidth, (int)nudY.Value); } @@ -631,6 +632,11 @@ namespace McBitFont { } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { + if (modified) { + if (MessageBox.Show("Current frame is modified.\nDo you want to apply the changes first?", "The frame was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) { + saveFrame(); + } + } if (dlgSave.ShowDialog() == DialogResult.OK) { SaveBlock sav; sav.monospaced = monospaced;