| 1 | |
| 2 | from wxPython.wx import * |
| 3 | |
| 4 | #---------------------------------------------------------------------- |
| 5 | |
| 6 | ## class MyFontEnumerator(wxFontEnumerator): |
| 7 | ## def __init__(self, list): |
| 8 | ## wxFontEnumerator.__init__(self) |
| 9 | ## self.list = list |
| 10 | |
| 11 | ## def OnFacename(self, face): |
| 12 | ## self.list.append(face) |
| 13 | ## return true |
| 14 | |
| 15 | |
| 16 | |
| 17 | class TestPanel(wxPanel): |
| 18 | def __init__(self, parent, log): |
| 19 | wxPanel.__init__(self, parent, -1) |
| 20 | |
| 21 | ## list = [] |
| 22 | ## e = MyFontEnumerator(list) |
| 23 | ## e.EnumerateFacenames() |
| 24 | |
| 25 | e = wxFontEnumerator() |
| 26 | e.EnumerateFacenames() |
| 27 | list = e.GetFacenames() |
| 28 | |
| 29 | list.sort() |
| 30 | |
| 31 | wxStaticText(self, -1, "Face names:", wxPoint(15, 50), wxSize(65, 18)) |
| 32 | self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(200, 250), |
| 33 | list, wxLB_SINGLE) |
| 34 | self.lb1.SetSelection(0) |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | #---------------------------------------------------------------------- |
| 40 | |
| 41 | def runTest(frame, nb, log): |
| 42 | win = TestPanel(nb, log) |
| 43 | return win |
| 44 | |
| 45 | #---------------------------------------------------------------------- |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | overview = """\ |
| 59 | wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding. |
| 60 | |
| 61 | """ |