X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83625579234e2dfd760c7380d267f0f0c1e53be6..9e58eb5674cfac859568c9a4b1030012e1f0eb64:/wxPython/demo/wxGrid.py diff --git a/wxPython/demo/wxGrid.py b/wxPython/demo/wxGrid.py index 3cfe506aa3..78eae6b678 100644 --- a/wxPython/demo/wxGrid.py +++ b/wxPython/demo/wxGrid.py @@ -1,34 +1,41 @@ +# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# -from wxPython.wx import * +import wx #--------------------------------------------------------------------------- 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'), + 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): +class ButtonPanel(wx.Panel): def __init__(self, parent, log): - wxPanel.__init__(self, parent, -1) + wx.Panel.__init__(self, parent, -1) self.log = log - box = wxBoxSizer(wxVERTICAL) - box.Add(20, 30) + box = wx.BoxSizer(wx.VERTICAL) + box.Add((20, 20)) 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) + btn = wx.Button(self, k, text) + box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 10) + self.Bind(wx.EVT_BUTTON, self.OnButton, btn) - self.SetAutoLayout(true) + self.SetAutoLayout(True) self.SetSizer(box) @@ -36,7 +43,7 @@ class ButtonPanel(wxPanel): modName = buttonDefs[evt.GetId()][0] module = __import__(modName) frame = module.TestFrame(None, self.log) - frame.Show(true) + frame.Show(True) #--------------------------------------------------------------------------- @@ -49,13 +56,6 @@ def runTest(frame, nb, log): - - - - - - - overview = """\
-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. """ + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) +