def OnMisc(self, event = None): if (self.tsIndex == -1) or self.block: return ts = self.titles.pages[self.pageIndex][self.tsIndex] ts.items = [util.toInputStr(s) for s in misc.fromGUI(self.textEntry.GetValue()).split("\n")] self.stringsLb.SetString(self.tsIndex, "--".join(ts.items)) ts.x = util.str2float(self.xEntry.GetValue(), 0.0) ts.y = util.str2float(self.yEntry.GetValue(), 0.0) ts.setAlignment(self.alignCombo.GetClientData(self.alignCombo.GetSelection())) self.xEntry.Enable(not ts.isCentered) ts.size = util.getSpinValue(self.sizeEntry) ts.font = self.fontCombo.GetClientData(self.fontCombo.GetSelection()) ts.isBold = self.boldCb.GetValue() ts.isItalic = self.italicCb.GetValue() ts.isUnderlined = self.underlinedCb.GetValue() self.previewCtrl.Refresh()
def OnMisc(self, event=None): if (self.tsIndex == -1) or self.block: return ts = self.titles.pages[self.pageIndex][self.tsIndex] ts.items = [ util.toInputStr(s) for s in misc.fromGUI(self.textEntry.GetValue()).split("\n") ] self.stringsLb.SetString(self.tsIndex, "--".join(ts.items)) ts.x = util.str2float(self.xEntry.GetValue(), 0.0) ts.y = util.str2float(self.yEntry.GetValue(), 0.0) ts.setAlignment( self.alignCombo.GetClientData(self.alignCombo.GetSelection())) self.xEntry.Enable(not ts.isCentered) ts.size = util.getSpinValue(self.sizeEntry) ts.font = self.fontCombo.GetClientData(self.fontCombo.GetSelection()) ts.isBold = self.boldCb.GetValue() ts.isItalic = self.italicCb.GetValue() ts.isUnderlined = self.underlinedCb.GetValue() self.previewCtrl.Refresh()
def load(self, s): a = util.fromUTF8(s).split(",", 6) if len(a) != 7: return self.x = util.str2float(a[0], 0.0) self.y = util.str2float(a[1], 0.0) self.size = util.str2int(a[2], 12, 4, 288) self.isCentered, self.isRightJustified, self.isBold, self.isItalic, \ self.isUnderlined = util.flags2bools(a[3], "crbiu") tmp = { "Courier" : pml.COURIER, "Helvetica" : pml.HELVETICA, "Times" : pml.TIMES_ROMAN } self.font = tmp.get(a[4], pml.COURIER) self.items = util.unescapeStrings(a[6])
def load(self, s): a = util.fromUTF8(s).split(",", 6) if len(a) != 7: return self.x = util.str2float(a[0], 0.0) self.y = util.str2float(a[1], 0.0) self.size = util.str2int(a[2], 12, 4, 288) self.isCentered, self.isRightJustified, self.isBold, self.isItalic, \ self.isUnderlined = util.flags2bools(a[3], "crbiu") tmp = { "Courier": pml.COURIER, "Helvetica": pml.HELVETICA, "Times": pml.TIMES_ROMAN } self.font = tmp.get(a[4], pml.COURIER) self.items = util.unescapeStrings(a[6])
def fromStr(self, vals, val, prefix): return util.str2float(val, self.defVal, self.minVal, self.maxVal)
def entry2float(self, entry, name, factor=1.0): val = util.str2float(entry.GetValue(), 0.0) * factor setattr(self.cfg, name, val)