]> git.saurik.com Git - wxWidgets.git/commitdiff
Since it is documented, changed GetOrCreateCellAttr from protected to
authorRobin Dunn <robin@alldunn.com>
Fri, 3 Sep 2004 19:30:19 +0000 (19:30 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 3 Sep 2004 19:30:19 +0000 (19:30 +0000)
public so it can be used from wxPython.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/grid.h
src/generic/grid.cpp
wxPython/docs/CHANGES.txt
wxPython/src/grid.i

index 4e1fe217ea4d4911a61d9010bca8255a394c87fb..acc6edbbbb53e0b87450f1c66624339d35ca1e46 100644 (file)
@@ -1310,6 +1310,13 @@ public:
     void     SetRowAttr(int row, wxGridCellAttr *attr);
     void     SetColAttr(int col, wxGridCellAttr *attr);
 
+    // returns the attribute we may modify in place: a new one if this cell
+    // doesn't have any yet or the existing one if it does
+    //
+    // DecRef() must be called on the returned pointer, as usual
+    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+    
     // shortcuts for setting the column parameters
 
     // set the format for the data in the column: default is string
@@ -1794,12 +1801,6 @@ protected:
     // do we have some place to store attributes in?
     bool CanHaveAttributes();
 
-    // returns the attribute we may modify in place: a new one if this cell
-    // doesn't have any yet or the existing one if it does
-    //
-    // DecRef() must be called on the returned pointer, as usual
-    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
-
     // cell attribute cache (currently we only cache 1, may be will do
     // more/better later)
     struct CachedAttr
index b712c67c1d66efbf67dd9807088f3cb35f4ba30a..67c696f3b71d85b877477613c2c8aebd2f2dc42b 100644 (file)
@@ -9097,9 +9097,10 @@ wxGridCellAttr *wxGrid::GetCellAttr(int row, int col) const
 wxGridCellAttr *wxGrid::GetOrCreateCellAttr(int row, int col) const
 {
     wxGridCellAttr *attr = (wxGridCellAttr *)NULL;
+    bool canHave = ((wxGrid*)this)->CanHaveAttributes();
 
-    wxCHECK_MSG( m_table, attr,
-                  _T("we may only be called if CanHaveAttributes() returned true and then m_table should be !NULL") );
+    wxCHECK_MSG( canHave, attr, _T("Cell attributes not allowed"));
+    wxCHECK_MSG( m_table, attr, _T("must have a table") );
 
     attr = m_table->GetAttr(row, col, wxGridCellAttr::Cell);
     if ( !attr )
index 026d4dffd00507326cf364c1a3b9f0a16f1afd49..b3b4cfb751d8b72b7bb0f67a4ab02592e1bd64b4 100644 (file)
@@ -16,26 +16,31 @@ wx.grid.Grid fix allowing DoGetBestSize to be called before CreateGrid
 wxMac fix for not sending a native click to a control if it is not
 enabled (does an enable itself)
 
-Added wx.ogl.DrawShape
+Added wx.lib.ogl.DrawnShape
 
 Added support to XRC and XRCed for the 3-state checkbox flags and also
 for wx.ToggleButton.  Updated the generic window styles supported by
 XRCed. 
 
 It is now possible to create "stock" buttons.  Basically this means
-that you only have to provide one of the stock IDs (and an empty
-label) when creating the button and wxWidgets will choose the stock
-label to go with it automatically.  Additionally on the platforms that
-have a native concept of a stock button (currently only GTK2) then the
-native stock button will be used.  For example, the following will
-result in a button with "Cancel" as the label and an accelerator on
-the "C", and if on wxGTK2 there will be an image of a red X::
+that you only have to provide one of the stock IDs (and either an
+empty label or a label that matches the stock label) when creating the
+button and wxWidgets will choose the stock label to go with it
+automatically.  Additionally on the platforms that have a native
+concept of a stock button (currently only GTK2) then the native stock
+button will be used.  For example, the following will result in a
+button with "Cancel" as the label and an accelerator on the "C", and
+if run on wxGTK2 then there will also be an image of a red X::
 
        b = wx.Button(parent, wx.ID_CANCEL) 
 
 
 Added wx.lib.ticker.Ticker class from Chris Mellon.
 
+Fix some incorrect clipping regions in wxSTC on wxGTK.
+
+Added wrapper for wx.grid.Grid.GetOrCreateCellAttr.
+
 
 
 
index c06a70336330752e09d82e99f63de57caad99239..90d185537869269b257116285daaa8a5cd0c86a4 100644 (file)
@@ -1820,6 +1820,13 @@ public:
     void     SetRowAttr(int row, wxGridCellAttr *attr);
     void     SetColAttr(int col, wxGridCellAttr *attr);
 
+    // returns the attribute we may modify in place: a new one if this cell
+    // doesn't have any yet or the existing one if it does
+    //
+    // DecRef() must be called on the returned pointer, as usual
+    wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const;
+
+    
     // shortcuts for setting the column parameters
 
     // set the format for the data in the column: default is string