Dear Cristina,
I use this functionality. In fact, I introduced this feature in wx-widgets
because I needed it at that time ;-.
You may find some more details in the patch, the ID is 735595, see:
http://sourceforge.net/tracker/index.php?func=detail&aid=735595&group_id=9863&atid=309863
For your convenience, I attach the documentation I added in that patch (when
it was finally accepted, only a small portion of that documentation was
incorporated in grid.h for reasons beyond my understanding).
Regarding your problem, are you sure you need these members, and not just
SetColMinimalWidth or SetRowMinimalHeight?
The member SetRowMinimalAcceptableHeight() and its column-counterpart define
the boundaries for those two members. You need to call these if you are going
to allow cells smaller than WXGRID_MIN_ROW_HEIGHT, WXGRID_MIN_COL_WIDTH.
Presently these are set to 15, which is less than the argument you have in
your code (40).
The presence of minimum-minimum-value functions seems odd, but is related to
the efficiency of row- and column-finding functions (there are granularity
issues there). I can provide more details if you are really interested.
With kind Regards,
Jan van Dijk.
+ /* These two members can be used to query and modify the minimal
+ * acceptable size of grid rows and columns. In the implementation of
+ * wxGrid and related functions and classes these replace the macros
+ * WXGRID_MIN_ROW_HEIGHT and WXGRID_MIN_COL_WIDTH. This allows users
+ * to override these defaults to allow for grids with smaller cells.
+ *
+ * These numbers are the lower boundaries for the arguments which are
+ * passed to the two versions above for setting per row/column minimum
+ * sizes. Like the members SetColMinimalWidth and SetRowMinimalWidth,
+ * the two Set members below must be called during grid creation,
because
+ * the existing rows or columns will not be resized if necessary.
+ *
+ * Notes:
+ * * In order to keep backwards compatibility, these bits of state
+ * information cannot be stored in member variables in the 2.4 series.
+ * Hence the implementations of these functions use auxiliary static
+ * functions which hold the numbers as static data (see grid.cpp).
+ * * Those data are initialised to according to the values of the macros
+ * WXGRID_MIN_ROW_HEIGHT and WXGRID_MIN_COL_WIDTH. This ensures
+ * complete backward compatibility. There is guaranteed to be no
+ * effect of this change, unless you actually call this function.
+ * * In the 2.6 series, the behaviour of these functions will change.
The
+ * minimal acceptable height and width will be stored in member
+ * variables, so calling these members only affects the class on which
+ * they are called.
+ */
···
On Tuesday 21 February 2006 00:09, C. Iacob wrote:
Hi list,
I did not find any example showing how to use
SetRowMinimalAcceptableHeight(). Did anyone use it yet? The help
claims: "This should normally be called when creating the grid
because it will not resize existing rows with sizes smaller than the
value specified here."
I tried:
DbvalGrid::DbvalGrid(wxWindow* parent, int id):
wxGrid(parent, id)
{ SetRowMinimalAcceptableHeight(40);
}
but it doesn't seem to work.
Regards,
Cristina.
+
--
If I haven't seen further, it is by standing in the footprints of giants