def __init__(self, id): self._templ = win32ui.LoadDialogResource(id) #print self._templ self._header = self._templ[0] self._dlg_rc = self._header[1] if len(self._header) > 4: pointsize = self._header[4][0] fontname = self._header[4][1] font = findfont(fontname, pointsize) self._cx = font._tm['tmAveCharWidth'] + 1 self._cy = font._tm['tmHeight'] else: print 'Extented dialog templates (DIALOGEX) not supported. Check dialog with id', id
def fitfont(self, fontname, str, margin=0): if self._rendered: raise error, 'displaylist already rendered' return self.usefont(findfont(fontname, 10))
def setfont(self, font, size): if self._rendered: raise error, 'displaylist already rendered' return self.usefont(findfont(font, size))