Removed wxPGProperty class overview docs from actual header file
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -569,258 +569,10 @@ wxPG_PROP_CLASS_SPECIFIC_2 = 0x00100000
|
||||
|
||||
/** @class wxPGProperty
|
||||
|
||||
wxPGProperty is base class for all wxPropertyGrid properties. In
|
||||
sections below we cover few related topics.
|
||||
wxPGProperty is base class for all wxPropertyGrid properties.
|
||||
|
||||
@li @ref pgproperty_properties
|
||||
@li @ref pgproperty_creating
|
||||
|
||||
@section pgproperty_properties Supplied Ready-to-use Property Classes
|
||||
|
||||
Here is a list and short description of supplied fully-functional
|
||||
property classes. They are located in either props.h or advprops.h.
|
||||
|
||||
@li @ref wxArrayStringProperty
|
||||
@li @ref wxBoolProperty
|
||||
@li @ref wxColourProperty
|
||||
@li @ref wxCursorProperty
|
||||
@li @ref wxDateProperty
|
||||
@li @ref wxDirProperty
|
||||
@li @ref wxEditEnumProperty
|
||||
@li @ref wxEnumProperty
|
||||
@li @ref wxFileProperty
|
||||
@li @ref wxFlagsProperty
|
||||
@li @ref wxFloatProperty
|
||||
@li @ref wxFontProperty
|
||||
@li @ref wxImageFileProperty
|
||||
@li @ref wxIntProperty
|
||||
@li @ref wxLongStringProperty
|
||||
@li @ref wxMultiChoiceProperty
|
||||
@li @ref wxPropertyCategory
|
||||
@li @ref wxStringProperty
|
||||
@li @ref wxSystemColourProperty
|
||||
@li @ref wxUIntProperty
|
||||
|
||||
@subsection wxPropertyCategory
|
||||
|
||||
Not an actual property per se, but a header for a group of properties.
|
||||
Regardless inherits from wxPGProperty.
|
||||
|
||||
@subsection wxStringProperty
|
||||
|
||||
Simple string property. wxPG_STRING_PASSWORD attribute may be used
|
||||
to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl.
|
||||
|
||||
@remarks
|
||||
* wxStringProperty has a special trait: if it has value of "<composed>",
|
||||
and also has child properties, then its displayed value becomes
|
||||
composition of child property values, similar as with wxFontProperty,
|
||||
for instance.
|
||||
|
||||
@subsection wxIntProperty
|
||||
|
||||
Like wxStringProperty, but converts text to a signed long integer.
|
||||
wxIntProperty seamlessly supports 64-bit integers (ie. wxLongLong).
|
||||
|
||||
@subsection wxUIntProperty
|
||||
|
||||
Like wxIntProperty, but displays value as unsigned int. To set
|
||||
the prefix used globally, manipulate wxPG_UINT_PREFIX string attribute.
|
||||
To set the globally used base, manipulate wxPG_UINT_BASE int
|
||||
attribute. Regardless of current prefix, understands (hex) values starting
|
||||
with both "0x" and "$".
|
||||
wxUIntProperty seamlessly supports 64-bit unsigned integers (ie.
|
||||
wxULongLong).
|
||||
|
||||
@subsection wxFloatProperty
|
||||
|
||||
Like wxStringProperty, but converts text to a double-precision floating
|
||||
point. Default float-to-text precision is 6 decimals, but this can be
|
||||
changed by modifying wxPG_FLOAT_PRECISION attribute.
|
||||
|
||||
@subsection wxBoolProperty
|
||||
|
||||
Represents a boolean value. wxChoice is used as editor control, by the
|
||||
default. wxPG_BOOL_USE_CHECKBOX attribute can be set to true inorder to use
|
||||
check box instead.
|
||||
|
||||
@subsection wxLongStringProperty
|
||||
|
||||
Like wxStringProperty, but has a button that triggers a small text editor
|
||||
dialog. Note that in long string values, tabs are represented by "\t" and
|
||||
line break by "\n".
|
||||
|
||||
@subsection wxDirProperty
|
||||
|
||||
Like wxLongStringProperty, but the button triggers dir selector instead.
|
||||
Supported properties (all with string value): wxPG_DIR_DIALOG_MESSAGE.
|
||||
|
||||
@subsection wxFileProperty
|
||||
|
||||
Like wxLongStringProperty, but the button triggers file selector instead.
|
||||
Default wildcard is "All files..." but this can be changed by setting
|
||||
wxPG_FILE_WILDCARD attribute (see wxFileDialog for format details).
|
||||
Attribute wxPG_FILE_SHOW_FULL_PATH can be set to false inorder to show
|
||||
only the filename, not the entire path.
|
||||
|
||||
@subsection wxEnumProperty
|
||||
|
||||
Represents a single selection from a list of choices -
|
||||
wxOwnerDrawnComboBox is used to edit the value.
|
||||
|
||||
@subsection wxFlagsProperty
|
||||
|
||||
Represents a bit set that fits in a long integer. wxBoolProperty
|
||||
sub-properties are created for editing individual bits. Textctrl is created
|
||||
to manually edit the flags as a text; a continous sequence of spaces,
|
||||
commas and semicolons is considered as a flag id separator.
|
||||
<b>Note: </b> When changing "choices" (ie. flag labels) of wxFlagsProperty,
|
||||
you will need to use SetPropertyChoices - otherwise they will not get
|
||||
updated properly.
|
||||
|
||||
@subsection wxArrayStringProperty
|
||||
|
||||
Allows editing of a list of strings in wxTextCtrl and in a separate dialog.
|
||||
|
||||
@subsection wxDateProperty
|
||||
|
||||
wxDateTime property. Default editor is DatePickerCtrl, altough TextCtrl
|
||||
should work as well. wxPG_DATE_FORMAT attribute can be used to change
|
||||
string wxDateTime::Format uses (altough default is recommended as it is
|
||||
locale-dependant), and wxPG_DATE_PICKER_STYLE allows changing window
|
||||
style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY).
|
||||
|
||||
@subsection wxEditEnumProperty
|
||||
|
||||
Represents a string that can be freely edited or selected from list of
|
||||
choices - custom combobox control is used to edit the value.
|
||||
|
||||
@subsection wxMultiChoiceProperty
|
||||
|
||||
Allows editing a multiple selection from a list of strings. This is
|
||||
property is pretty much built around concept of wxMultiChoiceDialog.
|
||||
It uses wxArrayString value.
|
||||
|
||||
@subsection wxImageFileProperty
|
||||
|
||||
Like wxFileProperty, but has thumbnail of the image in front of
|
||||
the filename and autogenerates wildcard from available image handlers.
|
||||
|
||||
@subsection wxColourProperty
|
||||
|
||||
<b>Useful alternate editor:</b> Choice.
|
||||
|
||||
Represents wxColour. wxButton is used to trigger a colour picker dialog.
|
||||
|
||||
@subsection wxFontProperty
|
||||
|
||||
Represents wxFont. Various sub-properties are used to edit individual
|
||||
subvalues.
|
||||
|
||||
@subsection wxSystemColourProperty
|
||||
|
||||
Represents wxColour and a system colour index. wxChoice is used to edit
|
||||
the value. Drop-down list has color images. Note that value type
|
||||
is wxColourPropertyValue instead of wxColour.
|
||||
@code
|
||||
class wxColourPropertyValue : public wxObject
|
||||
{
|
||||
public:
|
||||
// An integer value relating to the colour, and which exact
|
||||
// meaning depends on the property with which it is used.
|
||||
//
|
||||
// For wxSystemColourProperty:
|
||||
// Any of wxSYS_COLOUR_XXX, or any web-colour (use
|
||||
// wxPG_TO_WEB_COLOUR macro - (currently unsupported) ),
|
||||
// or wxPG_COLOUR_CUSTOM.
|
||||
wxUint32 m_type;
|
||||
|
||||
// Resulting colour. Should be correct regardless of type.
|
||||
wxColour m_colour;
|
||||
};
|
||||
@endcode
|
||||
|
||||
@subsection wxCursorProperty
|
||||
|
||||
Represents a wxCursor. wxChoice is used to edit the value.
|
||||
Drop-down list has cursor images under some (wxMSW) platforms.
|
||||
|
||||
|
||||
@section pgproperty_creating Creating Custom Properties
|
||||
|
||||
New properties can be created by subclassing wxPGProperty or one
|
||||
of the provided property classes, and (re)implementing necessary
|
||||
member functions. Below, each virtual member function has ample
|
||||
documentation about its purpose and any odd details which to keep
|
||||
in mind.
|
||||
|
||||
Here is a very simple 'template' code:
|
||||
|
||||
@code
|
||||
class MyProperty : public wxPGProperty
|
||||
{
|
||||
public:
|
||||
// All arguments of ctor must have a default value -
|
||||
// use wxPG_LABEL for label and name
|
||||
MyProperty( const wxString& label = wxPG_LABEL,
|
||||
const wxString& name = wxPG_LABEL,
|
||||
const wxString& value = wxEmptyString )
|
||||
{
|
||||
// m_value is wxVariant
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
virtual ~MyProperty() { }
|
||||
|
||||
const wxPGEditor* DoGetEditorClass() const
|
||||
{
|
||||
// Determines editor used by property.
|
||||
// You can replace 'TextCtrl' below with any of these
|
||||
// builtin-in property editor identifiers: Choice, ComboBox,
|
||||
// TextCtrlAndButton, ChoiceAndButton, CheckBox, SpinCtrl,
|
||||
// DatePickerCtrl.
|
||||
return wxPGEditor_TextCtrl;
|
||||
}
|
||||
|
||||
virtual wxString GetValueAsString( int argFlags ) const
|
||||
{
|
||||
// TODO: Return property value in string format
|
||||
}
|
||||
|
||||
virtual bool StringToValue( wxVariant& variant,
|
||||
const wxString& text,
|
||||
int argFlags )
|
||||
{
|
||||
// TODO: Adapt string to property value.
|
||||
}
|
||||
|
||||
protected:
|
||||
};
|
||||
@endcode
|
||||
|
||||
Since wxPGProperty derives from wxObject, you can use standard
|
||||
DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS macros. From the
|
||||
above example they were omitted for sake of simplicity, and besides,
|
||||
they are only really needed if you need to use wxRTTI with your
|
||||
property class.
|
||||
|
||||
You can change the 'value type' of a property by simply assigning different
|
||||
type of variant with SetValue. <b>It is mandatory to implement
|
||||
wxVariantData class for all data types used as property values.</b>
|
||||
You can use macros declared in wxPropertyGrid headers. For instance:
|
||||
|
||||
@code
|
||||
// In header file:
|
||||
// (If you need to have export declaration, use version of macros
|
||||
// with _EXPORTED postfix)
|
||||
WX_PG_DECLARE_VARIANT_DATA(MyDataClass)
|
||||
|
||||
// In sources file:
|
||||
WX_PG_IMPLEMENT_VARIANT_DATA(MyDataClass)
|
||||
|
||||
// Or, if you don't have valid == operator:
|
||||
WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(MyDataClass)
|
||||
@endcode
|
||||
NB: Full class overview is now only present in
|
||||
interface/wx/propgrid/property.h.
|
||||
|
||||
@library{wxpropgrid}
|
||||
@category{propgrid}
|
||||
|
Reference in New Issue
Block a user