More grid demos and some bugs fixed
Made (virtual method) callbacks into Python code more safe, and removed the confusion if there was a matching method in the base class. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,7 +8,9 @@ class SimpleGrid(wxGrid):
|
||||
wxGrid.__init__(self, parent, -1)
|
||||
self.log = log
|
||||
|
||||
self.CreateGrid(16, 16)
|
||||
self.CreateGrid(25, 25)
|
||||
|
||||
# simple cell formatting
|
||||
self.SetColSize(3, 200)
|
||||
self.SetRowSize(4, 45)
|
||||
self.SetCellValue(0, 0, "First cell")
|
||||
@@ -18,6 +20,16 @@ class SimpleGrid(wxGrid):
|
||||
self.SetCellTextColour(1, 1, wxRED)
|
||||
self.SetCellBackgroundColour(2, 2, wxCYAN)
|
||||
|
||||
# attribute objects let you keep a set of formatting values
|
||||
# in one spot, and reuse them if needed
|
||||
attr = wxGridCellAttr()
|
||||
attr.SetTextColour(wxBLACK)
|
||||
attr.SetBackgroundColour(wxRED)
|
||||
attr.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD))
|
||||
|
||||
# you can set cell attributes for the whole row (or column)
|
||||
self.SetRowAttr(5, attr)
|
||||
|
||||
|
||||
# test all the events
|
||||
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
|
||||
|
Reference in New Issue
Block a user