X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a693e6e0460b6b3c32e4b6f114a3ab7b7cd24ea..f6bcfd974ef26faf6f91a62cac09827e09463fd1:/wxPython/demo/wxGrid.py?ds=sidebyside diff --git a/wxPython/demo/wxGrid.py b/wxPython/demo/wxGrid.py new file mode 100644 index 0000000000..1e3b81606d --- /dev/null +++ b/wxPython/demo/wxGrid.py @@ -0,0 +1,100 @@ + +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'), + } + + +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, 15) + 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(self, 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. +
+
+
+
+
+You can also look at the SWIG interface +file used to generate the grid module for a lot more clues as to +how things work. + +""" +