def __init__(self, name, designer, parent, ctrlClass): BookCtrlDTC.__init__(self, name, designer, parent, ctrlClass) self.windowStyles = \ ['wx.lib.flatnotebook.FNB_VC71', 'wx.lib.flatnotebook.FNB_FANCY_TABS', 'wx.lib.flatnotebook.FNB_TABS_BORDER_SIMPLE', 'wx.lib.flatnotebook.FNB_NO_X_BUTTON', 'wx.lib.flatnotebook.FNB_NO_NAV_BUTTONS', 'wx.lib.flatnotebook.FNB_MOUSE_MIDDLE_CLOSES_TABS', 'wx.lib.flatnotebook.FNB_BOTTOM', 'wx.lib.flatnotebook.FNB_NODRAG', 'wx.lib.flatnotebook.FNB_VC8', 'wx.lib.flatnotebook.FNB_X_ON_TAB', 'wx.lib.flatnotebook.FNB_BACKGROUND_GRADIENT', 'wx.lib.flatnotebook.FNB_COLORFUL_TABS', 'wx.lib.flatnotebook.FNB_DCLICK_CLOSES_TABS'] + self.windowStyles
def designTimeControl(self, position, size, args = None): if args is not None: args['style'] |= wx.lib.flatnotebook.FNB_NO_X_BUTTON args['style'] &= ~(wx.lib.flatnotebook.FNB_X_ON_TAB|wx.lib.flatnotebook.FNB_DCLICK_CLOSES_TABS) ctrl = BookCtrlDTC.designTimeControl(self, position, size, args) ctrl.Bind(wx.lib.flatnotebook.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChanged, id=ctrl.GetId()) ctrl.SetWindowStyleFlag = lambda s: None return ctrl
def designTimeDefaults(self, position=wx.DefaultPosition, size=wx.DefaultSize): defs = BookCtrlDTC.designTimeDefaults(self, position=wx.DefaultPosition, size=wx.DefaultSize) defs['style'] |= wx.lib.flatnotebook.FNB_NO_X_BUTTON defs['style'] &= ~(wx.lib.flatnotebook.FNB_X_ON_TAB | wx.lib.flatnotebook.FNB_DCLICK_CLOSES_TABS) return defs
def designTimeControl(self, position, size, args=None): if args is not None: args['style'] |= wx.lib.flatnotebook.FNB_NO_X_BUTTON args['style'] &= ~(wx.lib.flatnotebook.FNB_X_ON_TAB | wx.lib.flatnotebook.FNB_DCLICK_CLOSES_TABS) ctrl = BookCtrlDTC.designTimeControl(self, position, size, args) ctrl.Bind(wx.lib.flatnotebook.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChanged, id=ctrl.GetId()) ctrl.SetWindowStyleFlag = lambda s: None return ctrl
def writeImports(self): return '\n'.join( (BookCtrlDTC.writeImports(self), 'import wx.lib.flatnotebook'))
def events(self): return BookCtrlDTC.events(self) + ['FlatNotebookEvent']
def designTimeDefaults(self, position = wx.DefaultPosition, size = wx.DefaultSize): defs = BookCtrlDTC.designTimeDefaults(self, position = wx.DefaultPosition, size = wx.DefaultSize) defs['style'] |= wx.lib.flatnotebook.FNB_NO_X_BUTTON defs['style'] &= ~(wx.lib.flatnotebook.FNB_X_ON_TAB|wx.lib.flatnotebook.FNB_DCLICK_CLOSES_TABS) return defs