/[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 583 by jonathan, Tue Apr 1 10:22:16 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      #      #
253    
254      def _OnButtonClose(self, event):      def _OnButtonClose(self, event):
255          self.Close()          #self.Close()
256            self.Destroy()
257    
258      def _OnClose(self, force = False):      def _OnClose(self, force = False):
259          self.Close()          self.Destroy()
260    
261      def _OnToggleDock(self, event):      def _OnToggleDock(self, event):
262          self.__CheckAllGood()          self.__CheckAllGood()
# Line 364  class DockFrame(wxFrame): Line 365  class DockFrame(wxFrame):
365    
366          self.openWindows = {}          self.openWindows = {}
367    
368          EVT_SIZE(self, self._OnSashSize)          self.__update_lock = 0
369    
370          self.SetMainWindow(None)          self.SetMainWindow(None)
371    
372    
373            EVT_SIZE(self, self._OnSashSize)
374            EVT_CLOSE(self, self._OnClose)
375    
376      layout2oppSash = {      layout2oppSash = {
377              wxLAYOUT_NONE   : wxSASH_NONE,              wxLAYOUT_NONE   : wxSASH_NONE,
378              wxLAYOUT_TOP    : wxSASH_BOTTOM,              wxLAYOUT_TOP    : wxSASH_BOTTOM,
# Line 375  class DockFrame(wxFrame): Line 380  class DockFrame(wxFrame):
380              wxLAYOUT_RIGHT  : wxSASH_LEFT,              wxLAYOUT_RIGHT  : wxSASH_LEFT,
381              wxLAYOUT_BOTTOM : wxSASH_TOP }              wxLAYOUT_BOTTOM : wxSASH_TOP }
382    
383    
384        def _OnClose(self, event):
385    
386            self.__update_lock += 1
387    
388            #
389            # child windows are not notified when the parent is destroyed
390            # as of v2.4.0.3 so we need to interate over our children
391            # and tell them to go away.
392            #
393            for key in self.openWindows.keys():
394                win = self.openWindows[key]
395                win.Destroy()
396    
397            self.__update_lock -= 1
398    
399            # should really call _UpdateDocks() here but we don't need to
400            # since we're going away
401    
402      def CreateDock(self, name, id, title, align):      def CreateDock(self, name, id, title, align):
403    
404          if align in (wxLAYOUT_NONE, wxLAYOUT_LEFT, wxLAYOUT_RIGHT):          if align in (wxLAYOUT_NONE, wxLAYOUT_LEFT, wxLAYOUT_RIGHT):
# Line 409  class DockFrame(wxFrame): Line 433  class DockFrame(wxFrame):
433                    
434      def _UpdateDocks(self):      def _UpdateDocks(self):
435          #print "_UpdateDocks()"          #print "_UpdateDocks()"
436          wxLayoutAlgorithm().LayoutWindow(self, self.__mainWindow)          if self.__update_lock == 0:
437                wxLayoutAlgorithm().LayoutWindow(self, self.__mainWindow)
438    
439      def _OnSashDragged(self, event):      def _OnSashDragged(self, event):
440          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.583

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26