Changeset 4058

Show
Ignore:
Timestamp:
05/03/08 09:31:23 (3 months ago)
Author:
ed
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dFormMixin.py

    r3901 r4058  
    449449                    state = "Normal" 
    450450                self.WindowState = state 
    451                  
     451            # Make sure that the frame is on the visible display 
     452            dispWd, dispHt = dabo.ui.getDisplaySize() 
     453            self.Right = min(dispWd, self.Right) 
     454            self.Bottom = min(dispHt, self.Bottom) 
     455            if self.Application.Platform == "Mac": 
     456                # Need to account for the menu bar 
     457                minTop = 23 
     458            else: 
     459                minTop = 0 
     460            self.Left = max(0, self.Left) 
     461            self.Top = max(minTop, self.Top) 
     462 
    452463            self.restoredSP = True 
    453464