Changed: save button toggle for treeview change state
This commit is contained in:
parent
ce49c7e062
commit
6e58d6bb5b
18
MainForm.cs
18
MainForm.cs
@ -50,6 +50,8 @@ namespace bzit.bomg
|
||||
|
||||
loadFileThread.DoWork += loadFileThread_DoWork;
|
||||
loadFileThread.RunWorkerCompleted += loadFileThread_RunWorkerCompleted;
|
||||
|
||||
treeView1.OnNodeChanged += treeView1_OnNodeChanged;
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
@ -1229,6 +1231,20 @@ namespace bzit.bomg
|
||||
|
||||
#endregion
|
||||
|
||||
protected void treeView1_OnNodeChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new MethodInvoker(() => {
|
||||
saveMenuBarItem.Enabled = saveFileMenuItem.Enabled = treeView1.HasChanged;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
saveMenuBarItem.Enabled = saveFileMenuItem.Enabled = treeView1.HasChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void loadFileThread_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
if (loadFileType == LoadFileType.Jsnx)
|
||||
@ -1244,6 +1260,8 @@ namespace bzit.bomg
|
||||
private void loadFileThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
this.IsBusy = false;
|
||||
saveMenuBarItem.Enabled = saveFileMenuItem.Enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.3.0.014")]
|
||||
[assembly: AssemblyVersion("0.3.0.018")]
|
||||
[assembly: AssemblyFileVersion("0.1.0.0")]
|
||||
|
2
Properties/Resources.Designer.cs
generated
2
Properties/Resources.Designer.cs
generated
@ -89,7 +89,7 @@ namespace bzit.bomg.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 0.3.0.014 beta.
|
||||
/// Looks up a localized string similar to 0.3.0.018 beta.
|
||||
/// </summary>
|
||||
internal static string app_version {
|
||||
get {
|
||||
|
@ -128,7 +128,7 @@
|
||||
<value>Bookmark Manager</value>
|
||||
</data>
|
||||
<data name="app_version" xml:space="preserve">
|
||||
<value>0.3.0.014 beta</value>
|
||||
<value>0.3.0.018 beta</value>
|
||||
</data>
|
||||
<data name="arrow_down_circle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\2\arrow-down-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
@ -32,12 +32,13 @@ namespace RyzStudio.Windows.Forms
|
||||
|
||||
public BookmarkTreeViewSNode SNode { get; set; }
|
||||
|
||||
public event EventHandler OnNodeChanged = null;
|
||||
|
||||
protected IconDatabase iconDatabase = null;
|
||||
|
||||
protected TreeNode draggingNode = null;
|
||||
|
||||
protected bool hasChanged = false;
|
||||
|
||||
|
||||
public BookmarkTreeView() : base()
|
||||
{
|
||||
this.SNode = new BookmarkTreeViewSNode(this);
|
||||
@ -74,7 +75,7 @@ namespace RyzStudio.Windows.Forms
|
||||
{
|
||||
hasChanged = value;
|
||||
|
||||
//OnChanged?.Invoke(null, null);
|
||||
OnNodeChanged?.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user