Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7270/src
Modified Files:
Tags.cpp Tags.h
Log Message:
Commit window placement patch from Brendan Cox.
Index: Tags.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Tags.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Tags.h 23 Mar 2009 22:20:06 -0000 1.17
+++ Tags.h 29 May 2009 07:41:24 -0000 1.18
@@ -153,6 +153,8 @@
void OnOk(wxCommandEvent & event);
void OnCancel(wxCommandEvent & event);
+
+ bool IsWindowRectValid(const wxRect *windowRect) const;
private:
Tags *mTags;
Index: Tags.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Tags.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- Tags.cpp 1 May 2009 18:26:33 -0000 1.69
+++ Tags.cpp 29 May 2009 07:41:24 -0000 1.70
@@ -71,6 +71,7 @@
#include <wx/textctrl.h>
#include <wx/textfile.h>
#include <wx/combobox.h>
+#include <wx/display.h>
#ifdef _DEBUG
#ifdef _MSC_VER
@@ -748,7 +749,11 @@
gPrefs->Read(wxT("/TagsEditor/y"), &r.y, r.y);
gPrefs->Read(wxT("/TagsEditor/width"), &r.width, r.width);
gPrefs->Read(wxT("/TagsEditor/height"), &r.height, r.height);
- Move(r.GetPosition());
+ //On multi-monitor systems, there's a chance the last saved window position
is
+ //on a monitor that has been removed or is unavailable.
+ if (IsWindowRectValid(&r))
+ Move(r.GetPosition());
+
// SetSize(r.GetSize());
// Resize value column width based on width of columns and the vertical
scrollbar
@@ -1334,6 +1339,26 @@
mGrid->GetDefaultEditorForType(wxT("Combo"))->SetParameters(parm);
}
+bool TagsEditor::IsWindowRectValid(const wxRect *windowRect) const
+{
+ wxDisplay display;
+ wxPoint topLeft(windowRect->GetTopLeft().x, windowRect->GetTopLeft().y);
+ wxPoint topRight(windowRect->GetTopRight().x, windowRect->GetTopRight().y);
+ wxPoint bottomLeft(windowRect->GetBottomLeft().x,
windowRect->GetBottomLeft().y);
+ wxPoint bottomRight(windowRect->GetBottomRight().x,
windowRect->GetBottomRight().y);
+ display.GetFromPoint(topLeft);
+ if (display.GetFromPoint(topLeft) == -1 &&
+ display.GetFromPoint(topRight) == -1 &&
+ display.GetFromPoint(bottomLeft) == -1 &&
+ display.GetFromPoint(bottomRight) == -1) {
+ return false;
+ }
+
+ return true;
+}
+
+
+
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
// version control system. Please do not modify past this point.
//
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs