position. Programmatically, call SetFloatable(true) and then
Float(true) to float, Float(false) to dock.
"""
position. Programmatically, call SetFloatable(true) and then
Float(true) to float, Float(false) to dock.
"""
def __init__(self,*_args,**_kwargs):
"""
In addition to the usual arguments, wxFloatBar accepts keyword
def __init__(self,*_args,**_kwargs):
"""
In addition to the usual arguments, wxFloatBar accepts keyword
self.title = ""
EVT_MOUSE_EVENTS(self, self.OnMouse)
self.parentframe = wxPyTypeCast(args[1], 'wxFrame')
self.title = ""
EVT_MOUSE_EVENTS(self, self.OnMouse)
self.parentframe = wxPyTypeCast(args[1], 'wxFrame')
def SetFloatable(self, float):
self.floatable = float
#Find the size of a title bar.
def SetFloatable(self, float):
self.floatable = float
#Find the size of a title bar.
test.SetClientSize(wxSize(0,0))
self.titleheight = test.GetSizeTuple()[1]
test.Destroy()
test.SetClientSize(wxSize(0,0))
self.titleheight = test.GetSizeTuple()[1]
test.Destroy()
def SetTitle(self, title):
self.title = title
if self.IsFloating():
self.floatframe.SetTitle(self.title)
def SetTitle(self, title):
self.title = title
if self.IsFloating():
self.floatframe.SetTitle(self.title)
def SetHome(self, frame):
"""
Called when docked, this will remove the toolbar from its
def SetHome(self, frame):
"""
Called when docked, this will remove the toolbar from its
def Float(self, bool):
"Floats or docks the toolbar programmatically."
if bool:
self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame')
clientsize = self.parentframe.GetClientSizeTuple()
def Float(self, bool):
"Floats or docks the toolbar programmatically."
if bool:
self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame')
clientsize = self.parentframe.GetClientSizeTuple()
- self.floatframe = wxMiniFrame(self.parentframe, -1, self.title, wxDefaultPosition, wxDefaultSize, wxTHICK_FRAME)
+ if self.title:
+ useStyle = wxDEFAULT_FRAME_STYLE
+ else:
+ useStyle = 0 #wxTHICK_FRAME
+ self.floatframe = wxMiniFrame(self.parentframe, -1, self.title,
+ style = useStyle)
self.floatframe.SetToolBar(self)
self.oldcolor = self.GetBackgroundColour()
barsize = self.GetSizeTuple()
self.floatframe.SetToolBar(self)
self.oldcolor = self.GetBackgroundColour()
barsize = self.GetSizeTuple()
-# self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight))
-# self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1]))
- self.floatframe.SetClientSize(wxSize(50,200))
+ self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight))
+ self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1]))
newpos = self.parentframe.GetPosition()
newpos.y = newpos.y + self.titleheight
self.floatframe.SetPosition(newpos)
self.floatframe.Show(true)
EVT_CLOSE(self.floatframe, self.OnDock)
newpos = self.parentframe.GetPosition()
newpos.y = newpos.y + self.titleheight
self.floatframe.SetPosition(newpos)
self.floatframe.Show(true)
EVT_CLOSE(self.floatframe, self.OnDock)
self.parentframe.SetSize(wxSize(0,0))
self.parentframe.SetSize(size)
self.SetBackgroundColour(self.oldcolor)
self.parentframe.SetSize(wxSize(0,0))
self.parentframe.SetSize(size)
self.SetBackgroundColour(self.oldcolor)
homepos = self.parentframe.GetPositionTuple()
homepos = homepos[0], homepos[1] + self.titleheight
floatpos = self.floatframe.GetPositionTuple()
homepos = self.parentframe.GetPositionTuple()
homepos = homepos[0], homepos[1] + self.titleheight
floatpos = self.floatframe.GetPositionTuple()
self.oldpos = (e.GetX(), e.GetY())
if e.Entering():
self.oldpos = (e.GetX(), e.GetY())
if e.ButtonUp():
self.oldpos = (e.GetX(), e.GetY())
if e.Entering():
self.oldpos = (e.GetX(), e.GetY())
if e.ButtonUp():
if self.IsFloating():
homepos = self.parentframe.GetPositionTuple()
homepos = homepos[0], homepos[1] + self.titleheight
if self.IsFloating():
homepos = self.parentframe.GetPositionTuple()
homepos = homepos[0], homepos[1] + self.titleheight
self.floatframe.SetPosition(pt)
def _SetFauxBarVisible(self, vis):
self.floatframe.SetPosition(pt)
def _SetFauxBarVisible(self, vis):
if vis:
if self.parentframe.GetToolBar() == None:
if not hasattr(self, 'nullbar'):
if vis:
if self.parentframe.GetToolBar() == None:
if not hasattr(self, 'nullbar'):