from wxPython.wx import * #--------------------------------------------------------------------------- buttonDefs = { 814 : ('GridSimple', ' Simple wxGrid, catching all events '), 815 : ('GridStdEdRend', ' wxGrid showing Editors and Renderers '), 818 : ('GridHugeTable', ' A wxGrid with a HUGE table (100 MILLION cells!) '), 817 : ('GridCustTable', ' wxGrid using a custom Table, with non-string data '), 819 : ('GridEnterHandler',' Remapping keys to behave differently '), 820 : ('GridCustEditor', ' Shows how to create a custom Cell Editor '), 821 : ('GridDragable', ' A wxGrid with dragable rows and columns '), 822 : ('GridDragAndDrop', 'Shows how to make a grid a drop target for files'), } class ButtonPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) self.log = log box = wxBoxSizer(wxVERTICAL) box.Add(20, 30) keys = buttonDefs.keys() keys.sort() for k in keys: text = buttonDefs[k][1] btn = wxButton(self, k, text) box.Add(btn, 0, wxALIGN_CENTER|wxALL, 10) EVT_BUTTON(self, k, self.OnButton) self.SetAutoLayout(True) self.SetSizer(box) def OnButton(self, evt): modName = buttonDefs[evt.GetId()][0] module = __import__(modName) frame = module.TestFrame(None, self.log) frame.Show(True) #--------------------------------------------------------------------------- def runTest(frame, nb, log): win = ButtonPanel(nb, log) return win #--------------------------------------------------------------------------- overview = """\
You can look at the sources for these samples to learn a lot about how the new classes work.
""" if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])])