def __init__( self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, name="footer", ): self.hauteur = 24 self.afficherColonneDroite = True self.listview = None self.dictColonnes = {} self.dictTotaux = {} self.listeImpression = [] Control.__init__(self, parent, id=id, pos=pos, size=size, style=style, name=name) self.SetInitialSize(size) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) self.Bind(wx.EVT_SIZE, self.MAJ_affichage)
def __init__( self, parent, id=-1, pages=[], # list of pages or a text fgcolor=wx.BLACK, # text/foreground color bgcolor=None, # background color start=True, # if True, the newsticker starts immediately ppf=2, # pixels per frame fps=20, # frames per second pauseTime=2000, # Pause time (in milliseconds) headingStyle=5, # Style of heading : 1, 2, 3, 4 ou 5 or None for no heading pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, name="Newsticker"): Control.__init__(self, parent, id=id, pos=pos, size=size, style=style, name=name) self.timer = wx.Timer(self, -1) self.timerPause = wx.Timer(self, -1) self.textSize = (-1, -1) self.decalage = 0 self._fps = fps self._ppf = ppf self.pauseTime = pauseTime self.pause = False self.pauseTemp = False self.indexPage = 0 self.headingStyle = headingStyle self.headingHeight = 0 self.SetPages(pages) self.SetInitialSize(size) if fgcolor != None: self.SetForegroundColour(fgcolor) if bgcolor != None: self.SetBackgroundColour(bgcolor) self.Bind(wx.EVT_TIMER, self.OnTick, self.timer) self.Bind(wx.EVT_TIMER, self.OnPause, self.timerPause) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave) if start: self.Start()
def __init__(self, parent, id=-1, pages=[], # list of pages or a text fgcolor = wx.BLACK, # text/foreground color bgcolor = None, # background color start=True, # if True, the newsticker starts immediately ppf=2, # pixels per frame fps=20, # frames per second pauseTime = 2000, # Pause time (in milliseconds) headingStyle = 5, # Style of heading : 1, 2, 3, 4 ou 5 or None for no heading pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, name="Newsticker" ): Control.__init__(self, parent, id=id, pos=pos, size=size, style=style, name=name) self.timer = wx.Timer(self, -1) self.timerPause = wx.Timer(self, -1) self.textSize = (-1, -1) self.decalage = 0 self._fps = fps self._ppf = ppf self.pauseTime = pauseTime self.pause = False self.pauseTemp = False self.indexPage = 0 self.headingStyle = headingStyle self.headingHeight = 0 self.SetPages(pages) self.SetInitialSize(size) if fgcolor != None : self.SetForegroundColour(fgcolor) if bgcolor != None : self.SetBackgroundColour(bgcolor) self.Bind(wx.EVT_TIMER, self.OnTick, self.timer) self.Bind(wx.EVT_TIMER, self.OnPause, self.timerPause) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave) if start: self.Start()
def __init__(self, parent, images, names=None): # call parent __init__() wxControl.__init__(self, parent=parent, id=wxID_ANY, pos=wxDefaultPosition, size=wxDefaultSize, style=wxNO_BORDER, validator=wxDefaultValidator, name="") # PARAMETERS self.parent = parent # single image: if isinstance(images, wxBitmap): self.images = [images] if isinstance(names, str): self.names = [names] # list of images elif isinstance(images, list): self.images = images self.names = names # dictionary images else: self.images = images.Values() self.names = images.Keys() # status is an index or a name self.status = 0 # get png size from first image w, h = self.images[self.status].GetSize() self.SetSize((w, h)) # BINDINGS self.Bind(wxEVT_ERASE_BACKGROUND, self._onEraseBackground) self.Bind(wxEVT_PAINT, self._onPaint) # done return
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, name="footer", ): self.hauteur = 24 self.afficherColonneDroite = True self.listview = None self.dictColonnes = {} self.dictTotaux = {} self.listeImpression = [] Control.__init__(self, parent, id=id, pos=pos, size=size, style=style, name=name) self.SetInitialSize(size) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) self.Bind(wx.EVT_SIZE, self.MAJ_affichage)
def __init__(self, parent, id=-1, texte=u"", couleurClaire=(255, 255, 255), couleurFoncee=(255, 0, 0), selection=False, taille=wx.DefaultSize): Control.__init__(self, parent, id=id, pos=wx.DefaultPosition, size=taille, style=wx.NO_BORDER, name="boutonToggle") self.parent = parent self.texte = texte self.couleurClaire = couleurClaire self.couleurFoncee = couleurFoncee self.couleurSelection = (0, 255, 0) self.selection = selection self.survol = False self.marge = 10 self.bestSize = (-1, -1) # Ajustement de la hauteur du contrĂ´le dc = wx.ClientDC(self) dc.SetFont( wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "MS Shell Dlg 2")) largeur, hauteur = self.DrawTexte(dc) self.SetClientSize((largeur, hauteur)) self.SetSize(self.GetClientSize()) self.SetInitialSize(self.GetClientSize()) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, lambda x: None) self.Bind(wx.EVT_MOTION, self.OnMotion) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
def __init__(self, parent, id=-1, texte=u"", couleurClaire=(255, 255, 255), couleurFoncee=(255, 0, 0), selection=False, taille=wx.DefaultSize): Control.__init__(self, parent, id=id, pos=wx.DefaultPosition, size=taille, style=wx.NO_BORDER, name="boutonToggle") self.parent = parent self.texte = texte self.couleurClaire = couleurClaire self.couleurFoncee = couleurFoncee self.couleurSelection = (0, 255, 0) self.selection = selection self.survol = False self.marge = 10 self.bestSize = (-1, -1) # Ajustement de la hauteur du contrĂ´le dc = wx.ClientDC(self) dc.SetFont(wx.Font(24, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "MS Shell Dlg 2")) largeur, hauteur = self.DrawTexte(dc) self.SetClientSize((largeur, hauteur)) self.SetSize(self.GetClientSize()) self.SetInitialSize(self.GetClientSize()) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, lambda x:None) self.Bind(wx.EVT_MOTION, self.OnMotion) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)