/[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 651 by jonathan, Fri Apr 11 14:27:53 2003 UTC revision 657 by jonathan, Fri Apr 11 18:29:57 2003 UTC
# Line 166  class DockableWindow(Publisher): Line 166  class DockableWindow(Publisher):
166          self.__topWindow = self.__dockWindow          self.__topWindow = self.__dockWindow
167          self.__dockPanel.Reparent(self.__topWindow)          self.__dockPanel.Reparent(self.__topWindow)
168    
169          if self.bmpUnDock is not None:          if self.__bmpUnDock is not None:
170              self.__dockButton.SetBitmapLabel(self.bmpUnDock)              self.__dockButton.SetBitmapLabel(self.__bmpUnDock)
171              self.__dockButton.SetBitmapFocus(self.bmpUnDock)              self.__dockButton.SetBitmapFocus(self.__bmpUnDock)
172              self.__dockButton.SetToolTip(wxToolTip(_("Undock")))              self.__dockButton.SetToolTip(wxToolTip(_("Undock")))
173          else:          else:
174              self.__dockButton.SetLabel(_("Undock"))              self.__dockButton.SetLabel(_("Undock"))
# Line 196  class DockableWindow(Publisher): Line 196  class DockableWindow(Publisher):
196          self.__topWindow = self.__floatWindow          self.__topWindow = self.__floatWindow
197          self.__dockPanel.Reparent(self.__topWindow)          self.__dockPanel.Reparent(self.__topWindow)
198    
199          if self.bmpDock is not None:          if self.__bmpDock is not None:
200              self.__dockButton.SetBitmapLabel(self.bmpDock)              self.__dockButton.SetBitmapLabel(self.__bmpDock)
201              self.__dockButton.SetBitmapFocus(self.bmpDock)              self.__dockButton.SetBitmapFocus(self.__bmpDock)
202              self.__dockButton.SetToolTip(wxToolTip(_("Dock")))              self.__dockButton.SetToolTip(wxToolTip(_("Dock")))
203          else:          else:
204              self.__dockButton.SetLabel(_("Dock"))              self.__dockButton.SetLabel(_("Dock"))
# Line 229  class DockableWindow(Publisher): Line 229  class DockableWindow(Publisher):
229    
230      def SetDockSize(self, rect = None):      def SetDockSize(self, rect = None):
231    
232            print "---------------"
233          #          #
234          # adjust the size to get the          # adjust the size to get the
235          w0, h0 = self.__dockPanel.GetBestSize()          w0, h0 = self.__dockPanel.GetBestSize()
236            print w0, h0
237          w, h = self.__panel.GetBestSize()          w, h = self.__panel.GetBestSize()
238            print w, h
239            #w0, h0 = self.__dockPanel.GetBestSize()
240            #w0 = h0 = 0
241            #w, h = self.__dockPanel.GetBestSize()
242    
243          #print (w0, h0), (w, h)          #print (w0, h0), (w, h)
244    
# Line 254  class DockableWindow(Publisher): Line 260  class DockableWindow(Publisher):
260          rw += 8 # XXX: without this the sash isn't visible!?!?!?!          rw += 8 # XXX: without this the sash isn't visible!?!?!?!
261          rh += 8 # XXX: without this the sash isn't visible!?!?!?!          rh += 8 # XXX: without this the sash isn't visible!?!?!?!
262                                                                                                                                                                                
263            print rw, rh
264    
265          self.__dockWindow.SetDefaultSize(wxSize(rw, rh))          self.__dockWindow.SetDefaultSize(wxSize(rw, rh))
266    
267    
# Line 315  class DockableWindow(Publisher): Line 323  class DockableWindow(Publisher):
323          self.__dockPanel = wxPanel(self.__topWindow, -1, style=wxSUNKEN_BORDER)          self.__dockPanel = wxPanel(self.__topWindow, -1, style=wxSUNKEN_BORDER)
324          #self.__dockPanel.SetBackgroundColour(wxColour(255, 0, 0))          #self.__dockPanel.SetBackgroundColour(wxColour(255, 0, 0))
325    
326            self.__panel.Reparent(self.__dockPanel)
327            self.__panel.SetId(PANEL_ID)
328    
329          if self.__orientation == wxLAYOUT_VERTICAL:          if self.__orientation == wxLAYOUT_VERTICAL:
330              sizer = wxBoxSizer(wxVERTICAL)              sizer = wxBoxSizer(wxVERTICAL)
331              headerBoxOrient = wxHORIZONTAL              headerBoxOrient = wxHORIZONTAL
# Line 343  class DockableWindow(Publisher): Line 354  class DockableWindow(Publisher):
354          # Perhaps using wxToggleButton would be better, but it's only          # Perhaps using wxToggleButton would be better, but it's only
355          # supported under wxMSW and wxGTK as of v2.4.0.3          # supported under wxMSW and wxGTK as of v2.4.0.3
356          #          #
357          self.bmpDock   = \          self.__bmpDock   = \
358              resource.GetBitmapResource(DOCK_BMP, wxBITMAP_TYPE_XPM)              resource.GetBitmapResource(DOCK_BMP, wxBITMAP_TYPE_XPM)
359          self.bmpUnDock = \          self.__bmpUnDock = \
360              resource.GetBitmapResource(UNDOCK_BMP, wxBITMAP_TYPE_XPM)              resource.GetBitmapResource(UNDOCK_BMP, wxBITMAP_TYPE_XPM)
361    
362          if self.bmpDock is not None \          if self.__bmpDock is not None \
363              and self.bmpUnDock is not None:              and self.__bmpUnDock is not None:
364              self.__dockButton = wxBitmapButton(              self.__dockButton = wxBitmapButton(
365                  self.__dockPanel, ID_BUTTON_DOCK,                  self.__dockPanel, ID_BUTTON_DOCK,
366                  self.bmpUnDock,                  self.__bmpUnDock,
367                  size = wxSize(self.bmpDock.GetWidth() + 4,                  size = wxSize(self.__bmpDock.GetWidth() + 4,
368                                self.bmpDock.GetHeight() + 4),                                self.__bmpDock.GetHeight() + 4),
369                  style = wxBU_EXACTFIT | wxADJUST_MINSIZE)                  style = wxBU_EXACTFIT | wxADJUST_MINSIZE)
370          else:          else:
371              self.bmpDock = \              self.__bmpDock = \
372              self.bmpUnDock = None              self.__bmpUnDock = None
373    
374              self.__dockButton = wxButton(              self.__dockButton = wxButton(
375                  self.__dockPanel, ID_BUTTON_DOCK,                  self.__dockPanel, ID_BUTTON_DOCK,
# Line 382  class DockableWindow(Publisher): Line 393  class DockableWindow(Publisher):
393          if self.__orientation == wxLAYOUT_VERTICAL:          if self.__orientation == wxLAYOUT_VERTICAL:
394              headerBox.Add(text, 0, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, 0)              headerBox.Add(text, 0, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, 0)
395              headerBox.Add(1, 5, 1, wxGROW)              headerBox.Add(1, 5, 1, wxGROW)
             #headerBox.Add(buttonBox, 0, wxGROW | wxALIGN_RIGHT, 0)  
396              headerBox.Add(self.__dockButton, 0, wxALIGN_RIGHT, 0)              headerBox.Add(self.__dockButton, 0, wxALIGN_RIGHT, 0)
397              headerBox.Add(closeX, 0, wxALIGN_RIGHT | wxLEFT, 4)              headerBox.Add(closeX, 0, wxALIGN_RIGHT | wxLEFT, 4)
398          else:          else:
# Line 392  class DockableWindow(Publisher): Line 402  class DockableWindow(Publisher):
402    
403          sizer.Add(headerBox, 0, wxGROW, 0)          sizer.Add(headerBox, 0, wxGROW, 0)
404    
         self.__panel.Reparent(self.__dockPanel)  
         self.__panel.SetId(PANEL_ID)  
405    
406          sizer.Add(self.__panel, 1, wxGROW, 0)          sizer.Add(self.__panel, 1, wxGROW, 0)
407    
408          sizer.Fit(self.__dockPanel)          #sizer.Fit(self.__dockPanel)
409    
410          self.__dockPanel.SetSizer(sizer)          self.__panel.SetAutoLayout(True)
411          self.__dockPanel.SetAutoLayout(True)          sizer.SetSizeHints(self.__panel)
412    
413          sizer.SetSizeHints(self.__dockPanel)          self.__dockPanel.SetSizerAndFit(sizer)
414            #self.__dockPanel.SetAutoLayout(True)
415            #sizer.SetSizeHints(self.__dockPanel)
416    
417          EVT_BUTTON(self.__dockPanel, ID_BUTTON_DOCK, self._OnToggleDock)          EVT_BUTTON(self.__dockPanel, ID_BUTTON_DOCK, self._OnToggleDock)
418          EVT_BUTTON(self.__dockPanel, ID_BUTTON_CLOSE, self._OnButtonClose)          EVT_BUTTON(self.__dockPanel, ID_BUTTON_CLOSE, self._OnButtonClose)

Legend:
Removed from v.651  
changed lines
  Added in v.657

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26