Example #1
0
 def on_btnFont_mouseClick(self, event):
     result = dialog.fontDialog(self, self.components.btnButton.font)
     if result.accepted:
         #color = result.color
         font = result.font
         for w in self.components.itervalues():
             if w.__class__.__name__.startswith(w.name[3:]):
                 w.font = font
         self.components.fldTextFieldNoBorder.font = font
Example #2
0
    def on_changeFont_command(self, event):
        which = event.target.name.replace("fnt", "")
        wName, wClass = self.components.wComponentList.stringSelection.split("  :  ")
#multicol        wName, wClass = self.components.wComponentList.getStringSelection()[0].split("  :  ")
        widget = self._comp[wName]
        f = widget.font
        if f is None:
            desc = font.fontDescription(widget.GetFont())
            f = font.Font(desc)
        result = dialog.fontDialog(self, f)
        if result.accepted:
            f = result.font
            self.components["fld"+which].text = "%s" % f
            self.updateComponent(which)
Example #3
0
 def on_wFont_mouseClick(self, event):
     wName, wClass = self.components.wComponentList.stringSelection.split(
         "  :  ")
     ##widget = self.components[wName]
     widget = self._comp[wName]
     f = widget.font
     if f is None:
         desc = font.fontDescription(widget.GetFont())
         f = font.Font(desc)
     result = dialog.fontDialog(self, f)
     if result.accepted:
         #color = dlg.getColor()
         f = result.font
         #self.components.wField.SetValue("%s;%s" % (f, color))
         self.components.wField.text = "%s" % f
         if self.autoAttributeUpdate:
             self.updateComponent()
Example #4
0
 def on_buttonFont_mouseClick(self, event):
     result = dialog.fontDialog(self)
     self.components.fldResults.text = "fontDialog result:\naccepted: %s\nColor: %s\nFont: %s" % (
         result.accepted, result.color, result.font)
Example #5
0
 def on_fontChoose_command(self, event):
     pp = pprint.PrettyPrinter(indent=4)
     result = dialog.fontDialog(self)
     if result.accepted:
         self.values[event.target._name] = pp.pformat(result.font).replace("\n", "")