]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/GridSimple.py
Another package name fix
[wxWidgets.git] / wxPython / demo / GridSimple.py
index 156839a6a666eac69403b01743c870caa1ace7cb..0748d09f7e16b2929eb8ade1ac869032d51376e6 100644 (file)
@@ -14,7 +14,7 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin):
 
         self.Bind(wx.EVT_IDLE, self.OnIdle)
 
-        self.CreateGrid(25, 25) #, wxGrid.wxGridSelectRows)
+        self.CreateGrid(25, 25)#, gridlib.Grid.SelectRows)
         ##self.EnableEditing(False)
 
         # simple cell formatting
@@ -57,7 +57,7 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin):
         self.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_BOTTOM)
 
         #self.SetDefaultCellOverflow(False)
-        #r = wxGridCellAutoWrapStringRenderer()
+        #r = gridlib.GridCellAutoWrapStringRenderer()
         #self.SetCellRenderer(9, 1, r)
 
         # overflow cells
@@ -72,7 +72,11 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin):
         self.SetCellEditor(0, 4, editor)
         self.SetCellValue(0, 4, "Limited text")
 
+        renderer = gridlib.GridCellAutoWrapStringRenderer()
+        self.SetCellRenderer(15,0, renderer)
+        self.SetCellValue(15,0, "The text in this cell will be rendered with word-wrapping")
 
+        
         # test all the events
         self.Bind(gridlib.EVT_GRID_CELL_LEFT_CLICK, self.OnCellLeftClick)
         self.Bind(gridlib.EVT_GRID_CELL_RIGHT_CLICK, self.OnCellRightClick)
@@ -230,7 +234,7 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin):
 class TestFrame(wx.Frame):
     def __init__(self, parent, log):
         wx.Frame.__init__(self, parent, -1, "Simple Grid Demo", size=(640,480))
-        grid = SimpleGrid(self, log)
+        self.grid = SimpleGrid(self, log)
 
 
 
@@ -241,6 +245,9 @@ if __name__ == '__main__':
     app = wx.PySimpleApp()
     frame = TestFrame(None, sys.stdout)
     frame.Show(True)
+    #import wx.py
+    #shell = wx.py.shell.ShellFrame(frame, locals={'wx':wx, 'frame':frame})
+    #shell.Show()
     app.MainLoop()