def __init__(self, parent, prefsIO): wx.Panel.__init__(self, parent, -1) # members self._filetrs = xFiles() # Associate files/trsdata self._selection = None # the index of the selected trsdata panel self._clipboard = None # Used to cut and paste self._prefsIO = prefsIO # create the client panel sizer = wx.BoxSizer(wx.VERTICAL) toolbar = self._create_toolbar() sizer.Add(toolbar, proportion=0, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=4) self._trspanel = self._create_content() sizer.Add(self._trspanel, proportion=2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=4) # Bind events self._trspanel.Bind(spEVT_PANEL_SELECTED, self.OnPanelSelection) self.Bind(spEVT_FILE_WANDER, self.OnFileWander) self.Bind(spEVT_SETTINGS, self.OnSettings) self.Bind(wx.EVT_BUTTON, self.ProcessEvent) self.SetBackgroundColour(prefsIO.GetValue('M_BG_COLOUR')) self.SetForegroundColour(prefsIO.GetValue('M_FG_COLOUR')) self.SetFont(prefsIO.GetValue('M_FONT')) self.SetSizer(sizer) self.Layout()
def __init__(self, parent, prefsIO): """ Constructor. """ wx.Panel.__init__(self, parent, -1, style=wx.NO_BORDER) sizer = wx.BoxSizer(wx.VERTICAL) # members self._prefsIO = self._check_prefs(prefsIO) self._xfiles = xFiles() # the display panel dp = self._set_display() # the navigation bar: a set of panels: self._trans, self._media, self._navig sp = self._set_navigation() # put the panels in a sizer sizer.Add(dp, 1, wx.TOP|wx.EXPAND, border=0) sizer.Add(sp, 0, wx.BOTTOM|wx.EXPAND, border=0) # events self.Bind(wx.EVT_SIZE, self.OnSize) self.GetTopLevelParent().Bind(wx.EVT_CHAR_HOOK, self.OnKeyPress) self.Bind(spEVT_FILE_WANDER, self.OnFileWander) self.Bind(spEVT_SETTINGS, self.OnSettings) self.Bind(spEVT_OBJECT_SELECTED, self.OnObjectSelected) self.SetBackgroundColour(self._prefsIO.GetValue('M_BG_COLOUR')) self.SetSizer(sizer) self.SetAutoLayout(True) self.Layout()
def __init__(self, parent, ID=0, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, prefsIO=None): wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, -1, style=wx.TAB_TRAVERSAL | wx.NO_BORDER) # members self._xfiles = xFiles() self._prefsIO = self._check_prefs(prefsIO) try: self._ccbmultiple = self._prefsIO.GetValue('F_CCB_MULTIPLE') except Exception: self._ccbmultiple = False # ... the list of files self._ccbsizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self._ccbsizer) spEVT_FILE_CHECK(self, self.OnCheck) spEVT_FILE_WANDER(self, self.OnWander) spEVT_SETTINGS(self, self.OnSettings) self.SetBackgroundColour(self._prefsIO.GetValue('M_BG_COLOUR')) self.SetSize(wx.Size(180, 300)) self.SetAutoLayout(True) self.Layout() self.SetupScrolling()
def __init__(self, parent, prefsIO): wx.Window.__init__(self, parent, -1, style=wx.NO_BORDER) self.SetBackgroundColour(prefsIO.GetValue('M_BG_COLOUR')) box = wx.BoxSizer(wx.VERTICAL) # members self._prefsIO = prefsIO self._xfiles = xFiles() # The component can deal with multiple files, or not. self._multiplefiles = False # a notebook self._set_notebook() # Do not show an empty notebook: create an empty page self.AddEmptyPage() # Events self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_CLOSE, self.OnClose) self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged) self.Bind(spEVT_NOTEBOOK_NEW_PAGE, self.OnNewPage) self.Bind(spEVT_NOTEBOOK_CLOSE_PAGE, self.OnClosePage) self.Bind(spEVT_SETTINGS, self.OnSettings) self.Bind(spEVT_FILE_WANDER, self.OnFileWander) box.Add(self._notebook, 1, wx.EXPAND) self.SetSizer(box) self._LayoutFrame()
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, prefsIO = None): """Constructor. Non-wxPython related parameter: - prefsIO [REQUIRED] """ style = wx.NO_BORDER | wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_CHILDREN | wx.WANTS_CHARS wx.Window.__init__(self, parent, id, pos, size=(MIN_W, MIN_H), style=style) self.SetDoubleBuffered(True) self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) self.SetBackgroundColour(prefsIO.GetValue('M_BG_COLOUR')) self.SetMinSize((MIN_W, MIN_H)) # Members self._xfiles = xFiles() self._prefsIO = prefsIO # Members indicating the current state self._mousescroll = None self._ymax = 0 # Tools (period, ruler, ...) self.__set_tools() # Set initial dc mode to fast self._reInitBuffer = False self.InitBuffer() # Bind events self.__bind_events() # Start the background redraw timer. self.redrawTimer = wx.Timer(self) self.redrawTimer.Start(10)