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 |
|
|
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() |
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, |
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): |
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: |
447 |
#print dockPanel |
#print dockPanel |
448 |
panel = dockPanel.FindWindowById(PANEL_ID) |
panel = dockPanel.FindWindowById(PANEL_ID) |
449 |
#print panel |
#print panel |
450 |
assert(isinstance(panel, DockPanel)) |
assert isinstance(panel, DockPanel) |
451 |
win = panel.GetDockParent() |
win = panel.GetDockParent() |
452 |
#print win |
#print win |
453 |
assert(isinstance(win, DockableWindow)) |
assert isinstance(win, DockableWindow) |
454 |
|
|
455 |
assert(win.IsDocked()) |
assert win.IsDocked() |
456 |
|
|
457 |
rect = event.GetDragRect() |
rect = event.GetDragRect() |
458 |
|
|