bug fixed that prevented editing dialogs from showing up

This commit is contained in:
codeimp 2009-01-07 10:44:38 +00:00
parent 7405b25612
commit 447ad32c57
8 changed files with 15 additions and 10 deletions

View file

@ -362,7 +362,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true); ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true);
if(selected.Count > 0) if(selected.Count > 0)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
// Show line edit dialog // Show line edit dialog
General.Interface.ShowEditLinedefs(selected); General.Interface.ShowEditLinedefs(selected);

View file

@ -448,7 +448,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true); ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true);
if(selected.Count > 0) if(selected.Count > 0)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
// Show sector edit dialog // Show sector edit dialog
General.Interface.ShowEditSectors(selected); General.Interface.ShowEditSectors(selected);

View file

@ -355,7 +355,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
ICollection<Thing> selected = General.Map.Map.GetSelectedThings(true); ICollection<Thing> selected = General.Map.Map.GetSelectedThings(true);
if(selected.Count > 0) if(selected.Count > 0)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
// Show thing edit dialog // Show thing edit dialog
General.Interface.ShowEditThings(selected); General.Interface.ShowEditThings(selected);

View file

@ -88,7 +88,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Select texture // Select texture
public virtual void OnSelectTexture() public virtual void OnSelectTexture()
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
string oldtexture = GetTextureName(); string oldtexture = GetTextureName();
string newtexture = General.Interface.BrowseFlat(General.Interface, oldtexture); string newtexture = General.Interface.BrowseFlat(General.Interface, oldtexture);
@ -118,7 +118,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Not using any modifier buttons // Not using any modifier buttons
if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState) if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
List<Sector> sectors = new List<Sector>(); List<Sector> sectors = new List<Sector>();
sectors.Add(this.Sector.Sector); sectors.Add(this.Sector.Sector);

View file

@ -212,7 +212,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Select texture // Select texture
public virtual void OnSelectTexture() public virtual void OnSelectTexture()
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
string oldtexture = GetTextureName(); string oldtexture = GetTextureName();
string newtexture = General.Interface.BrowseTexture(General.Interface, oldtexture); string newtexture = General.Interface.BrowseTexture(General.Interface, oldtexture);
@ -276,7 +276,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Not using any modifier buttons // Not using any modifier buttons
if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState) if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
List<Linedef> lines = new List<Linedef>(); List<Linedef> lines = new List<Linedef>();
lines.Add(this.Sidedef.Line); lines.Add(this.Sidedef.Line);

View file

@ -358,7 +358,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Not using any modifier buttons // Not using any modifier buttons
if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState) if(!General.Interface.ShiftState && !General.Interface.CtrlState && !General.Interface.AltState)
{ {
if(General.Interface.HasFocus) if(General.Interface.IsActiveWindow)
{ {
List<Thing> things = new List<Thing>(); List<Thing> things = new List<Thing>();
things.Add(this.Thing); things.Add(this.Thing);

View file

@ -50,7 +50,7 @@ namespace CodeImp.DoomBuilder.Windows
bool SnapToGrid { get; } bool SnapToGrid { get; }
bool MouseExclusive { get; } bool MouseExclusive { get; }
MouseButtons MouseButtons { get; } MouseButtons MouseButtons { get; }
bool HasFocus { get; } bool IsActiveWindow { get; }
// Methods // Methods
void DisplayReady(); void DisplayReady();

View file

@ -89,6 +89,7 @@ namespace CodeImp.DoomBuilder.Windows
private Point lastposition; private Point lastposition;
private Size lastsize; private Size lastsize;
private bool displayresized = true; private bool displayresized = true;
private bool windowactive;
// Mouse in display // Mouse in display
private bool mouseinside; private bool mouseinside;
@ -147,7 +148,7 @@ namespace CodeImp.DoomBuilder.Windows
public bool MouseExclusive { get { return mouseexclusive; } } public bool MouseExclusive { get { return mouseexclusive; } }
new public IntPtr Handle { get { return windowptr; } } new public IntPtr Handle { get { return windowptr; } }
public bool IsInfoPanelExpanded { get { return (panelinfo.Height == EXPANDED_INFO_HEIGHT); } } public bool IsInfoPanelExpanded { get { return (panelinfo.Height == EXPANDED_INFO_HEIGHT); } }
public bool HasFocus { get { return this.Focused; } } public bool IsActiveWindow { get { return windowactive; } }
#endregion #endregion
@ -372,6 +373,8 @@ namespace CodeImp.DoomBuilder.Windows
// Window receives focus // Window receives focus
private void MainForm_Activated(object sender, EventArgs e) private void MainForm_Activated(object sender, EventArgs e)
{ {
windowactive = true;
// Resume any exclusive mouse input // Resume any exclusive mouse input
ResumeExclusiveMouseInput(); ResumeExclusiveMouseInput();
display.Focus(); display.Focus();
@ -380,6 +383,8 @@ namespace CodeImp.DoomBuilder.Windows
// Window loses focus // Window loses focus
private void MainForm_Deactivate(object sender, EventArgs e) private void MainForm_Deactivate(object sender, EventArgs e)
{ {
windowactive = false;
// Release all pressed keys // Release all pressed keys
General.Actions.ReleaseAllKeys(); General.Actions.ReleaseAllKeys();
mousebuttons = MouseButtons.None; mousebuttons = MouseButtons.None;