Add documentation for several grid cell renderer/editor classes.
Document the previously undocumented renderers and editors. Closes #11965. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -148,7 +148,7 @@ private:
|
|||||||
|
|
||||||
#include "wx/datetime.h"
|
#include "wx/datetime.h"
|
||||||
|
|
||||||
// the default renderer for the cells containing Time and dates..
|
// the default renderer for the cells containing times and dates
|
||||||
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
|
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -170,7 +170,7 @@ public:
|
|||||||
|
|
||||||
virtual wxGridCellRenderer *Clone() const;
|
virtual wxGridCellRenderer *Clone() const;
|
||||||
|
|
||||||
// parameters string format is "width[,precision]"
|
// output strptime()-like format string
|
||||||
virtual void SetParameters(const wxString& params);
|
virtual void SetParameters(const wxString& params);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -184,7 +184,7 @@ protected:
|
|||||||
|
|
||||||
#endif // wxUSE_DATETIME
|
#endif // wxUSE_DATETIME
|
||||||
|
|
||||||
// the default renderer for the cells containing Time and dates..
|
// renders a number using the corresponding text string
|
||||||
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer
|
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -205,7 +205,8 @@ public:
|
|||||||
|
|
||||||
virtual wxGridCellRenderer *Clone() const;
|
virtual wxGridCellRenderer *Clone() const;
|
||||||
|
|
||||||
// parameters string format is "item1[,item2[...,itemN]]"
|
// parameters string format is "item1[,item2[...,itemN]]" where itemN will
|
||||||
|
// be used if the cell value is N-1
|
||||||
virtual void SetParameters(const wxString& params);
|
virtual void SetParameters(const wxString& params);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -18,8 +18,10 @@
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellBoolRenderer, wxGridCellFloatRenderer,
|
@see wxGridCellAutoWrapStringRenderer, wxGridCellBoolRenderer,
|
||||||
wxGridCellNumberRenderer, wxGridCellStringRenderer
|
wxGridCellDateTimeRenderer, wxGridCellEnumRenderer,
|
||||||
|
wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
||||||
|
wxGridCellStringRenderer
|
||||||
*/
|
*/
|
||||||
class wxGridCellRenderer
|
class wxGridCellRenderer
|
||||||
{
|
{
|
||||||
@@ -50,6 +52,31 @@ public:
|
|||||||
int row, int col) = 0;
|
int row, int col) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxGridCellAutoWrapStringRenderer
|
||||||
|
|
||||||
|
This class may be used to format string data in a cell. The too
|
||||||
|
long lines are wrapped to be shown entirely at word boundaries.
|
||||||
|
|
||||||
|
@library{wxadv}
|
||||||
|
@category{grid}
|
||||||
|
|
||||||
|
@see wxGridCellRenderer, wxGridCellBoolRenderer,
|
||||||
|
wxGridCellDateTimeRenderer, wxGridCellEnumRenderer,
|
||||||
|
wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
||||||
|
wxGridCellStringRenderer
|
||||||
|
*/
|
||||||
|
|
||||||
|
class wxGridCellAutoWrapStringRenderer : public wxGridCellStringRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
Default constructor.
|
||||||
|
*/
|
||||||
|
wxGridCellAutoWrapStringRenderer();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxGridCellBoolRenderer
|
@class wxGridCellBoolRenderer
|
||||||
|
|
||||||
@@ -58,7 +85,9 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellRenderer, wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellDateTimeRenderer, wxGridCellEnumRenderer,
|
||||||
|
wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
||||||
wxGridCellStringRenderer
|
wxGridCellStringRenderer
|
||||||
*/
|
*/
|
||||||
class wxGridCellBoolRenderer : public wxGridCellRenderer
|
class wxGridCellBoolRenderer : public wxGridCellRenderer
|
||||||
@@ -70,6 +99,85 @@ public:
|
|||||||
wxGridCellBoolRenderer();
|
wxGridCellBoolRenderer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxGridCellDateTimeRenderer
|
||||||
|
|
||||||
|
This class may be used to format a date/time data in a cell.
|
||||||
|
The class wxDateTime is used internally to display the local date/time
|
||||||
|
or to parse the string date entered in the cell thanks to the defined format.
|
||||||
|
|
||||||
|
@library{wxadv}
|
||||||
|
@category{grid}
|
||||||
|
|
||||||
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellBoolRenderer, wxGridCellEnumRenderer,
|
||||||
|
wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
||||||
|
wxGridCellStringRenderer
|
||||||
|
*/
|
||||||
|
class wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
Date/time renderer constructor.
|
||||||
|
|
||||||
|
@param outformat
|
||||||
|
strptime()-like format string used the parse the output date/time.
|
||||||
|
@param informat
|
||||||
|
strptime()-like format string used to parse the string entered in the cell.
|
||||||
|
*/
|
||||||
|
wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat,
|
||||||
|
const wxString& informat = wxDefaultDateTimeFormat);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the strptime()-like format string which will be used to parse
|
||||||
|
the date/time.
|
||||||
|
|
||||||
|
@param params
|
||||||
|
strptime()-like format string used to parse the date/time.
|
||||||
|
*/
|
||||||
|
virtual void SetParameters(const wxString& params);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxGridCellEnumRenderer
|
||||||
|
|
||||||
|
This class may be used to render in a cell a number as a textual
|
||||||
|
equivalent.
|
||||||
|
|
||||||
|
The corresponding text strings are specified as comma-separated items in
|
||||||
|
the string passed to this renderer ctor or SetParameters() method. For
|
||||||
|
example, if this string is @c "John,Fred,Bob" the cell will be rendered as
|
||||||
|
"John", "Fred" or "Bob" if its contents is 0, 1 or 2 respectively.
|
||||||
|
|
||||||
|
@library{wxadv}
|
||||||
|
@category{grid}
|
||||||
|
|
||||||
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellBoolRenderer, wxGridCellDateTimeRenderer,
|
||||||
|
wxGridCellFloatRenderer, wxGridCellNumberRenderer,
|
||||||
|
wxGridCellStringRenderer
|
||||||
|
*/
|
||||||
|
class wxGridCellEnumRenderer : public wxGridCellStringRenderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
Enum renderer ctor.
|
||||||
|
|
||||||
|
@param choices
|
||||||
|
Comma separated string parameters "item1[,item2[...,itemN]]".
|
||||||
|
*/
|
||||||
|
wxGridCellEnumRenderer( const wxString& choices = wxEmptyString );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the comma separated string content of the enum.
|
||||||
|
|
||||||
|
@param params
|
||||||
|
Comma separated string parameters "item1[,item2[...,itemN]]".
|
||||||
|
*/
|
||||||
|
virtual void SetParameters(const wxString& params);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxGridCellFloatRenderer
|
@class wxGridCellFloatRenderer
|
||||||
|
|
||||||
@@ -78,13 +186,17 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellNumberRenderer,
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellBoolRenderer, wxGridCellDateTimeRenderer,
|
||||||
|
wxGridCellEnumRenderer, wxGridCellNumberRenderer,
|
||||||
wxGridCellStringRenderer
|
wxGridCellStringRenderer
|
||||||
*/
|
*/
|
||||||
class wxGridCellFloatRenderer : public wxGridCellStringRenderer
|
class wxGridCellFloatRenderer : public wxGridCellStringRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
Float cell renderer ctor.
|
||||||
|
|
||||||
@param width
|
@param width
|
||||||
Minimum number of characters to be shown.
|
Minimum number of characters to be shown.
|
||||||
@param precision
|
@param precision
|
||||||
@@ -126,7 +238,9 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellFloatRenderer,
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellBoolRenderer, wxGridCellDateTimeRenderer,
|
||||||
|
wxGridCellEnumRenderer, wxGridCellFloatRenderer,
|
||||||
wxGridCellStringRenderer
|
wxGridCellStringRenderer
|
||||||
*/
|
*/
|
||||||
class wxGridCellNumberRenderer : public wxGridCellStringRenderer
|
class wxGridCellNumberRenderer : public wxGridCellStringRenderer
|
||||||
@@ -147,7 +261,9 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellRenderer, wxGridCellBoolRenderer, wxGridCellFloatRenderer,
|
@see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer,
|
||||||
|
wxGridCellBoolRenderer, wxGridCellDateTimeRenderer,
|
||||||
|
wxGridCellEnumRenderer, wxGridCellFloatRenderer,
|
||||||
wxGridCellNumberRenderer
|
wxGridCellNumberRenderer
|
||||||
*/
|
*/
|
||||||
class wxGridCellStringRenderer : public wxGridCellRenderer
|
class wxGridCellStringRenderer : public wxGridCellRenderer
|
||||||
@@ -160,7 +276,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxGridCellEditor
|
@class wxGridCellEditor
|
||||||
|
|
||||||
@@ -173,8 +288,10 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellFloatEditor,
|
@see wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor,
|
||||||
wxGridCellNumberEditor, wxGridCellTextEditor
|
wxGridCellChoiceEditor, wxGridCellEnumEditor,
|
||||||
|
wxGridCellFloatEditor, wxGridCellNumberEditor,
|
||||||
|
wxGridCellTextEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellEditor
|
class wxGridCellEditor
|
||||||
{
|
{
|
||||||
@@ -295,6 +412,24 @@ protected:
|
|||||||
virtual ~wxGridCellEditor();
|
virtual ~wxGridCellEditor();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxGridCellAutoWrapStringEditor
|
||||||
|
|
||||||
|
Grid cell editor for wrappable string/text data.
|
||||||
|
|
||||||
|
@library{wxadv}
|
||||||
|
@category{grid}
|
||||||
|
|
||||||
|
@see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
||||||
|
wxGridCellEnumEditor, wxGridCellFloatEditor,
|
||||||
|
wxGridCellNumberEditor, wxGridCellTextEditor
|
||||||
|
*/
|
||||||
|
class wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGridCellAutoWrapStringEditor();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxGridCellBoolEditor
|
@class wxGridCellBoolEditor
|
||||||
|
|
||||||
@@ -303,8 +438,10 @@ protected:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellEditor, wxGridCellChoiceEditor, wxGridCellFloatEditor,
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
wxGridCellNumberEditor, wxGridCellTextEditor
|
wxGridCellChoiceEditor, wxGridCellEnumEditor,
|
||||||
|
wxGridCellFloatEditor, wxGridCellNumberEditor,
|
||||||
|
wxGridCellTextEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellBoolEditor : public wxGridCellEditor
|
class wxGridCellBoolEditor : public wxGridCellEditor
|
||||||
{
|
{
|
||||||
@@ -340,13 +477,17 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellFloatEditor,
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
wxGridCellNumberEditor, wxGridCellTextEditor
|
wxGridCellBoolEditor, wxGridCellEnumEditor,
|
||||||
|
wxGridCellFloatEditor, wxGridCellNumberEditor,
|
||||||
|
wxGridCellTextEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellChoiceEditor : public wxGridCellEditor
|
class wxGridCellChoiceEditor : public wxGridCellEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
Choice cell renderer ctor.
|
||||||
|
|
||||||
@param count
|
@param count
|
||||||
Number of strings from which the user can choose.
|
Number of strings from which the user can choose.
|
||||||
@param choices
|
@param choices
|
||||||
@@ -355,18 +496,13 @@ public:
|
|||||||
If allowOthers is @true, the user can type a string not in choices
|
If allowOthers is @true, the user can type a string not in choices
|
||||||
array.
|
array.
|
||||||
*/
|
*/
|
||||||
|
//@{
|
||||||
wxGridCellChoiceEditor(size_t count = 0,
|
wxGridCellChoiceEditor(size_t count = 0,
|
||||||
const wxString choices[] = NULL,
|
const wxString choices[] = NULL,
|
||||||
bool allowOthers = false);
|
bool allowOthers = false);
|
||||||
/**
|
|
||||||
@param choices
|
|
||||||
An array of strings from which the user can choose.
|
|
||||||
@param allowOthers
|
|
||||||
If allowOthers is @true, the user can type a string not in choices
|
|
||||||
array.
|
|
||||||
*/
|
|
||||||
wxGridCellChoiceEditor(const wxArrayString& choices,
|
wxGridCellChoiceEditor(const wxArrayString& choices,
|
||||||
bool allowOthers = false);
|
bool allowOthers = false);
|
||||||
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parameters string format is "item1[,item2[...,itemN]]"
|
Parameters string format is "item1[,item2[...,itemN]]"
|
||||||
@@ -374,6 +510,33 @@ public:
|
|||||||
virtual void SetParameters(const wxString& params);
|
virtual void SetParameters(const wxString& params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class wxGridCellEnumEditor
|
||||||
|
|
||||||
|
Grid cell editor which displays an enum number as a textual equivalent
|
||||||
|
(eg. data in cell is 0,1,2 ... n the cell could be displayed as
|
||||||
|
"John","Fred"..."Bob" in the combo choice box).
|
||||||
|
|
||||||
|
@library{wxadv}
|
||||||
|
@category{grid}
|
||||||
|
|
||||||
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
|
wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
||||||
|
wxGridCellTextEditor, wxGridCellFloatEditor,
|
||||||
|
wxGridCellNumberEditor
|
||||||
|
*/
|
||||||
|
class wxGridCellEnumEditor : public wxGridCellChoiceEditor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
Enum cell editor ctor.
|
||||||
|
|
||||||
|
@param choices
|
||||||
|
Comma separated choice parameters "item1[,item2[...,itemN]]".
|
||||||
|
*/
|
||||||
|
wxGridCellEnumEditor( const wxString& choices = wxEmptyString );
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxGridCellTextEditor
|
@class wxGridCellTextEditor
|
||||||
|
|
||||||
@@ -382,8 +545,10 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
wxGridCellFloatEditor, wxGridCellNumberEditor
|
wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
||||||
|
wxGridCellEnumEditor, wxGridCellFloatEditor,
|
||||||
|
wxGridCellNumberEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellTextEditor : public wxGridCellEditor
|
class wxGridCellTextEditor : public wxGridCellEditor
|
||||||
{
|
{
|
||||||
@@ -408,13 +573,17 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellEditor, wxGridCellNumberEditor, wxGridCellBoolEditor,
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
wxGridCellTextEditor, wxGridCellChoiceEditor
|
wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
||||||
|
wxGridCellEnumEditor, wxGridCellNumberEditor,
|
||||||
|
wxGridCellTextEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellFloatEditor : public wxGridCellTextEditor
|
class wxGridCellFloatEditor : public wxGridCellTextEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
Float cell editor ctor.
|
||||||
|
|
||||||
@param width
|
@param width
|
||||||
Minimum number of characters to be shown.
|
Minimum number of characters to be shown.
|
||||||
@param precision
|
@param precision
|
||||||
@@ -436,8 +605,10 @@ public:
|
|||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{grid}
|
@category{grid}
|
||||||
|
|
||||||
@see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
@see wxGridCellEditor, wxGridCellAutoWrapStringEditor,
|
||||||
wxGridCellFloatEditor, wxGridCellTextEditor
|
wxGridCellBoolEditor, wxGridCellChoiceEditor,
|
||||||
|
wxGridCellEnumEditor, wxGridCellFloatEditor,
|
||||||
|
wxGridCellTextEditor
|
||||||
*/
|
*/
|
||||||
class wxGridCellNumberEditor : public wxGridCellTextEditor
|
class wxGridCellNumberEditor : public wxGridCellTextEditor
|
||||||
{
|
{
|
||||||
|
@@ -172,7 +172,7 @@ void wxGridCellDateTimeRenderer::SetParameters(const wxString& params)
|
|||||||
#endif // wxUSE_DATETIME
|
#endif // wxUSE_DATETIME
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxGridCellChoiceNumberRenderer
|
// wxGridCellEnumRenderer
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Renders a number as a textual equivalent.
|
// Renders a number as a textual equivalent.
|
||||||
// eg data in cell is 0,1,2 ... n the cell could be rendered as "John","Fred"..."Bob"
|
// eg data in cell is 0,1,2 ... n the cell could be rendered as "John","Fred"..."Bob"
|
||||||
|
Reference in New Issue
Block a user