Beispiel #1
0
 def OnInsert(self, event):
     if not self.checkBox1.GetValue():
         self.backgroundColour = wx.Colour(255, 255, 255)
     label = self.textCtrl1.GetValue()
     separator='#---%s---%s%s%s'%(\
         label,
         wxColour2html(self.foregroundColour),
         wxColour2html(self.backgroundColour),
         sm.zfill('-',(59-len(label))).replace('0','-'))
     self.GetParent().source.ReplaceSelection(separator)
     self.Close()
Beispiel #2
0
 def OnInsert(self, event):
     if not self.checkBox1.GetValue():
         self.backgroundColour = wx.Colour(255, 255, 255)
     label = self.textCtrl1.GetValue()
     separator = "#---%s---%s%s%s" % (
         label,
         wxColour2html(self.foregroundColour),
         wxColour2html(self.backgroundColour),
         sm.zfill("-", (59 - len(label))).replace("0", "-"),
     )
     self.GetParent().source.ReplaceSelection(separator)
     self.Close()
Beispiel #3
0
def wxColour2html(c):
    return ('#%s%s%s' %
            tuple(map(lambda x: sm.zfill(hex(x)[2:], 2), c.Get()))).upper()
Beispiel #4
0
def wxColour2html(c):
    return ("#%s%s%s" % tuple(map(lambda x: sm.zfill(hex(x)[2:], 2), c.Get()))).upper()