/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/dock.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/dock.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 571 by jonathan, Fri Mar 28 17:06:38 2003 UTC revision 577 by jonathan, Mon Mar 31 18:31:33 2003 UTC
# Line 194  class DockableWindow(Publisher): Line 194  class DockableWindow(Publisher):
194          #          #
195          # restore window information          # restore window information
196          #          #
197          #if self.__floatPosition is not None: self.SetPosition(self.__floatPosition)          if self.__floatPosition is not None: self.SetPosition(self.__floatPosition)
198          #if self.__floatSize     is not None: self.SetSize(self.__floatSize)          if self.__floatSize     is not None: self.SetSize(self.__floatSize)
199    
200          self.issue(DOCKABLE_UNDOCKED, self.__id, self)          self.issue(DOCKABLE_UNDOCKED, self.__id, self)
201    
# Line 241  class DockableWindow(Publisher): Line 241  class DockableWindow(Publisher):
241          self.__dockWindow.SetDefaultSize(wxSize(rw, rh))          self.__dockWindow.SetDefaultSize(wxSize(rw, rh))
242    
243    
244      def Close(self):      def Destroy(self):
245          self.__panel.Close(True)          self.__panel.Destroy()
246          self.__floatWindow.Destroy()          self.__floatWindow.Destroy()
247          self.__dockWindow.Destroy()          self.__dockWindow.Destroy()
248          self.__parent.OnDockClose(self)          self.__parent.OnDockClose(self)
249            
250      ##      ##
251      # Event handlers      # Event handlers
252      #      #
# Line 255  class DockableWindow(Publisher): Line 255  class DockableWindow(Publisher):
255          self.Close()          self.Close()
256    
257      def _OnClose(self, force = False):      def _OnClose(self, force = False):
258          self.Close()          self.Destroy()
259    
260      def _OnToggleDock(self, event):      def _OnToggleDock(self, event):
261          self.__CheckAllGood()          self.__CheckAllGood()
# Line 364  class DockFrame(wxFrame): Line 364  class DockFrame(wxFrame):
364    
365          self.openWindows = {}          self.openWindows = {}
366    
367          EVT_SIZE(self, self._OnSashSize)          self.__update_lock = 0
368    
369          self.SetMainWindow(None)          self.SetMainWindow(None)
370    
371    
372            EVT_SIZE(self, self._OnSashSize)
373            EVT_CLOSE(self, self._OnClose)
374    
375      layout2oppSash = {      layout2oppSash = {
376              wxLAYOUT_NONE   : wxSASH_NONE,              wxLAYOUT_NONE   : wxSASH_NONE,
377              wxLAYOUT_TOP    : wxSASH_BOTTOM,              wxLAYOUT_TOP    : wxSASH_BOTTOM,
# Line 375  class DockFrame(wxFrame): Line 379  class DockFrame(wxFrame):
379              wxLAYOUT_RIGHT  : wxSASH_LEFT,              wxLAYOUT_RIGHT  : wxSASH_LEFT,
380              wxLAYOUT_BOTTOM : wxSASH_TOP }              wxLAYOUT_BOTTOM : wxSASH_TOP }
381    
382    
383        def _OnClose(self, event):
384    
385            self.__update_lock += 1
386    
387            #
388            # child windows are not notified when the parent is destroyed
389            # as of v2.4.0.3 so we need to interate over our children
390            # and tell them to go away.
391            #
392            for key in self.openWindows.keys():
393                win = self.openWindows[key]
394                win.Destroy()
395    
396            self.__update_lock -= 1
397    
398            # should really call _UpdateDocks() here but we don't need to
399            # since we're going away
400    
401      def CreateDock(self, name, id, title, align):      def CreateDock(self, name, id, title, align):
402    
403          if align in (wxLAYOUT_NONE, wxLAYOUT_LEFT, wxLAYOUT_RIGHT):          if align in (wxLAYOUT_NONE, wxLAYOUT_LEFT, wxLAYOUT_RIGHT):
# Line 409  class DockFrame(wxFrame): Line 432  class DockFrame(wxFrame):
432                    
433      def _UpdateDocks(self):      def _UpdateDocks(self):
434          #print "_UpdateDocks()"          #print "_UpdateDocks()"
435          wxLayoutAlgorithm().LayoutWindow(self, self.__mainWindow)          if self.__update_lock == 0:
436                wxLayoutAlgorithm().LayoutWindow(self, self.__mainWindow)
437    
438      def _OnSashDragged(self, event):      def _OnSashDragged(self, event):
439          if event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE:          if event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE:

Legend:
Removed from v.571  
changed lines
  Added in v.577

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26