dabo Commit
Revision 4058
Date: 2008-05-03 09:31:23 -0700 (Sat, 03 May 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4058
Changed:
U trunk/dabo/ui/uiwx/dFormMixin.py
Log:
Fixed an issue where a form could be restored to a position that was off the
visible display. When running dual monitors I frequently leave the Dabo Shell
running on my external monitor; when coming home and re-launching it on my
laptop, it would be restored to a position that was off my display. This change
checks the display dimensions to ensure that the restored frame is fully
visible.
Diff:
Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py 2008-05-02 14:21:25 UTC (rev 4057)
+++ trunk/dabo/ui/uiwx/dFormMixin.py 2008-05-03 16:31:23 UTC (rev 4058)
@@ -448,7 +448,18 @@
if state == "Minimized":
state = "Normal"
self.WindowState = state
-
+ # Make sure that the frame is on the visible display
+ dispWd, dispHt = dabo.ui.getDisplaySize()
+ self.Right = min(dispWd, self.Right)
+ self.Bottom = min(dispHt, self.Bottom)
+ if self.Application.Platform == "Mac":
+ # Need to account for the menu bar
+ minTop = 23
+ else:
+ minTop = 0
+ self.Left = max(0, self.Left)
+ self.Top = max(minTop, self.Top)
+
self.restoredSP = True
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]