mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-19 18:41:26 +00:00
Comments Panel: docker is now only updated when it is visible
This commit is contained in:
parent
e0e61d63ec
commit
5cf8ed914a
4 changed files with 57 additions and 34 deletions
|
@ -112,6 +112,12 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
dockerpanel.UpdateListSoon();
|
||||
}
|
||||
|
||||
// Edit performed
|
||||
public override void OnEditAccept()
|
||||
{
|
||||
dockerpanel?.UpdateListSoon();
|
||||
}
|
||||
|
||||
// Mode changes
|
||||
public override bool OnModeChange(EditMode oldmode, EditMode newmode)
|
||||
{
|
||||
|
@ -120,5 +126,14 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
|
||||
return base.OnModeChange(oldmode, newmode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the currently active docker is the Comments docker.
|
||||
/// </summary>
|
||||
/// <returns>true if the Comments docker is active, otherwise false</returns>
|
||||
public bool IsDockerActive()
|
||||
{
|
||||
return General.Interface.ActiveDockerTabName == commentsdocker.Title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,8 +112,8 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.grid.Size = new System.Drawing.Size(250, 465);
|
||||
this.grid.StandardTab = true;
|
||||
this.grid.TabIndex = 6;
|
||||
this.grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.grid_MouseDown);
|
||||
this.grid.Leave += new System.EventHandler(this.grid_Leave);
|
||||
this.grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.grid_MouseDown);
|
||||
this.grid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.grid_MouseUp);
|
||||
//
|
||||
// iconcolumn
|
||||
|
@ -134,7 +134,7 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
//
|
||||
// updatetimer
|
||||
//
|
||||
this.updatetimer.Interval = 2000;
|
||||
this.updatetimer.Interval = 750;
|
||||
this.updatetimer.Tick += new System.EventHandler(this.updatetimer_Tick);
|
||||
//
|
||||
// contextmenu
|
||||
|
@ -238,6 +238,7 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.Controls.Add(this.optionsgroup);
|
||||
this.Name = "CommentsDocker";
|
||||
this.Size = new System.Drawing.Size(250, 657);
|
||||
this.VisibleChanged += new System.EventHandler(this.CommentsDocker_VisibleChanged);
|
||||
this.optionsgroup.ResumeLayout(false);
|
||||
this.optionsgroup.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
|
||||
|
|
|
@ -152,7 +152,6 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
public void UpdateListSoon()
|
||||
{
|
||||
updatetimer.Stop();
|
||||
updatetimer.Interval = 100;
|
||||
updatetimer.Start();
|
||||
}
|
||||
|
||||
|
@ -387,16 +386,18 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
// as it is called every time a dialog window closes.
|
||||
private void ParentForm_Activated(object sender, EventArgs e)
|
||||
{
|
||||
UpdateList();
|
||||
UpdateListSoon();
|
||||
}
|
||||
|
||||
// Update regulary
|
||||
private void updatetimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
updatetimer.Stop();
|
||||
updatetimer.Interval = 2000;
|
||||
|
||||
if (!BuilderPlug.Me.IsDockerActive())
|
||||
return;
|
||||
|
||||
UpdateList();
|
||||
updatetimer.Start();
|
||||
}
|
||||
|
||||
// Mouse pressed
|
||||
|
@ -631,6 +632,12 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
preventupdate = false;
|
||||
}
|
||||
|
||||
private void CommentsDocker_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Visible)
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,48 +112,48 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="optionsgroup.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="optionsgroup.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="clickselects.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="clickselects.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="filtermode.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="filtermode.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="grid.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="grid.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="iconcolumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="iconcolumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="textcolumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="textcolumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="updatetimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="updatetimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="contextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="contextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>136, 17</value>
|
||||
</metadata>
|
||||
<metadata name="addcomment.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="addcomment.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="addcommentgroup.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="addcommentgroup.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="addcommenttext.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="addcommenttext.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="enabledtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="enabledtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>252, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
Reference in a new issue