mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 20:32:34 +00:00
e8f52aecb9
Location and active tab of all Edit Forms are now stored while GZDB is running. Focus management between editing window and the rest of the interface should work better now. Tag Explorer plugin: editing window was not updated properly when Edit forms were opened from Tag Explorer. Tag Explorer plugin, UDMF: comment editing was incorrectly initialized in some cases.
119 lines
3.3 KiB
C#
119 lines
3.3 KiB
C#
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
/*
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
* This program is released under GNU General Public License
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#endregion
|
|
|
|
#region ================== Namespaces
|
|
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
{
|
|
public class RenderTargetControl : Panel
|
|
{
|
|
#region ================== Constants
|
|
|
|
#endregion
|
|
|
|
#region ================== Variables
|
|
|
|
#endregion
|
|
|
|
#region ================== Properties
|
|
public event KeyEventHandler OnKeyReleased; //mxd. Sometimes it's handeled here, not by MainForm
|
|
#endregion
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
// Constructor
|
|
internal RenderTargetControl()
|
|
{
|
|
// Initialize
|
|
this.SetStyle(ControlStyles.FixedWidth, true);
|
|
this.SetStyle(ControlStyles.FixedHeight, true);
|
|
|
|
this.MouseEnter += new System.EventHandler(RenderTargetControl_MouseEnter); //mxd
|
|
}
|
|
|
|
// Disposer
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
// Done
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Overrides
|
|
|
|
// Paint method
|
|
protected override void OnPaint(PaintEventArgs pe)
|
|
{
|
|
// Pass on to base
|
|
// Do we really want this?
|
|
base.RaisePaintEvent(this, pe);
|
|
}
|
|
|
|
//mxd
|
|
protected override void OnKeyUp(KeyEventArgs e) {
|
|
if(OnKeyReleased != null) OnKeyReleased(this, e);
|
|
}
|
|
|
|
//mxd
|
|
private void RenderTargetControl_MouseEnter(object sender, System.EventArgs e) {
|
|
this.Focus();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
// This sets up the control to display the splash logo
|
|
public void SetSplashLogoDisplay()
|
|
{
|
|
// Change display to show splash logo
|
|
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
|
|
this.SetStyle(ControlStyles.ContainerControl, true);
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
|
this.SetStyle(ControlStyles.UserPaint, true);
|
|
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
|
this.SetStyle(ControlStyles.Opaque, false);
|
|
this.UpdateStyles();
|
|
this.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
|
this.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash3_trans;
|
|
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
|
}
|
|
|
|
// This sets up the control for manual rendering
|
|
public void SetManualRendering()
|
|
{
|
|
// Change display for rendering
|
|
this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
|
|
this.SetStyle(ControlStyles.ContainerControl, true);
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
|
|
this.SetStyle(ControlStyles.UserPaint, true);
|
|
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
|
this.SetStyle(ControlStyles.Opaque, true);
|
|
this.UpdateStyles();
|
|
this.BackColor = Color.Black;
|
|
this.BackgroundImage = null;
|
|
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|