mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 14:12:16 +00:00
@ work in progress on dockers
This commit is contained in:
parent
77230eee5b
commit
f2e1561093
7 changed files with 78 additions and 20 deletions
3
Source/Core/Controls/DockersControl.Designer.cs
generated
3
Source/Core/Controls/DockersControl.Designer.cs
generated
|
@ -45,6 +45,9 @@
|
||||||
this.splitter.Size = new System.Drawing.Size(4, 541);
|
this.splitter.Size = new System.Drawing.Size(4, 541);
|
||||||
this.splitter.TabIndex = 1;
|
this.splitter.TabIndex = 1;
|
||||||
this.splitter.MouseLeave += new System.EventHandler(this.RaiseMouseContainerLeave);
|
this.splitter.MouseLeave += new System.EventHandler(this.RaiseMouseContainerLeave);
|
||||||
|
this.splitter.MouseMove += new System.Windows.Forms.MouseEventHandler(this.splitter_MouseMove);
|
||||||
|
this.splitter.MouseDown += new System.Windows.Forms.MouseEventHandler(this.splitter_MouseDown);
|
||||||
|
this.splitter.MouseUp += new System.Windows.Forms.MouseEventHandler(this.splitter_MouseUp);
|
||||||
this.splitter.MouseEnter += new System.EventHandler(this.RaiseMouseContainerEnter);
|
this.splitter.MouseEnter += new System.EventHandler(this.RaiseMouseContainerEnter);
|
||||||
//
|
//
|
||||||
// tabs
|
// tabs
|
||||||
|
|
|
@ -50,17 +50,23 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
public event EventHandler MouseContainerLeave;
|
public event EventHandler MouseContainerLeave;
|
||||||
public event EventHandler Collapsed;
|
public event EventHandler Collapsed;
|
||||||
public event EventHandler Expanded;
|
public event EventHandler Expanded;
|
||||||
|
public event EventHandler UserResize;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Variables
|
#region ================== Variables
|
||||||
|
|
||||||
|
// Behaviour
|
||||||
private bool rightalign;
|
private bool rightalign;
|
||||||
private bool iscollapsed;
|
private bool iscollapsed;
|
||||||
|
|
||||||
|
// Collapsing
|
||||||
private int expandedwidth; // width when expanded
|
private int expandedwidth; // width when expanded
|
||||||
private int expandedtab; // selected tab index when expanded
|
private int expandedtab; // selected tab index when expanded
|
||||||
|
|
||||||
|
// Splitting
|
||||||
|
private int splitstartoffset;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Properties
|
#region ================== Properties
|
||||||
|
@ -219,22 +225,59 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
// We don't want the focus
|
// We don't want the focus
|
||||||
private void tabs_Enter(object sender, EventArgs e) { General.MainWindow.FocusDisplay(); }
|
private void tabs_Enter(object sender, EventArgs e) { General.MainWindow.FocusDisplay(); }
|
||||||
private void tabs_MouseUp(object sender, MouseEventArgs e) { General.MainWindow.FocusDisplay(); }
|
private void tabs_MouseUp(object sender, MouseEventArgs e) { General.MainWindow.FocusDisplay(); }
|
||||||
|
private void tabs_SelectedIndexChanged(object sender, EventArgs e) { General.MainWindow.FocusDisplay(); }
|
||||||
|
private void tabs_Selected(object sender, TabControlEventArgs e) { General.MainWindow.FocusDisplay(); }
|
||||||
|
protected override void OnEnter(EventArgs e) { General.MainWindow.FocusDisplay(); }
|
||||||
|
|
||||||
|
// Splitting begins
|
||||||
|
private void splitter_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if(e.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
splitstartoffset = e.X;
|
||||||
|
splitter.BackColor = SystemColors.ControlDark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Splitting ends
|
||||||
|
private void splitter_MouseUp(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
splitter.BackColor = SystemColors.Control;
|
||||||
|
this.Update();
|
||||||
|
General.MainWindow.RedrawDisplay();
|
||||||
|
General.MainWindow.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Splitting dragged
|
||||||
|
private void splitter_MouseMove(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if(e.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
General.LockWindowUpdate(Parent.Handle);
|
||||||
|
|
||||||
|
// Resize the control
|
||||||
|
int delta = e.X - splitstartoffset;
|
||||||
|
if(rightalign)
|
||||||
|
{
|
||||||
|
this.Left += delta;
|
||||||
|
this.Width -= delta;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Width += delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
General.LockWindowUpdate(IntPtr.Zero);
|
||||||
|
this.Update();
|
||||||
|
General.MainWindow.RedrawDisplay();
|
||||||
|
General.MainWindow.Update();
|
||||||
|
|
||||||
|
// Raise event
|
||||||
|
if(UserResize != null)
|
||||||
|
UserResize(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void tabs_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
General.MainWindow.FocusDisplay();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void tabs_Selected(object sender, TabControlEventArgs e)
|
|
||||||
{
|
|
||||||
General.MainWindow.FocusDisplay();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnEnter(EventArgs e)
|
|
||||||
{
|
|
||||||
General.MainWindow.FocusDisplay();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,8 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
// Disable background drawing by overriding this
|
// Disable background drawing by overriding this
|
||||||
protected override void OnPaintBackground(PaintEventArgs e)
|
protected override void OnPaintBackground(PaintEventArgs e)
|
||||||
{
|
{
|
||||||
|
if(BackColor != Color.Transparent)
|
||||||
|
e.Graphics.Clear(BackColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
1
Source/Core/Windows/MainForm.Designer.cs
generated
1
Source/Core/Windows/MainForm.Designer.cs
generated
|
@ -1599,6 +1599,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
this.dockerspanel.Size = new System.Drawing.Size(236, 467);
|
this.dockerspanel.Size = new System.Drawing.Size(236, 467);
|
||||||
this.dockerspanel.TabIndex = 7;
|
this.dockerspanel.TabIndex = 7;
|
||||||
this.dockerspanel.TabStop = false;
|
this.dockerspanel.TabStop = false;
|
||||||
|
this.dockerspanel.UserResize += new System.EventHandler(this.dockerspanel_UserResize);
|
||||||
this.dockerspanel.Collapsed += new System.EventHandler(this.LoseFocus);
|
this.dockerspanel.Collapsed += new System.EventHandler(this.LoseFocus);
|
||||||
this.dockerspanel.MouseContainerEnter += new System.EventHandler(this.dockerspanel_MouseContainerEnter);
|
this.dockerspanel.MouseContainerEnter += new System.EventHandler(this.dockerspanel_MouseContainerEnter);
|
||||||
this.dockerspanel.MouseContainerLeave += new System.EventHandler(this.dockerspanel_MouseContainerLeave);
|
this.dockerspanel.MouseContainerLeave += new System.EventHandler(this.dockerspanel_MouseContainerLeave);
|
||||||
|
|
|
@ -2524,6 +2524,15 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
dockerspanel.Collapse();
|
dockerspanel.Collapse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// User resizes the docker
|
||||||
|
private void dockerspanel_UserResize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
General.Settings.DockersWidth = dockerspanel.Width;
|
||||||
|
|
||||||
|
if(!General.Settings.CollapseDockers)
|
||||||
|
dockersspace.Width = dockerspanel.Width;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -165,12 +165,12 @@
|
||||||
<metadata name="menumain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="menumain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="toolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>127, 17</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="toolbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="toolbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="toolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>127, 17</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="statusbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="statusbar.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
Loading…
Reference in a new issue