Updated documentation for some wxPropertyGrid classes.

Updated documentation for wxPGEditor, wxPropertyGridPage, wxPropertyGridManager, wx*Property classes.
Removed doxygen-style comments from header files.
This commit is contained in:
Artur Wieczorek
2016-07-23 23:38:39 +02:00
parent b3d4c870da
commit cd96c664dd
10 changed files with 579 additions and 771 deletions

View File

@@ -47,35 +47,26 @@ WX_PG_DECLARE_EDITOR_WITH_DECL(DatePickerCtrl,WXDLLIMPEXP_PROPGRID)
#define wxPG_COLOUR_CUSTOM 0xFFFFFF #define wxPG_COLOUR_CUSTOM 0xFFFFFF
#define wxPG_COLOUR_UNSPECIFIED (wxPG_COLOUR_CUSTOM+1) #define wxPG_COLOUR_UNSPECIFIED (wxPG_COLOUR_CUSTOM+1)
/** @class wxColourPropertyValue // Because text, background and other colours tend to differ between
// platforms, wxSystemColourProperty must be able to select between system
Because text, background and other colours tend to differ between // colour and, when necessary, to pick a custom one. wxSystemColourProperty
platforms, wxSystemColourProperty must be able to select between system // value makes this possible.
colour and, when necessary, to pick a custom one. wxSystemColourProperty
value makes this possible.
*/
class WXDLLIMPEXP_PROPGRID wxColourPropertyValue : public wxObject class WXDLLIMPEXP_PROPGRID wxColourPropertyValue : public wxObject
{ {
public: public:
/** An integer value relating to the colour, and which exact // An integer value relating to the colour, and which exact
meaning depends on the property with which it is used. // meaning depends on the property with which it is used.
// For wxSystemColourProperty:
For wxSystemColourProperty: // Any of wxSYS_COLOUR_XXX, or any web-colour ( use wxPG_TO_WEB_COLOUR
// macro - (currently unsupported) ), or wxPG_COLOUR_CUSTOM.
Any of wxSYS_COLOUR_XXX, or any web-colour ( use wxPG_TO_WEB_COLOUR //
macro - (currently unsupported) ), or wxPG_COLOUR_CUSTOM. // For custom colour properties without values array specified:
// index or wxPG_COLOUR_CUSTOM
For custom colour properties without values array specified: // For custom colour properties with values array specified:
// m_arrValues[index] or wxPG_COLOUR_CUSTOM
index or wxPG_COLOUR_CUSTOM
For custom colour properties <b>with</b> values array specified:
m_arrValues[index] or wxPG_COLOUR_CUSTOM
*/
wxUint32 m_type; wxUint32 m_type;
/** Resulting colour. Should be correct regardless of type. */ // Resulting colour. Should be correct regardless of type.
wxColour m_colour; wxColour m_colour;
wxColourPropertyValue() wxColourPropertyValue()
@@ -145,10 +136,7 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxColourPropertyValue, WXDLLIMPEXP_PROPGRID)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxFontProperty // Property representing wxFont.
@ingroup classes
Property representing wxFont.
*/
class WXDLLIMPEXP_PROPGRID wxFontProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxFontProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxFontProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxFontProperty)
@@ -173,15 +161,12 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** If set, then match from list is searched for a custom colour. */ // If set, then match from list is searched for a custom colour.
#define wxPG_PROP_TRANSLATE_CUSTOM wxPG_PROP_CLASS_SPECIFIC_1 #define wxPG_PROP_TRANSLATE_CUSTOM wxPG_PROP_CLASS_SPECIFIC_1
/** @class wxSystemColourProperty // Has dropdown list of wxWidgets system colours. Value used is
@ingroup classes // of wxColourPropertyValue type.
Has dropdown list of wxWidgets system colours. Value used is
of wxColourPropertyValue type.
*/
class WXDLLIMPEXP_PROPGRID wxSystemColourProperty : public wxEnumProperty class WXDLLIMPEXP_PROPGRID wxSystemColourProperty : public wxEnumProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxSystemColourProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxSystemColourProperty)
@@ -198,16 +183,13 @@ public:
int number, int number,
int argFlags = 0) const wxOVERRIDE; int argFlags = 0) const wxOVERRIDE;
/** // Override in derived class to customize how colours are printed as
Override in derived class to customize how colours are printed as // strings.
strings.
*/
virtual wxString ColourToString( const wxColour& col, int index, virtual wxString ColourToString( const wxColour& col, int index,
int argFlags = 0 ) const; int argFlags = 0 ) const;
/** Returns index of entry that triggers colour picker dialog // Returns index of entry that triggers colour picker dialog
(default is last). // (default is last).
*/
virtual int GetCustomColourIndex() const; virtual int GetCustomColourIndex() const;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE; virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
@@ -224,9 +206,8 @@ public:
// Helper function to show the colour dialog // Helper function to show the colour dialog
bool QueryColourFromUser( wxVariant& variant ) const; bool QueryColourFromUser( wxVariant& variant ) const;
/** Default is to use wxSystemSettings::GetColour(index). Override to use // Default is to use wxSystemSettings::GetColour(index). Override to use
custom colour tables etc. // custom colour tables etc.
*/
virtual wxColour GetColour( int index ) const; virtual wxColour GetColour( int index ) const;
wxColourPropertyValue GetVal( const wxVariant* pVariant = NULL ) const; wxColourPropertyValue GetVal( const wxVariant* pVariant = NULL ) const;
@@ -282,10 +263,7 @@ private:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxCursorProperty // Property representing wxCursor.
@ingroup classes
Property representing wxCursor.
*/
class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty
{ {
wxDECLARE_DYNAMIC_CLASS(wxCursorProperty); wxDECLARE_DYNAMIC_CLASS(wxCursorProperty);
@@ -306,10 +284,7 @@ class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty
WXDLLIMPEXP_PROPGRID const wxString& wxPGGetDefaultImageWildcard(); WXDLLIMPEXP_PROPGRID const wxString& wxPGGetDefaultImageWildcard();
/** @class wxImageFileProperty // Property representing image file(name).
@ingroup classes
Property representing image file(name).
*/
class WXDLLIMPEXP_PROPGRID wxImageFileProperty : public wxFileProperty class WXDLLIMPEXP_PROPGRID wxImageFileProperty : public wxFileProperty
{ {
wxDECLARE_DYNAMIC_CLASS(wxImageFileProperty); wxDECLARE_DYNAMIC_CLASS(wxImageFileProperty);
@@ -339,18 +314,9 @@ private:
#if wxUSE_CHOICEDLG #if wxUSE_CHOICEDLG
/** @class wxMultiChoiceProperty // Property that manages a value resulting from wxMultiChoiceDialog. Value is
@ingroup classes // array of strings. You can get value as array of choice values/indices by
Property that manages a value resulting from wxMultiChoiceDialog. Value is // calling wxMultiChoiceProperty::GetValueAsArrayInt().
array of strings. You can get value as array of choice values/indices by
calling wxMultiChoiceProperty::GetValueAsArrayInt().
<b>Supported special attributes:</b>
- "UserStringMode": If > 0, allow user to manually enter strings that are
not in the list of choices. If this value is 1, user strings are
preferably placed in front of valid choices. If value is 2, then those
strings will placed behind valid choices.
*/
class WXDLLIMPEXP_PROPGRID wxMultiChoiceProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxMultiChoiceProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxMultiChoiceProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxMultiChoiceProperty)
@@ -403,16 +369,7 @@ protected:
#if wxUSE_DATETIME #if wxUSE_DATETIME
/** @class wxDateProperty // Property representing wxDateTime.
@ingroup classes
Property representing wxDateTime.
<b>Supported special attributes:</b>
- "DateFormat": Determines displayed date format.
- "PickerStyle": Determines window style used with wxDatePickerCtrl.
Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE
enables additional support for unspecified property value.
*/
class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxDateProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxDateProperty)

View File

@@ -49,136 +49,98 @@ public:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxPGEditor // Base class for custom wxPropertyGrid editors.
// - Names of builtin property editors are: TextCtrl, Choice,
Base class for custom wxPropertyGrid editors. // ComboBox, CheckBox, TextCtrlAndButton, and ChoiceAndButton. Additional
// editors include SpinCtrl and DatePickerCtrl, but using them requires
@remarks // calling wxPropertyGrid::RegisterAdditionalEditors() prior use.
- Names of builtin property editors are: TextCtrl, Choice, // - Pointer to builtin editor is available as wxPGEditor_EditorName
ComboBox, CheckBox, TextCtrlAndButton, and ChoiceAndButton. Additional // (e.g. wxPGEditor_TextCtrl).
editors include SpinCtrl and DatePickerCtrl, but using them requires // - To add new editor you need to register it first using static function
calling wxPropertyGrid::RegisterAdditionalEditors() prior use. // wxPropertyGrid::RegisterEditorClass(), with code like this:
// wxPGEditor *editorPointer = wxPropertyGrid::RegisterEditorClass(
- Pointer to builtin editor is available as wxPGEditor_EditorName // new MyEditorClass(), "MyEditor");
(e.g. wxPGEditor_TextCtrl). // After that, wxPropertyGrid will take ownership of the given object, but
// you should still store editorPointer somewhere, so you can pass it to
- To add new editor you need to register it first using static function // wxPGProperty::SetEditor(), or return it from
wxPropertyGrid::RegisterEditorClass(), with code like this: // wxPGEditor::DoGetEditorClass().
@code
wxPGEditor *editorPointer = wxPropertyGrid::RegisterEditorClass(
new MyEditorClass(), "MyEditor");
@endcode
After that, wxPropertyGrid will take ownership of the given object, but
you should still store editorPointer somewhere, so you can pass it to
wxPGProperty::SetEditor(), or return it from
wxPGEditor::DoGetEditorClass().
@library{wxpropgrid}
@category{propgrid}
*/
class WXDLLIMPEXP_PROPGRID wxPGEditor : public wxObject class WXDLLIMPEXP_PROPGRID wxPGEditor : public wxObject
{ {
wxDECLARE_ABSTRACT_CLASS(wxPGEditor); wxDECLARE_ABSTRACT_CLASS(wxPGEditor);
public: public:
/** Constructor. */ // Constructor.
wxPGEditor() wxPGEditor()
: wxObject() : wxObject()
{ {
m_clientData = NULL; m_clientData = NULL;
} }
/** Destructor. */ // Destructor.
virtual ~wxPGEditor(); virtual ~wxPGEditor();
/** // Returns pointer to the name of the editor. For example,
Returns pointer to the name of the editor. For example, // wxPGEditor_TextCtrl has name "TextCtrl". If you don't need to access
wxPGEditor_TextCtrl has name "TextCtrl". If you don't need to access // your custom editor by string name, then you do not need to implement
your custom editor by string name, then you do not need to implement // this function.
this function.
*/
virtual wxString GetName() const; virtual wxString GetName() const;
/** // Instantiates editor controls.
Instantiates editor controls. // propgrid- wxPropertyGrid to which the property belongs
// (use as parent for control).
@param propgrid // property - Property for which this method is called.
wxPropertyGrid to which the property belongs (use as parent for // pos - Position, inside wxPropertyGrid, to create control(s) to.
control). // size - Initial size for control(s).
@param property // Unlike in previous version of wxPropertyGrid, it is no longer
Property for which this method is called. // necessary to call wxEvtHandler::Connect() for interesting editor
@param pos // events. Instead, all events from control are now automatically
Position, inside wxPropertyGrid, to create control(s) to. // forwarded to wxPGEditor::OnEvent() and wxPGProperty::OnEvent().
@param size
Initial size for control(s).
@remarks
- Unlike in previous version of wxPropertyGrid, it is no longer
necessary to call wxEvtHandler::Connect() for interesting editor
events. Instead, all events from control are now automatically
forwarded to wxPGEditor::OnEvent() and wxPGProperty::OnEvent().
*/
virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid,
wxPGProperty* property, wxPGProperty* property,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size) const = 0; const wxSize& size) const = 0;
/** Loads value from property to the control. */ // Loads value from property to the control.
virtual void UpdateControl( wxPGProperty* property, virtual void UpdateControl( wxPGProperty* property,
wxWindow* ctrl ) const = 0; wxWindow* ctrl ) const = 0;
/** // Used to get the renderer to draw the value with when the control is
Used to get the renderer to draw the value with when the control is // hidden.
hidden. // Default implementation returns g_wxPGDefaultRenderer.
Default implementation returns g_wxPGDefaultRenderer.
*/
//virtual wxPGCellRenderer* GetCellRenderer() const; //virtual wxPGCellRenderer* GetCellRenderer() const;
/** Draws value for given property. // Draws value for given property.
*/
virtual void DrawValue( wxDC& dc, virtual void DrawValue( wxDC& dc,
const wxRect& rect, const wxRect& rect,
wxPGProperty* property, wxPGProperty* property,
const wxString& text ) const; const wxString& text ) const;
/** Handles events. Returns true if value in control was modified // Handles events. Returns true if value in control was modified
(see wxPGProperty::OnEvent for more information). // (see wxPGProperty::OnEvent for more information).
// wxPropertyGrid will automatically unfocus the editor when
@remarks wxPropertyGrid will automatically unfocus the editor when // wxEVT_TEXT_ENTER is received and when it results in
wxEVT_TEXT_ENTER is received and when it results in // property value being modified. This happens regardless of
property value being modified. This happens regardless of // editor type (i.e. behaviour is same for any wxTextCtrl and
editor type (i.e. behaviour is same for any wxTextCtrl and // wxComboBox based editor).
wxComboBox based editor).
*/
virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property,
wxWindow* wnd_primary, wxEvent& event ) const = 0; wxWindow* wnd_primary, wxEvent& event ) const = 0;
/** Returns value from control, via parameter 'variant'. // Returns value from control, via parameter 'variant'.
Usually ends up calling property's StringToValue or IntToValue. // Usually ends up calling property's StringToValue or IntToValue.
Returns true if value was different. // Returns true if value was different.
*/
virtual bool GetValueFromControl( wxVariant& variant, virtual bool GetValueFromControl( wxVariant& variant,
wxPGProperty* property, wxPGProperty* property,
wxWindow* ctrl ) const; wxWindow* ctrl ) const;
/** // Sets new appearance for the control. Default implementation
Sets new appearance for the control. Default implementation // sets foreground colour, background colour, font, plus text
sets foreground colour, background colour, font, plus text // for wxTextCtrl and wxComboCtrl.
for wxTextCtrl and wxComboCtrl. // appearance - New appearance to be applied.
// oldAppearance - Previously applied appearance. Used to detect
@param appearance // which control attributes need to be changed (e.g. so we only
New appearance to be applied. // change background colour if really needed).
// unspecified - true if the new appearance represents an unspecified
@param oldAppearance // property value.
Previously applied appearance. Used to detect which
control attributes need to be changed (e.g. so we only
change background colour if really needed).
@param unspecified
@true if the new appearance represents an unspecified
property value.
*/
virtual void SetControlAppearance( wxPropertyGrid* pg, virtual void SetControlAppearance( wxPropertyGrid* pg,
wxPGProperty* property, wxPGProperty* property,
wxWindow* ctrl, wxWindow* ctrl,
@@ -186,42 +148,36 @@ public:
const wxPGCell& oldAppearance, const wxPGCell& oldAppearance,
bool unspecified ) const; bool unspecified ) const;
/** // Sets value in control to unspecified.
Sets value in control to unspecified.
*/
virtual void SetValueToUnspecified( wxPGProperty* property, virtual void SetValueToUnspecified( wxPGProperty* property,
wxWindow* ctrl ) const; wxWindow* ctrl ) const;
/** Sets control's value specifically from string. */ // Sets control's value specifically from string.
virtual void SetControlStringValue( wxPGProperty* property, virtual void SetControlStringValue( wxPGProperty* property,
wxWindow* ctrl, wxWindow* ctrl,
const wxString& txt ) const; const wxString& txt ) const;
/** Sets control's value specifically from int (applies to choice etc.). */ // Sets control's value specifically from int (applies to choice etc.).
virtual void SetControlIntValue( wxPGProperty* property, virtual void SetControlIntValue( wxPGProperty* property,
wxWindow* ctrl, wxWindow* ctrl,
int value ) const; int value ) const;
/** Inserts item to existing control. Index -1 means appending. // Inserts item to existing control. Index -1 means appending.
Default implementation does nothing. Returns index of item added. // Default implementation does nothing. Returns index of item added.
*/
virtual int InsertItem( wxWindow* ctrl, virtual int InsertItem( wxWindow* ctrl,
const wxString& label, const wxString& label,
int index ) const; int index ) const;
/** Deletes item from existing control. // Deletes item from existing control.
Default implementation does nothing. // Default implementation does nothing.
*/
virtual void DeleteItem( wxWindow* ctrl, int index ) const; virtual void DeleteItem( wxWindow* ctrl, int index ) const;
/** Extra processing when control gains focus. For example, wxTextCtrl // Extra processing when control gains focus. For example, wxTextCtrl
based controls should select all text. // based controls should select all text.
*/
virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const;
/** Returns true if control itself can contain the custom image. Default is // Returns true if control itself can contain the custom image. Default is
to return false. // to return false.
*/
virtual bool CanContainCustomImage() const; virtual bool CanContainCustomImage() const;
// //
@@ -450,18 +406,11 @@ public:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxPGEditorDialogAdapter // Derive a class from this to adapt an existing editor dialog or function to
// be used when editor button of a property is pushed.
Derive a class from this to adapt an existing editor dialog or function to // You only need to derive class and implement DoShowDialog() to create and
be used when editor button of a property is pushed. // show the dialog, and finally submit the value returned by the dialog
// via SetValue().
You only need to derive class and implement DoShowDialog() to create and
show the dialog, and finally submit the value returned by the dialog
via SetValue().
@library{wxpropgrid}
@category{propgrid}
*/
class WXDLLIMPEXP_PROPGRID wxPGEditorDialogAdapter : public wxObject class WXDLLIMPEXP_PROPGRID wxPGEditorDialogAdapter : public wxObject
{ {
wxDECLARE_ABSTRACT_CLASS(wxPGEditorDialogAdapter); wxDECLARE_ABSTRACT_CLASS(wxPGEditorDialogAdapter);
@@ -484,13 +433,10 @@ public:
m_value = value; m_value = value;
} }
/** // This method is typically only used if deriving class from existing
This method is typically only used if deriving class from existing // adapter with value conversion purposes.
adapter with value conversion purposes.
*/
wxVariant& GetValue() { return m_value; } wxVariant& GetValue() { return m_value; }
//
// This member is public so scripting language bindings // This member is public so scripting language bindings
// wrapper code can access it freely. // wrapper code can access it freely.
void* m_clientData; void* m_clientData;
@@ -502,13 +448,10 @@ private:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxPGMultiButton // This class can be used to have multiple buttons in a property editor.
// You will need to create a new property editor class, override
This class can be used to have multiple buttons in a property editor. // CreateControls, and have it return wxPGMultiButton instance in
You will need to create a new property editor class, override // wxPGWindowList::SetSecondary().
CreateControls, and have it return wxPGMultiButton instance in
wxPGWindowList::SetSecondary().
*/
class WXDLLIMPEXP_PROPGRID wxPGMultiButton : public wxWindow class WXDLLIMPEXP_PROPGRID wxPGMultiButton : public wxWindow
{ {
public: public:
@@ -519,12 +462,10 @@ public:
const wxWindow* GetButton( unsigned int i ) const const wxWindow* GetButton( unsigned int i ) const
{ return (const wxWindow*) m_buttons[i]; } { return (const wxWindow*) m_buttons[i]; }
/** Utility function to be used in event handlers. // Utility function to be used in event handlers.
*/
int GetButtonId( unsigned int i ) const { return GetButton(i)->GetId(); } int GetButtonId( unsigned int i ) const { return GetButton(i)->GetId(); }
/** Returns number of buttons. // Returns number of buttons.
*/
unsigned int GetCount() const { return (unsigned int) m_buttons.size(); } unsigned int GetCount() const { return (unsigned int) m_buttons.size(); }
void Add( const wxString& label, int id = -2 ); void Add( const wxString& label, int id = -2 );

View File

@@ -32,36 +32,25 @@
extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridManagerNameStr[]; extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridManagerNameStr[];
#endif #endif
/** @class wxPropertyGridPage // Holder of property grid page information. You can subclass this and
// give instance in wxPropertyGridManager::AddPage. It inherits from
Holder of property grid page information. You can subclass this and // wxEvtHandler and can be used to process events specific to this
give instance in wxPropertyGridManager::AddPage. It inherits from // page (id of events will still be same as manager's). If you don't
wxEvtHandler and can be used to process events specific to this // want to use it to process all events of the page, you need to
page (id of events will still be same as manager's). If you don't // return false in the derived wxPropertyGridPage::IsHandlingAllEvents.
want to use it to process all events of the page, you need to //
return false in the derived wxPropertyGridPage::IsHandlingAllEvents. // Please note that wxPropertyGridPage lacks many non-const property
// manipulation functions found in wxPropertyGridManager. Please use
Please note that wxPropertyGridPage lacks many non-const property // parent manager (m_manager member variable) when needed.
manipulation functions found in wxPropertyGridManager. Please use //
parent manager (m_manager member variable) when needed. // Please note that most member functions are inherited and as such not
// documented on this page. This means you will probably also want to read
Please note that most member functions are inherited and as such not // wxPropertyGridInterface class reference.
documented on this page. This means you will probably also want to read //
wxPropertyGridInterface class reference. // wxPropertyGridPage receives events emitted by its wxPropertyGridManager, but
// only those events that are specific to that page. If
@section propgridpage_event_handling Event Handling // wxPropertyGridPage::IsHandlingAllEvents returns false, then unhandled
// events are sent to the manager's parent, as usual.
wxPropertyGridPage receives events emitted by its wxPropertyGridManager, but
only those events that are specific to that page. If
wxPropertyGridPage::IsHandlingAllEvents returns false, then unhandled
events are sent to the manager's parent, as usual.
See @ref propgrid_event_handling "wxPropertyGrid Event Handling"
for more information.
@library{wxpropgrid}
@category{propgrid}
*/
class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler, class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler,
public wxPropertyGridInterface, public wxPropertyGridInterface,
public wxPropertyGridPageState public wxPropertyGridPageState
@@ -73,88 +62,69 @@ public:
wxPropertyGridPage(); wxPropertyGridPage();
virtual ~wxPropertyGridPage(); virtual ~wxPropertyGridPage();
/** Deletes all properties on page. // Deletes all properties on page.
*/
virtual void Clear() wxOVERRIDE; virtual void Clear() wxOVERRIDE;
/** // Reduces column sizes to minimum possible that contents are still
Reduces column sizes to minimum possible that contents are still // visibly (naturally some margin space will be applied as well).
visibly (naturally some margin space will be applied as well). // Returns minimum size for the page to still display everything.
// This function only works properly if size of containing grid was
@return // already fairly large.
Minimum size for the page to still display everything. // Note that you can also get calculated column widths by calling
// GetColumnWidth() immediately after this function returns.
@remarks
This function only works properly if size of containing grid was
already fairly large.
Note that you can also get calculated column widths by calling
GetColumnWidth() immediately after this function returns.
*/
wxSize FitColumns(); wxSize FitColumns();
/** Returns page index in manager; // Returns page index in manager;
*/
inline int GetIndex() const; inline int GetIndex() const;
/** Returns x-coordinate position of splitter on a page. // Returns x-coordinate position of splitter on a page.
*/
int GetSplitterPosition( int col = 0 ) const int GetSplitterPosition( int col = 0 ) const
{ return GetStatePtr()->DoGetSplitterPosition(col); } { return GetStatePtr()->DoGetSplitterPosition(col); }
/** Returns "root property". It does not have name, etc. and it is not // Returns "root property". It does not have name, etc. and it is not
visible. It is only useful for accessing its children. // visible. It is only useful for accessing its children.
*/
wxPGProperty* GetRoot() const { return GetStatePtr()->DoGetRoot(); } wxPGProperty* GetRoot() const { return GetStatePtr()->DoGetRoot(); }
/** Return pointer to contained property grid state. // Returns pointer to contained property grid state.
*/
wxPropertyGridPageState* GetStatePtr() wxPropertyGridPageState* GetStatePtr()
{ {
return this; return this;
} }
/** Return pointer to contained property grid state. // Returns pointer to contained property grid state.
*/
const wxPropertyGridPageState* GetStatePtr() const const wxPropertyGridPageState* GetStatePtr() const
{ {
return this; return this;
} }
/** // Returns id of the tool bar item that represents this page on
Returns id of the tool bar item that represents this page on // wxPropertyGridManager's wxToolBar.
wxPropertyGridManager's wxToolBar.
*/
int GetToolId() const int GetToolId() const
{ {
return m_toolId; return m_toolId;
} }
/** Do any member initialization in this method. // Do any member initialization in this method.
@remarks // Notes:
- Called every time the page is added into a manager. // - Called every time the page is added into a manager.
- You can add properties to the page here. // - You can add properties to the page here.
*/
virtual void Init() {} virtual void Init() {}
/** Return false here to indicate unhandled events should be // Return false here to indicate unhandled events should be
propagated to manager's parent, as normal. // propagated to manager's parent, as normal.
*/
virtual bool IsHandlingAllEvents() const { return true; } virtual bool IsHandlingAllEvents() const { return true; }
/** Called every time page is about to be shown. // Called every time page is about to be shown.
Useful, for instance, creating properties just-in-time. // Useful, for instance, creating properties just-in-time.
*/
virtual void OnShow(); virtual void OnShow();
// Refreshes given property on page.
virtual void RefreshProperty( wxPGProperty* p ) wxOVERRIDE; virtual void RefreshProperty( wxPGProperty* p ) wxOVERRIDE;
/** Sets splitter position on page. // Sets splitter position on page.
@remarks // Splitter position cannot exceed grid size, and therefore setting it
Splitter position cannot exceed grid size, and therefore setting it // during form creation may fail as initial grid size is often smaller
during form creation may fail as initial grid size is often smaller // than desired splitter position, especially when sizers are being used.
than desired splitter position, especially when sizers are being used.
*/
void SetSplitterPosition( int splitterPos, int col = 0 ); void SetSplitterPosition( int splitterPos, int col = 0 );
#if WXWIN_COMPATIBILITY_3_0 #if WXWIN_COMPATIBILITY_3_0
@@ -165,16 +135,14 @@ public:
protected: protected:
/** Propagate to other pages. // Propagate to other pages.
*/
virtual void DoSetSplitterPosition( int pos, virtual void DoSetSplitterPosition( int pos,
int splitterColumn = 0, int splitterColumn = 0,
int flags = wxPG_SPLITTER_REFRESH ) wxOVERRIDE; int flags = wxPG_SPLITTER_REFRESH ) wxOVERRIDE;
/** Page label (may be referred as name in some parts of documentation). // Page label (may be referred as name in some parts of documentation).
Can be set in constructor, or passed in // Can be set in constructor, or passed in
wxPropertyGridManager::AddPage(), but *not* in both. // wxPropertyGridManager::AddPage(), but *not* in both.
*/
wxString m_label; wxString m_label;
//virtual bool ProcessEvent( wxEvent& event ); //virtual bool ProcessEvent( wxEvent& event );
@@ -198,25 +166,10 @@ class wxPGHeaderCtrl;
#endif #endif
/** @class wxPropertyGridManager // wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid,
// which can optionally have toolbar for mode and page selection, and help
wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, // text box.
which can optionally have toolbar for mode and page selection, and help // Use window flags to select components to include.
text box.
Use window flags to select components to include.
@section propgridmanager_window_styles_ Window Styles
See @ref propgrid_window_styles.
@section propgridmanager_event_handling Event Handling
See @ref propgrid_event_handling "wxPropertyGrid Event Handling"
for more information.
@library{wxpropgrid}
@category{propgrid}
*/
class WXDLLIMPEXP_PROPGRID class WXDLLIMPEXP_PROPGRID
wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface
{ {
@@ -225,46 +178,34 @@ class WXDLLIMPEXP_PROPGRID
public: public:
#ifndef SWIG #ifndef SWIG
/** // Two step constructor.
Two step constructor. // Call Create when this constructor is called to build up the
Call Create when this constructor is called to build up the // wxPropertyGridManager.
wxPropertyGridManager.
*/
wxPropertyGridManager(); wxPropertyGridManager();
#endif #endif
/** The default constructor. The styles to be used are styles valid for // The default constructor. The styles to be used are styles valid for
the wxWindow. // the wxWindow.
@see @link wndflags Additional Window Styles@endlink
*/
wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE, long style = wxPGMAN_DEFAULT_STYLE,
const wxString& name = wxPropertyGridManagerNameStr ); const wxString& name = wxPropertyGridManagerNameStr );
/** Destructor */ // Destructor.
virtual ~wxPropertyGridManager(); virtual ~wxPropertyGridManager();
/** Creates new property page. Note that the first page is not created // Creates new property page. Note that the first page is not created
automatically. // automatically.
@param label // label - A label for the page. This may be shown as a toolbar tooltip etc.
A label for the page. This may be shown as a toolbar tooltip etc. // bmp - Bitmap image for toolbar. If wxNullBitmap is used, then a built-in
@param bmp // default image is used.
Bitmap image for toolbar. If wxNullBitmap is used, then a built-in // pageObj - wxPropertyGridPage instance. Manager will take ownership of this object.
default image is used. // NULL indicates that a default page instance should be created.
@param pageObj // Returns pointer to created page.
wxPropertyGridPage instance. Manager will take ownership of this object. // If toolbar is used, it is highly recommended that the pages are
NULL indicates that a default page instance should be created. // added when the toolbar is not turned off using window style flag
// switching.
@return
Returns pointer to created page.
@remarks
If toolbar is used, it is highly recommended that the pages are
added when the toolbar is not turned off using window style flag
switching.
*/
wxPropertyGridPage* AddPage( const wxString& label = wxEmptyString, wxPropertyGridPage* AddPage( const wxString& label = wxEmptyString,
const wxBitmap& bmp = wxNullBitmap, const wxBitmap& bmp = wxNullBitmap,
wxPropertyGridPage* pageObj = NULL ) wxPropertyGridPage* pageObj = NULL )
@@ -272,41 +213,32 @@ public:
return InsertPage(-1, label, bmp, pageObj); return InsertPage(-1, label, bmp, pageObj);
} }
/** Deletes all all properties and all pages. // Deletes all all properties and all pages.
*/
virtual void Clear() wxOVERRIDE; virtual void Clear() wxOVERRIDE;
/** Deletes all properties on given page. // Deletes all properties on given page.
*/
void ClearPage( int page ); void ClearPage( int page );
/** Forces updating the value of property from the editor control. // Forces updating the value of property from the editor control.
Returns true if DoPropertyChanged was actually called. // Returns true if DoPropertyChanged was actually called.
*/
bool CommitChangesFromEditor( wxUint32 flags = 0 ) bool CommitChangesFromEditor( wxUint32 flags = 0 )
{ {
return m_pPropGrid->CommitChangesFromEditor(flags); return m_pPropGrid->CommitChangesFromEditor(flags);
} }
/** // Two step creation.
Two step creation. // Whenever the control is created without any parameters, use Create to
Whenever the control is created without any parameters, use Create to // actually create it. Don't access the control's public methods before
actually create it. Don't access the control's public methods before // this is called.
this is called.
@see @link wndflags Additional Window Styles@endlink
*/
bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE, long style = wxPGMAN_DEFAULT_STYLE,
const wxString& name = wxPropertyGridManagerNameStr ); const wxString& name = wxPropertyGridManagerNameStr );
/** // Enables or disables (shows/hides) categories according to parameter
Enables or disables (shows/hides) categories according to parameter // enable.
enable. // Calling this may not properly update toolbar buttons.
WARNING: Not tested properly, use at your own risk.
*/
bool EnableCategories( bool enable ) bool EnableCategories( bool enable )
{ {
long fl = m_windowStyle | wxPG_HIDE_CATEGORIES; long fl = m_windowStyle | wxPG_HIDE_CATEGORIES;
@@ -315,22 +247,20 @@ public:
return true; return true;
} }
/** Selects page, scrolls and/or expands items to ensure that the // Selects page, scrolls and/or expands items to ensure that the
given item is visible. Returns true if something was actually done. // given item is visible. Returns true if something was actually done.
*/
bool EnsureVisible( wxPGPropArg id ); bool EnsureVisible( wxPGPropArg id );
/** Returns number of columns on given page. By the default, // Returns number of columns on given page. By the default,
returns number of columns on current page. */ // returns number of columns on current page.
int GetColumnCount( int page = -1 ) const; int GetColumnCount( int page = -1 ) const;
/** Returns height of the description text box. */ // Returns height of the description text box.
int GetDescBoxHeight() const; int GetDescBoxHeight() const;
/** Returns pointer to the contained wxPropertyGrid. This does not change // Returns pointer to the contained wxPropertyGrid. This does not change
after wxPropertyGridManager has been created, so you can safely obtain // after wxPropertyGridManager has been created, so you can safely obtain
pointer once and use it for the entire lifetime of the instance. // pointer once and use it for the entire lifetime of the manager instance.
*/
wxPropertyGrid* GetGrid() wxPropertyGrid* GetGrid()
{ {
wxASSERT(m_pPropGrid); wxASSERT(m_pPropGrid);
@@ -343,12 +273,10 @@ public:
return (const wxPropertyGrid*)m_pPropGrid; return (const wxPropertyGrid*)m_pPropGrid;
} }
/** Returns iterator class instance. // Returns iterator class instance.
@remarks // Calling this method in wxPropertyGridManager causes run-time assertion
Calling this method in wxPropertyGridManager causes run-time assertion // failure. Please only iterate through individual pages or use
failure. Please only iterate through individual pages or use // CreateVIterator().
CreateVIterator().
*/
wxPropertyGridIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT, wxPropertyGridIterator GetIterator( int flags = wxPG_ITERATE_DEFAULT,
wxPGProperty* firstProp = NULL ) wxPGProperty* firstProp = NULL )
{ {
@@ -366,12 +294,10 @@ public:
return wxPropertyGridInterface::GetIterator( flags, firstProp ); return wxPropertyGridInterface::GetIterator( flags, firstProp );
} }
/** Returns iterator class instance. // Returns iterator class instance.
@remarks // Calling this method in wxPropertyGridManager causes run-time assertion
Calling this method in wxPropertyGridManager causes run-time assertion // failure. Please only iterate through individual pages or use
failure. Please only iterate through individual pages or use // CreateVIterator().
CreateVIterator().
*/
wxPropertyGridIterator GetIterator( int flags, int startPos ) wxPropertyGridIterator GetIterator( int flags, int startPos )
{ {
wxFAIL_MSG( wxS("Please only iterate through individual pages ") wxFAIL_MSG( wxS("Please only iterate through individual pages ")
@@ -387,139 +313,110 @@ public:
return wxPropertyGridInterface::GetIterator( flags, startPos ); return wxPropertyGridInterface::GetIterator( flags, startPos );
} }
/** Similar to GetIterator, but instead returns wxPGVIterator instance, // Similar to GetIterator, but instead returns wxPGVIterator instance,
which can be useful for forward-iterating through arbitrary property // which can be useful for forward-iterating through arbitrary property
containers. // containers.
*/
virtual wxPGVIterator GetVIterator( int flags ) const wxOVERRIDE; virtual wxPGVIterator GetVIterator( int flags ) const wxOVERRIDE;
/** Returns currently selected page. // Returns currently selected page.
*/
wxPropertyGridPage* GetCurrentPage() const wxPropertyGridPage* GetCurrentPage() const
{ {
return GetPage(m_selPage); return GetPage(m_selPage);
} }
/** Returns page object for given page index. // Returns page object for given page index.
*/
wxPropertyGridPage* GetPage( unsigned int ind ) const wxPropertyGridPage* GetPage( unsigned int ind ) const
{ {
return m_arrPages[ind]; return m_arrPages[ind];
} }
/** Returns page object for given page name. // Returns page object for given page name.
*/
wxPropertyGridPage* GetPage( const wxString& name ) const wxPropertyGridPage* GetPage( const wxString& name ) const
{ {
return GetPage(GetPageByName(name)); return GetPage(GetPageByName(name));
} }
/** // Returns index for a page name.
Returns index for a page name. // If no match is found, wxNOT_FOUND is returned.
If no match is found, wxNOT_FOUND is returned.
*/
int GetPageByName( const wxString& name ) const; int GetPageByName( const wxString& name ) const;
/** Returns index for a relevant propertygrid state. // Returns index for a relevant propertygrid state.
// If no match is found, wxNOT_FOUND is returned.
If no match is found, wxNOT_FOUND is returned.
*/
int GetPageByState( const wxPropertyGridPageState* pstate ) const; int GetPageByState( const wxPropertyGridPageState* pstate ) const;
protected: protected:
/** Returns wxPropertyGridPageState of given page, current page's for -1. // Returns wxPropertyGridPageState of given page, current page's for -1.
*/
virtual wxPropertyGridPageState* GetPageState( int page ) const wxOVERRIDE; virtual wxPropertyGridPageState* GetPageState( int page ) const wxOVERRIDE;
public: public:
/** Returns number of managed pages. */ // Returns number of managed pages.
size_t GetPageCount() const; size_t GetPageCount() const;
/** Returns name of given page. */ // Returns name of given page.
const wxString& GetPageName( int index ) const; const wxString& GetPageName( int index ) const;
/** Returns "root property" of the given page. It does not have name, etc. // Returns "root property" of the given page. It does not have name, etc.
and it is not visible. It is only useful for accessing its children. // and it is not visible. It is only useful for accessing its children.
*/
wxPGProperty* GetPageRoot( int index ) const; wxPGProperty* GetPageRoot( int index ) const;
/** Returns index to currently selected page. */ // Returns index to currently selected page.
int GetSelectedPage() const { return m_selPage; } int GetSelectedPage() const { return m_selPage; }
/** Alias for GetSelection(). */ // Alias for GetSelection().
wxPGProperty* GetSelectedProperty() const wxPGProperty* GetSelectedProperty() const
{ {
return GetSelection(); return GetSelection();
} }
/** Shortcut for GetGrid()->GetSelection(). */ // Shortcut for GetGrid()->GetSelection().
wxPGProperty* GetSelection() const wxPGProperty* GetSelection() const
{ {
return m_pPropGrid->GetSelection(); return m_pPropGrid->GetSelection();
} }
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
/** Returns a pointer to the toolbar currently associated with the // Returns a pointer to the toolbar currently associated with the
wxPropertyGridManager (if any). */ // wxPropertyGridManager (if any).
wxToolBar* GetToolBar() const { return m_pToolbar; } wxToolBar* GetToolBar() const { return m_pToolbar; }
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR
/** Creates new property page. Note that the first page is not created // Creates new property page. Note that the first page is not created
automatically. // automatically.
@param index // index - Add to this position. -1 will add as the last item.
Add to this position. -1 will add as the last item. // label - A label for the page. This may be shown as a toolbar tooltip etc.
@param label // bmp - Bitmap image for toolbar. If wxNullBitmap is used, then a built-in
A label for the page. This may be shown as a toolbar tooltip etc. // default image is used.
@param bmp // pageObj - wxPropertyGridPage instance. Manager will take ownership of this object.
Bitmap image for toolbar. If wxNullBitmap is used, then a built-in // If NULL, default page object is constructed.
default image is used. // Returns pointer to created page.
@param pageObj
wxPropertyGridPage instance. Manager will take ownership of this object.
If NULL, default page object is constructed.
@return
Returns pointer to created page.
*/
virtual wxPropertyGridPage* InsertPage( int index, virtual wxPropertyGridPage* InsertPage( int index,
const wxString& label, const wxString& label,
const wxBitmap& bmp = wxNullBitmap, const wxBitmap& bmp = wxNullBitmap,
wxPropertyGridPage* pageObj = NULL ); wxPropertyGridPage* pageObj = NULL );
/** // Returns true if any property on any page has been modified by the user.
Returns true if any property on any page has been modified by the user.
*/
bool IsAnyModified() const; bool IsAnyModified() const;
/** // Returns true if any property on given page has been modified by the
Returns true if any property on given page has been modified by the // user.
user.
*/
bool IsPageModified( size_t index ) const; bool IsPageModified( size_t index ) const;
/** // Returns true if property is selected. Since selection is page
Returns true if property is selected. Since selection is page // based, this function checks every page in the manager.
based, this function checks every page in the manager.
*/
virtual bool IsPropertySelected( wxPGPropArg id ) const; virtual bool IsPropertySelected( wxPGPropArg id ) const;
virtual void Refresh( bool eraseBackground = true, virtual void Refresh( bool eraseBackground = true,
const wxRect* rect = (const wxRect*) NULL ) wxOVERRIDE; const wxRect* rect = (const wxRect*) NULL ) wxOVERRIDE;
/** Removes a page. // Removes a page.
@return // Returns false if it was not possible to remove page in question.
Returns false if it was not possible to remove page in question.
*/
virtual bool RemovePage( int page ); virtual bool RemovePage( int page );
/** Select and displays a given page. // Select and displays a given page.
// index - Index of page being selected. Can be -1 to select nothing.
@param index
Index of page being selected. Can be -1 to select nothing.
*/
void SelectPage( int index ); void SelectPage( int index );
/** Select and displays a given page (by label). */ // Select and displays a given page (by label).
void SelectPage( const wxString& label ) void SelectPage( const wxString& label )
{ {
int index = GetPageByName(label); int index = GetPageByName(label);
@@ -527,13 +424,13 @@ public:
SelectPage( index ); SelectPage( index );
} }
/** Select and displays a given page. */ // Select and displays a given page.
void SelectPage( wxPropertyGridPage* ptr ) void SelectPage( wxPropertyGridPage* ptr )
{ {
SelectPage( GetPageByState(ptr) ); SelectPage( GetPageByState(ptr) );
} }
/** Select a property. */ // Select a property.
bool SelectProperty( wxPGPropArg id, bool focus = false ) bool SelectProperty( wxPGPropArg id, bool focus = false )
{ {
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
@@ -545,78 +442,57 @@ public:
} }
#if wxUSE_HEADERCTRL #if wxUSE_HEADERCTRL
/** // Sets a column title. Default title for column 0 is "Property",
Sets a column title. Default title for column 0 is "Property", // and "Value" for column 1.
and "Value" for column 1. // If header is not shown yet, then calling this
// member function will make it visible.
@remarks If header is not shown yet, then calling this
member function will make it visible.
*/
void SetColumnTitle( int idx, const wxString& title ); void SetColumnTitle( int idx, const wxString& title );
#endif // wxUSE_HEADERCTRL #endif // wxUSE_HEADERCTRL
/** // Sets number of columns on given page (default is current page).
Sets number of columns on given page (default is current page). // If you use header, then you should always use this
// member function to set the column count, instead of
@remarks If you use header, then you should always use this // ones present in wxPropertyGrid or wxPropertyGridPage.
member function to set the column count, instead of
ones present in wxPropertyGrid or wxPropertyGridPage.
*/
void SetColumnCount( int colCount, int page = -1 ); void SetColumnCount( int colCount, int page = -1 );
/** Sets label and text in description box. // Sets label and text in description box.
*/
void SetDescription( const wxString& label, const wxString& content ); void SetDescription( const wxString& label, const wxString& content );
/** Sets y coordinate of the description box splitter. */ // Sets y coordinate of the description box splitter.
void SetDescBoxHeight( int ht, bool refresh = true ); void SetDescBoxHeight( int ht, bool refresh = true );
/** Moves splitter as left as possible, while still allowing all // Moves splitter as left as possible, while still allowing all
labels to be shown in full. // labels to be shown in full.
@param subProps // subProps - If false, will still allow sub-properties (ie. properties which
If false, will still allow sub-properties (ie. properties which // parent is not root or category) to be cropped.
parent is not root or category) to be cropped. // allPages - If true, takes labels on all pages into account.
@param allPages
If true, takes labels on all pages into account.
*/
void SetSplitterLeft( bool subProps = false, bool allPages = true ); void SetSplitterLeft( bool subProps = false, bool allPages = true );
/** Moves splitter as left as possible on an individual page, while still allowing all // Moves splitter as left as possible on an individual page, while still allowing all
labels to be shown in full. // labels to be shown in full.
*/
void SetPageSplitterLeft(int page, bool subProps = false); void SetPageSplitterLeft(int page, bool subProps = false);
/** // Sets splitter position on individual page.
Sets splitter position on individual page. // If you use header, then you should always use this
// member function to set the splitter position, instead of
@remarks If you use header, then you should always use this // ones present in wxPropertyGrid or wxPropertyGridPage.
member function to set the splitter position, instead of
ones present in wxPropertyGrid or wxPropertyGridPage.
*/
void SetPageSplitterPosition( int page, int pos, int column = 0 ); void SetPageSplitterPosition( int page, int pos, int column = 0 );
/** // Sets splitter position for all pages.
Sets splitter position for all pages. // Splitter position cannot exceed grid size, and therefore
// setting it during form creation may fail as initial grid
@remarks Splitter position cannot exceed grid size, and therefore // size is often smaller than desired splitter position,
setting it during form creation may fail as initial grid // especially when sizers are being used.
size is often smaller than desired splitter position, // If you use header, then you should always use this
especially when sizers are being used. // member function to set the splitter position, instead of
// ones present in wxPropertyGrid or wxPropertyGridPage.
If you use header, then you should always use this
member function to set the splitter position, instead of
ones present in wxPropertyGrid or wxPropertyGridPage.
*/
void SetSplitterPosition( int pos, int column = 0 ); void SetSplitterPosition( int pos, int column = 0 );
#if wxUSE_HEADERCTRL #if wxUSE_HEADERCTRL
/** // Show or hide the property grid header control. It is hidden
Show or hide the property grid header control. It is hidden // by the default.
by the default. // Grid may look better if you use wxPG_NO_INTERNAL_BORDER
// window style when showing a header.
@remarks Grid may look better if you use wxPG_NO_INTERNAL_BORDER
window style when showing a header.
*/
void ShowHeader(bool show = true); void ShowHeader(bool show = true);
#endif #endif
@@ -626,13 +502,11 @@ protected:
// Subclassing helpers // Subclassing helpers
// //
/** // Creates property grid for the manager. Reimplement in derived class to
Creates property grid for the manager. Reimplement in derived class to // use subclassed wxPropertyGrid. However, if you do this then you
use subclassed wxPropertyGrid. However, if you do this then you // must also use the two-step construction (i.e. default constructor and
must also use the two-step construction (i.e. default constructor and // Create() instead of constructor with arguments) when creating the
Create() instead of constructor with arguments) when creating the // manager.
manager.
*/
virtual wxPropertyGrid* CreatePropertyGrid() const; virtual wxPropertyGrid* CreatePropertyGrid() const;
public: public:
@@ -722,7 +596,7 @@ protected:
virtual wxPGProperty* DoGetPropertyByName( const wxString& name ) const wxOVERRIDE; virtual wxPGProperty* DoGetPropertyByName( const wxString& name ) const wxOVERRIDE;
/** Select and displays a given page. */ // Select and displays a given page.
virtual bool DoSelectPage( int index ) wxOVERRIDE; virtual bool DoSelectPage( int index ) wxOVERRIDE;
// Sets some members to defaults. // Sets some members to defaults.
@@ -737,12 +611,11 @@ protected:
virtual bool ProcessEvent( wxEvent& event ) wxOVERRIDE; virtual bool ProcessEvent( wxEvent& event ) wxOVERRIDE;
/** Recalculates new positions for components, according to the // Recalculates new positions for components, according to the
given size. // given size.
*/
void RecalculatePositions( int width, int height ); void RecalculatePositions( int width, int height );
/** (Re)creates/destroys controls, according to the window style bits. */ // (Re)creates/destroys controls, according to the window style bits.
void RecreateControls(); void RecreateControls();
void UpdateDescriptionBox( int new_splittery, int new_width, int new_height ); void UpdateDescriptionBox( int new_splittery, int new_width, int new_height );

View File

@@ -353,10 +353,7 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @section propgrid_vfbflags wxPropertyGrid Validation Failure behaviour Flags // wxPropertyGrid Validation Failure behaviour Flags
@{
*/
enum wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS enum wxPG_VALIDATION_FAILURE_BEHAVIOR_FLAGS
{ {
@@ -1637,7 +1634,7 @@ protected:
#if WXWIN_COMPATIBILITY_3_0 #if WXWIN_COMPATIBILITY_3_0
// Unused variable. // Unused variable.
/** When drawing next time, clear this many item slots at the end. */ // When drawing next time, clear this many item slots at the end.
int m_clearThisMany; int m_clearThisMany;
#endif #endif
@@ -2101,7 +2098,7 @@ public:
return m_property->GetMainParent(); return m_property->GetMainParent();
} }
/** Returns id of associated property. */ // Returns property associated with this event.
wxPGProperty* GetProperty() const wxPGProperty* GetProperty() const
{ {
return m_property; return m_property;

View File

@@ -224,11 +224,7 @@ class wxPGValidationInfo;
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @section propgrid_misc wxPropertyGrid Miscellaneous // Some miscellaneous values, types and macros.
This section describes some miscellaneous values, types and macros.
@{
*/
// Used to tell wxPGProperty to use label as name as well // Used to tell wxPGProperty to use label as name as well
#define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL) #define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL)
@@ -240,14 +236,12 @@ class wxPGValidationInfo;
#endif // WXWIN_COMPATIBILITY_3_0 #endif // WXWIN_COMPATIBILITY_3_0
#define wxPG_COLOUR_BLACK (*wxBLACK) #define wxPG_COLOUR_BLACK (*wxBLACK)
/** Convert Red, Green and Blue to a single 32-bit value. // Convert Red, Green and Blue to a single 32-bit value.
*/
#define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16))) #define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16)))
/** If property is supposed to have custom-painted image, then returning // If property is supposed to have custom-painted image, then returning
this in OnMeasureImage() will usually be enough. // this in OnMeasureImage() will usually be enough.
*/
#define wxPG_DEFAULT_IMAGE_SIZE wxDefaultSize #define wxPG_DEFAULT_IMAGE_SIZE wxDefaultSize
@@ -271,9 +265,6 @@ typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid,
typedef wxString wxPGCachedString; typedef wxString wxPGCachedString;
#endif #endif
/** @}
*/
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Used to indicate wxPGChoices::Add etc. that the value is actually not given // Used to indicate wxPGChoices::Add etc. that the value is actually not given

View File

@@ -61,11 +61,8 @@ WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME, T, EDITOR)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxPGInDialogValidator // Creates and manages a temporary wxTextCtrl for validation purposes.
@ingroup classes // Uses wxPropertyGrid's current editor, if available.
Creates and manages a temporary wxTextCtrl for validation purposes.
Uses wxPropertyGrid's current editor, if available.
*/
class WXDLLIMPEXP_PROPGRID wxPGInDialogValidator class WXDLLIMPEXP_PROPGRID wxPGInDialogValidator
{ {
public: public:
@@ -95,17 +92,9 @@ private:
#define wxPG_PROP_PASSWORD wxPG_PROP_CLASS_SPECIFIC_2 #define wxPG_PROP_PASSWORD wxPG_PROP_CLASS_SPECIFIC_2
/** @class wxStringProperty // Basic property with string value.
@ingroup classes // If value "<composed>" is set, then actual value is formed (or composed)
Basic property with string value. // from values of child properties.
<b>Supported special attributes:</b>
- "Password": set to 1 in order to enable wxTE_PASSWORD on the editor.
@remarks
- If value "<composed>" is set, then actual value is formed (or composed)
from values of child properties.
*/
class WXDLLIMPEXP_PROPGRID wxStringProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxStringProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxStringProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxStringProperty)
@@ -122,8 +111,7 @@ public:
virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE; virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;
/** This is updated so "<composed>" special value can be handled. // This is updated so "<composed>" special value can be handled.
*/
virtual void OnSetValue() wxOVERRIDE; virtual void OnSetValue() wxOVERRIDE;
protected: protected:
@@ -131,20 +119,16 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** Constants used with NumericValidation<>(). // Constants used with NumericValidation<>().
*/
enum wxPGNumericValidationConstants enum wxPGNumericValidationConstants
{ {
/** Instead of modifying the value, show an error message. // Instead of modifying the value, show an error message.
*/
wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE = 0, wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE = 0,
/** Modify value, but stick with the limitations. // Modify value, but stick with the limitations.
*/
wxPG_PROPERTY_VALIDATION_SATURATE = 1, wxPG_PROPERTY_VALIDATION_SATURATE = 1,
/** Modify value, wrap around on overflow. // Modify value, wrap around on overflow.
*/
wxPG_PROPERTY_VALIDATION_WRAP = 2 wxPG_PROPERTY_VALIDATION_WRAP = 2
}; };
@@ -152,9 +136,7 @@ enum wxPGNumericValidationConstants
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
/** // A more comprehensive numeric validator class.
A more comprehensive numeric validator class.
*/
class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator
{ {
public: public:
@@ -173,47 +155,8 @@ public:
#endif // wxUSE_VALIDATORS #endif // wxUSE_VALIDATORS
/** @class wxIntProperty // Basic property with integer value.
@ingroup classes // Seamlessly supports 64-bit integer (wxLongLong) on overflow.
Basic property with integer value.
Seamlessly supports 64-bit integer (wxLongLong) on overflow.
<b>Example how to use seamless 64-bit integer support</b>
Getting value:
@code
wxLongLong_t value = pg->GetPropertyValueAsLongLong();
@endcode
or
@code
wxLongLong value;
wxVariant variant = property->GetValue();
if ( variant.IsType("longlong") )
value = variant.GetLongLong();
else
value = variant.GetLong();
@endcode
Setting value:
@code
pg->SetPropertyValue(longLongVal);
@endcode
or
@code
property->SetValue(WXVARIANT(longLongVal));
@endcode
<b>Supported special attributes:</b>
- "Min", "Max": Specify acceptable value range.
*/
class WXDLLIMPEXP_PROPGRID wxIntProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxIntProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxIntProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxIntProperty)
@@ -240,8 +183,7 @@ public:
static wxValidator* GetClassValidator(); static wxValidator* GetClassValidator();
virtual wxValidator* DoGetValidator() const wxOVERRIDE; virtual wxValidator* DoGetValidator() const wxOVERRIDE;
/** Validation helpers. // Validation helpers.
*/
#if wxUSE_LONGLONG #if wxUSE_LONGLONG
static bool DoValidation( const wxPGProperty* property, static bool DoValidation( const wxPGProperty* property,
wxLongLong& value, wxLongLong& value,
@@ -268,24 +210,8 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxUIntProperty // Basic property with unsigned integer value.
@ingroup classes // Seamlessly supports 64-bit integer (wxULongLong) on overflow.
Basic property with unsigned integer value.
Seamlessly supports 64-bit integer (wxULongLong) on overflow.
<b>Supported special attributes:</b>
- "Min", "Max": Specify acceptable value range.
- "Base": Define base. Valid constants are wxPG_BASE_OCT, wxPG_BASE_DEC,
wxPG_BASE_HEX and wxPG_BASE_HEXL (lowercase characters). Arbitrary bases
are <b>not</b> supported.
- "Prefix": Possible values are wxPG_PREFIX_NONE, wxPG_PREFIX_0x, and
wxPG_PREFIX_DOLLAR_SIGN. Only wxPG_PREFIX_NONE works with Decimal and Octal
numbers.
@remarks
- For example how to use seamless 64-bit integer support, see wxIntProperty
documentation (just use wxULongLong instead of wxLongLong).
*/
class WXDLLIMPEXP_PROPGRID wxUIntProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxUIntProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxUIntProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxUIntProperty)
@@ -339,14 +265,7 @@ private:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxFloatProperty // Basic property with double-precision floating point value.
@ingroup classes
Basic property with double-precision floating point value.
<b>Supported special attributes:</b>
- "Precision": Sets the (max) precision used when floating point value is
rendered as text. The default -1 means infinite precision.
*/
class WXDLLIMPEXP_PROPGRID wxFloatProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxFloatProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxFloatProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxFloatProperty)
@@ -366,8 +285,7 @@ public:
virtual bool ValidateValue( wxVariant& value, virtual bool ValidateValue( wxVariant& value,
wxPGValidationInfo& validationInfo ) const wxOVERRIDE; wxPGValidationInfo& validationInfo ) const wxOVERRIDE;
/** Validation helper. // Validation helper.
*/
static bool DoValidation( const wxPGProperty* property, static bool DoValidation( const wxPGProperty* property,
double& value, double& value,
wxPGValidationInfo* pValidationInfo, wxPGValidationInfo* pValidationInfo,
@@ -382,14 +300,7 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxBoolProperty // Basic property with boolean value.
@ingroup classes
Basic property with boolean value.
<b>Supported special attributes:</b>
- "UseCheckbox": Set to 1 to use check box editor instead of combo box.
- "UseDClickCycling": Set to 1 to cycle combo box instead showing the list.
*/
class WXDLLIMPEXP_PROPGRID wxBoolProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxBoolProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxBoolProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxBoolProperty)
@@ -415,17 +326,12 @@ public:
// changed (i.e. returns NULL in GetPropertyChoices). // changed (i.e. returns NULL in GetPropertyChoices).
#define wxPG_PROP_STATIC_CHOICES wxPG_PROP_CLASS_SPECIFIC_1 #define wxPG_PROP_STATIC_CHOICES wxPG_PROP_CLASS_SPECIFIC_1
/** @class wxEnumProperty // Represents a single selection from a list of choices
@ingroup classes // You can derive custom properties with choices from this class.
You can derive custom properties with choices from this class. See // Updating private index is important. You can do this either by calling
wxBaseEnumProperty for remarks. // SetIndex() in IntToValue, and then letting wxBaseEnumProperty::OnSetValue
// be called (by not implementing it, or by calling super class function in
@remarks // it) -OR- you can just call SetIndex in OnSetValue.
- Updating private index is important. You can do this either by calling
SetIndex() in IntToValue, and then letting wxBaseEnumProperty::OnSetValue
be called (by not implementing it, or by calling super class function in
it) -OR- you can just call SetIndex in OnSetValue.
*/
class WXDLLIMPEXP_PROPGRID wxEnumProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxEnumProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxEnumProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxEnumProperty)
@@ -531,14 +437,9 @@ private:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxEditEnumProperty // wxEnumProperty with wxString value and writable combo box editor.
@ingroup classes // Uses int value, similar to wxEnumProperty, unless text entered by user is
wxEnumProperty with wxString value and writable combo box editor. // is not in choices (in which case string value is used).
@remarks
Uses int value, similar to wxEnumProperty, unless text entered by user is
is not in choices (in which case string value is used).
*/
class WXDLLIMPEXP_PROPGRID wxEditEnumProperty : public wxEnumProperty class WXDLLIMPEXP_PROPGRID wxEditEnumProperty : public wxEnumProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxEditEnumProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxEditEnumProperty)
@@ -581,16 +482,13 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxFlagsProperty // Represents a bit set that fits in a long integer. wxBoolProperty
@ingroup classes // sub-properties are created for editing individual bits. Textctrl is created
Represents a bit set that fits in a long integer. wxBoolProperty // to manually edit the flags as a text; a continuous sequence of spaces,
sub-properties are created for editing individual bits. Textctrl is created // commas and semicolons is considered as a flag id separator.
to manually edit the flags as a text; a continuous sequence of spaces, // Note: When changing "choices" (ie. flag labels) of wxFlagsProperty,
commas and semicolons is considered as a flag id separator. // you will need to use SetPropertyChoices - otherwise they will not get
<b>Note:</b> When changing "choices" (ie. flag labels) of wxFlagsProperty, // updated properly.
you will need to use SetPropertyChoices - otherwise they will not get
updated properly.
*/
class WXDLLIMPEXP_PROPGRID wxFlagsProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxFlagsProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxFlagsProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxFlagsProperty)
@@ -650,9 +548,6 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxPGFileDialogAdapter
@ingroup classes
*/
class WXDLLIMPEXP_PROPGRID class WXDLLIMPEXP_PROPGRID
wxPGFileDialogAdapter : public wxPGEditorDialogAdapter wxPGFileDialogAdapter : public wxPGEditorDialogAdapter
{ {
@@ -666,20 +561,7 @@ public:
// Indicates first bit useable by derived properties. // Indicates first bit useable by derived properties.
#define wxPG_PROP_SHOW_FULL_FILENAME wxPG_PROP_CLASS_SPECIFIC_1 #define wxPG_PROP_SHOW_FULL_FILENAME wxPG_PROP_CLASS_SPECIFIC_1
/** @class wxFileProperty // Like wxLongStringProperty, but the button triggers file selector instead.
@ingroup classes
Like wxLongStringProperty, but the button triggers file selector instead.
<b>Supported special attributes:</b>
- "Wildcard": Sets wildcard (see wxFileDialog for format details), "All
files..." is default.
- "ShowFullPath": Default 1. When 0, only the file name is shown (i.e. drive
and directory are hidden).
- "ShowRelativePath": If set, then the filename is shown relative to the
given path string.
- "InitialPath": Sets the initial path of where to look for files.
- "DialogTitle": Sets a specific title for the dir dialog.
*/
class WXDLLIMPEXP_PROPGRID wxFileProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxFileProperty : public wxPGProperty
{ {
friend class wxPGFileDialogAdapter; friend class wxPGFileDialogAdapter;
@@ -702,9 +584,7 @@ public:
static wxValidator* GetClassValidator(); static wxValidator* GetClassValidator();
virtual wxValidator* DoGetValidator() const wxOVERRIDE; virtual wxValidator* DoGetValidator() const wxOVERRIDE;
/** // Returns filename to file represented by current value.
Returns filename to file represented by current value.
*/
wxFileName GetFileName() const; wxFileName GetFileName() const;
protected: protected:
@@ -723,9 +603,6 @@ protected:
#define wxPG_PROP_ACTIVE_BTN wxPG_PROP_CLASS_SPECIFIC_3 #define wxPG_PROP_ACTIVE_BTN wxPG_PROP_CLASS_SPECIFIC_3
/** @class wxPGLongStringDialogAdapter
@ingroup classes
*/
class WXDLLIMPEXP_PROPGRID class WXDLLIMPEXP_PROPGRID
wxPGLongStringDialogAdapter : public wxPGEditorDialogAdapter wxPGLongStringDialogAdapter : public wxPGEditorDialogAdapter
{ {
@@ -735,11 +612,8 @@ public:
}; };
/** @class wxLongStringProperty // Like wxStringProperty, but has a button that triggers a small text
@ingroup classes // editor dialog.
Like wxStringProperty, but has a button that triggers a small text
editor dialog.
*/
class WXDLLIMPEXP_PROPGRID wxLongStringProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxLongStringProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxLongStringProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxLongStringProperty)
@@ -772,13 +646,7 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxDirProperty // Like wxLongStringProperty, but the button triggers dir selector instead.
@ingroup classes
Like wxLongStringProperty, but the button triggers dir selector instead.
<b>Supported special attributes:</b>
- "DialogMessage": Sets specific message in the dir selector.
*/
class WXDLLIMPEXP_PROPGRID wxDirProperty : public wxLongStringProperty class WXDLLIMPEXP_PROPGRID wxDirProperty : public wxLongStringProperty
{ {
wxDECLARE_DYNAMIC_CLASS(wxDirProperty); wxDECLARE_DYNAMIC_CLASS(wxDirProperty);
@@ -807,10 +675,7 @@ protected:
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
/** @class wxArrayStringProperty // Property that manages a list of strings.
@ingroup classes
Property that manages a list of strings.
*/
class WXDLLIMPEXP_PROPGRID wxArrayStringProperty : public wxPGProperty class WXDLLIMPEXP_PROPGRID wxArrayStringProperty : public wxPGProperty
{ {
WX_PG_DECLARE_PROPERTY_CLASS(wxArrayStringProperty) WX_PG_DECLARE_PROPERTY_CLASS(wxArrayStringProperty)
@@ -853,10 +718,8 @@ public:
QuoteStrings = 0x02 QuoteStrings = 0x02
}; };
/** // Generates contents for string dst based on the contents of
Generates contents for string dst based on the contents of // wxArrayString src.
wxArrayString src.
*/
static void ArrayStringToString( wxString& dst, const wxArrayString& src, static void ArrayStringToString( wxString& dst, const wxArrayString& src,
wxUniChar delimiter, int flags ); wxUniChar delimiter, int flags );
@@ -966,29 +829,24 @@ public:
m_hasCustomNewAction = true; m_hasCustomNewAction = true;
} }
/** Set value modified by dialog. // Set value modified by dialog.
*/
virtual void SetDialogValue( const wxVariant& WXUNUSED(value) ) virtual void SetDialogValue( const wxVariant& WXUNUSED(value) )
{ {
wxFAIL_MSG(wxS("re-implement this member function in derived class")); wxFAIL_MSG(wxS("re-implement this member function in derived class"));
} }
/** Return value modified by dialog. // Return value modified by dialog.
*/
virtual wxVariant GetDialogValue() const virtual wxVariant GetDialogValue() const
{ {
wxFAIL_MSG(wxS("re-implement this member function in derived class")); wxFAIL_MSG(wxS("re-implement this member function in derived class"));
return wxVariant(); return wxVariant();
} }
/** Override to return wxValidator to be used with the wxTextCtrl // Override to return wxValidator to be used with the wxTextCtrl
in dialog. Note that the validator is used in the standard // in dialog. Note that the validator is used in the standard
wx way, i.e. it immediately prevents user from entering invalid // wx way, i.e. it immediately prevents user from entering invalid
input. // input.
// Note: Dialog frees the validator.
@remarks
Dialog frees the validator.
*/
virtual wxValidator* GetTextCtrlValidator() const virtual wxValidator* GetTextCtrlValidator() const
{ {
return NULL; return NULL;

View File

@@ -116,14 +116,17 @@ public:
Default implementation sets foreground colour, background colour, Default implementation sets foreground colour, background colour,
font, plus text for wxTextCtrl and wxComboCtrl. font, plus text for wxTextCtrl and wxComboCtrl.
The parameter @a appearance represents the new appearance to be applied. @param appearance
New appearance to be applied.
The parameter @a oldAppearance is the previously applied appearance. @param oldAppearance
Used to detect which control attributes need to be changed (e.g. so we only Previously applied appearance. Used to detect which control
change background colour if really needed). attributes need to be changed (e.g. so we onlychange background
colour if really needed).
Finally, the parameter @a unspecified if @true tells this function that @param unspecified
the new appearance represents an unspecified property value. If @true tells this function that the new appearance represents
an unspecified property value.
*/ */
virtual void SetControlAppearance( wxPropertyGrid* pg, virtual void SetControlAppearance( wxPropertyGrid* pg,
wxPGProperty* property, wxPGProperty* property,
@@ -333,3 +336,35 @@ public:
wxSize GetPrimarySize() const; wxSize GetPrimarySize() const;
}; };
/** @class wxPGEditorDialogAdapter
Derive a class from this to adapt an existing editor dialog or function to
be used when editor button of a property is pushed.
You only need to derive class and implement DoShowDialog() to create and
show the dialog, and finally submit the value returned by the dialog
via SetValue().
@library{wxpropgrid}
@category{propgrid}
*/
class wxPGEditorDialogAdapter : public wxObject
{
public:
wxPGEditorDialogAdapter();
virtual ~wxPGEditorDialogAdapter();
bool ShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property );
virtual bool DoShowDialog( wxPropertyGrid* propGrid,
wxPGProperty* property ) = 0;
void SetValue( wxVariant value );
/**
This method is typically only used if deriving class from existing
adapter with value conversion purposes.
*/
wxVariant& GetValue();
};

View File

@@ -80,6 +80,16 @@ public:
*/ */
int GetSplitterPosition( int col = 0 ) const; int GetSplitterPosition( int col = 0 ) const;
/**
Returns pointer to contained property grid state.
*/
wxPropertyGridPageState* GetStatePtr();
/**
Returns pointer to contained property grid state.
*/
const wxPropertyGridPageState* GetStatePtr() const;
/** /**
Returns id of the tool bar item that represents this page on Returns id of the tool bar item that represents this page on
wxPropertyGridManager's wxToolBar. wxPropertyGridManager's wxToolBar.
@@ -95,7 +105,7 @@ public:
virtual void Init(); virtual void Init();
/** /**
Return false here to indicate unhandled events should be Return @false here to indicate unhandled events should be
propagated to manager's parent, as normal. propagated to manager's parent, as normal.
*/ */
virtual bool IsHandlingAllEvents() const; virtual bool IsHandlingAllEvents() const;
@@ -200,6 +210,21 @@ public:
class wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface class wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface
{ {
public: public:
/**
The default constructor. The styles to be used are styles valid for
the wxWindow.
*/
wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE,
const wxString& name = wxPropertyGridManagerNameStr );
/**
Destructor.
*/
virtual ~wxPropertyGridManager();
/** /**
Creates new property page. Note that the first page is not created Creates new property page. Note that the first page is not created
automatically. automatically.
@@ -259,7 +284,7 @@ public:
Enables or disables (shows/hides) categories according to parameter enable. Enables or disables (shows/hides) categories according to parameter enable.
@remarks @remarks
Calling his may not properly update toolbar buttons. Calling this may not properly update toolbar buttons.
*/ */
bool EnableCategories( bool enable ); bool EnableCategories( bool enable );
@@ -291,7 +316,7 @@ public:
wxPropertyGrid* GetGrid(); wxPropertyGrid* GetGrid();
/** /**
Similar to GetIterator, but instead returns wxPGVIterator instance, Similar to GetIterator(), but instead returns wxPGVIterator instance,
which can be useful for forward-iterating through arbitrary property which can be useful for forward-iterating through arbitrary property
containers. containers.
*/ */
@@ -318,6 +343,12 @@ public:
*/ */
int GetPageByName( const wxString& name ) const; int GetPageByName( const wxString& name ) const;
/**
Returns index for a relevant propertygrid state.
If no match is found, wxNOT_FOUND is returned.
*/
int GetPageByState( const wxPropertyGridPageState* pstate ) const;
/** /**
Returns number of managed pages. Returns number of managed pages.
*/ */
@@ -365,7 +396,7 @@ public:
@param pageObj @param pageObj
wxPropertyGridPage instance. Manager will take ownership of this wxPropertyGridPage instance. Manager will take ownership of this
object. If NULL, default page object is constructed. object. If @NULL, default page object is constructed.
@return Returns pointer to created page. @return Returns pointer to created page.
*/ */

View File

@@ -427,11 +427,15 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
@subsection wxStringProperty @subsection wxStringProperty
Simple string property. wxPG_STRING_PASSWORD attribute may be used Simple string property.
to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl.
wxPG_ATTR_AUTOCOMPLETE attribute may be used to enable auto-completion Supported special attributes:
- wxPG_STRING_PASSWORD: Set to @true in order to echo value as asterisks and
to use wxTE_PASSWORD on the editor (wxTextCtrl).
- wxPG_ATTR_AUTOCOMPLETE: Set to @true to enable auto-completion
(use a wxArrayString value), and is also supported by any property that (use a wxArrayString value), and is also supported by any property that
happens to use a wxTextCtrl-based editor. happens to use a wxTextCtrl-based editor.
@see propgrid_property_attributes
@remarks wxStringProperty has a special trait: if it has value of @remarks wxStringProperty has a special trait: if it has value of
"<composed>", and also has child properties, then its displayed "<composed>", and also has child properties, then its displayed
@@ -441,9 +445,8 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
@subsection wxIntProperty @subsection wxIntProperty
Like wxStringProperty, but converts text to a signed long integer. Like wxStringProperty, but converts text to a signed long integer.
wxIntProperty seamlessly supports 64-bit integers (ie. wxLongLong). wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong) on overlfow.
To safely convert variant to integer, use code like this: To safely convert variant to integer, use code like this:
@code @code
wxLongLong ll; wxLongLong ll;
ll << property->GetValue(); ll << property->GetValue();
@@ -452,15 +455,55 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property); wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property);
@endcode @endcode
Getting 64-bit value:
@code
wxLongLong_t value = pg->GetPropertyValueAsLongLong();
// or
wxLongLong value;
wxVariant variant = property->GetValue();
if ( variant.IsType(wxPG_VARIANT_TYPE_LONGLONG) )
value = variant.GetLongLong();
else
value = variant.GetLong();
@endcode
Setting 64-bit value:
@code
pg->SetPropertyValue(longLongVal);
// or
property->SetValue(WXVARIANT(longLongVal));
@endcode
Supported special attributes:
- wxPG_ATTR_MIN, wxPG_ATTR_MAX to specify acceptable value range.
@subsection wxUIntProperty @subsection wxUIntProperty
Like wxIntProperty, but displays value as unsigned int. To set Like wxIntProperty, but displays value as unsigned int. To set
the prefix used globally, manipulate wxPG_UINT_PREFIX string attribute. the prefix used globally, manipulate wxPG_UINT_PREFIX string attribute.
To set the globally used base, manipulate wxPG_UINT_BASE int To set the globally used base, manipulate wxPG_UINT_BASE int
attribute. Regardless of current prefix, understands (hex) values starting attribute. Regardless of current prefix, understands (hex) values starting
with both "0x" and "$". with both "0x" and "$" (apart from edit mode).
Like wxIntProperty, wxUIntProperty seamlessly supports 64-bit unsigned Like wxIntProperty, wxUIntProperty seamlessly supports 64-bit unsigned
integers (ie. wxULongLong). Same wxVariant safety rules apply. integers (i.e. wxULongLong). Same wxVariant safety rules apply.
Supported special attributes:
- wxPG_ATTR_MIN, wxPG_ATTR_MAX: Specifies acceptable value range.
- wxPG_UINT_BASE: Defines base. Valid constants are wxPG_BASE_OCT,
wxPG_BASE_DEC, wxPG_BASE_HEX and wxPG_BASE_HEXL (lowercase characters).
Arbitrary bases are <b>not</b> supported.
- wxPG_UINT_PREFIX: Defines displayed prefix. Possible values are
wxPG_PREFIX_NONE, wxPG_PREFIX_0x and wxPG_PREFIX_DOLLAR_SIGN.
Only wxPG_PREFIX_NONE works with decimal and octal numbers.
@see propgrid_property_attributes
@remarks
For example how to use seamless 64-bit integer support, see wxIntProperty
documentation (just use wxULongLong instead of wxLongLong).
@subsection wxFloatProperty @subsection wxFloatProperty
@@ -474,12 +517,27 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
what C standard library does, but should result in better end-user what C standard library does, but should result in better end-user
experience in almost all cases. experience in almost all cases.
Supported special attributes:
- wxPG_ATTR_MIN, wxPG_ATTR_MAX: Specifies acceptable value range.
<b>Supported special attributes:</b>
- wxPG_FLOAT_PRECISION: Sets the (max) precision used when floating point
value is rendered as text. The default -1 means shortest floating-point
6-digit representation.
@see propgrid_property_attributes
@subsection wxBoolProperty @subsection wxBoolProperty
Represents a boolean value. wxChoice is used as editor control, by the Represents a boolean value. wxChoice is used as editor control, by the
default. wxPG_BOOL_USE_CHECKBOX attribute can be set to true in order to default. wxPG_BOOL_USE_CHECKBOX attribute can be set to @true in order to
use check box instead. use check box instead.
Supported special attributes:
- wxPG_BOOL_USE_CHECKBOX: If set to @true uses check box editor instead
of combo box.
- wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING: If set to @true cycles combo box
instead showing the list.
@see propgrid_property_attributes
@subsection wxLongStringProperty @subsection wxLongStringProperty
Like wxStringProperty, but has a button that triggers a small text editor Like wxStringProperty, but has a button that triggers a small text editor
@@ -520,15 +578,27 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
@subsection wxDirProperty @subsection wxDirProperty
Like wxLongStringProperty, but the button triggers dir selector instead. Like wxLongStringProperty, but the button triggers dir selector instead.
Supported properties (all with string value): wxPG_DIR_DIALOG_MESSAGE.
Supported special attributes:
- wxPG_DIR_DIALOG_MESSAGE: Sets specific message in the dir selector.
@see propgrid_property_attributes
@subsection wxFileProperty @subsection wxFileProperty
Like wxLongStringProperty, but the button triggers file selector instead. Like wxLongStringProperty, but the button triggers file selector instead.
Default wildcard is "All files..." but this can be changed by setting Default wildcard is "All files..." but this can be changed by setting
wxPG_FILE_WILDCARD attribute (see wxFileDialog for format details). wxPG_FILE_WILDCARD attribute.
Attribute wxPG_FILE_SHOW_FULL_PATH can be set to @false in order to show
only the filename, not the entire path. Supported special attributes:
- wxPG_FILE_WILDCARD: Sets wildcard (see wxFileDialog for format details), "All
files..." is default.
- wxPG_FILE_SHOW_FULL_PATH: Default @true. When @false, only the file name is shown
(i.e. drive and directory are hidden).
- wxPG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the
given path string.
- wxPG_FILE_INITIAL_PATH: Sets the initial path of where to look for files.
- wxPG_FILE_DIALOG_TITLE: Sets a specific title for the dir dialog.
@see propgrid_property_attributes
@subsection wxEnumProperty @subsection wxEnumProperty
@@ -550,33 +620,54 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
@subsection wxArrayStringProperty @subsection wxArrayStringProperty
Allows editing of a list of strings in wxTextCtrl and in a separate Property that manages a list of strings. Allows editing of a list
dialog. Supports "Delimiter" attribute, which defaults to comma (','). of strings in wxTextCtrl and in a separate dialog.
Supported special attributes:
- wxPG_ARRAY_DELIMITER: Sets string delimiter character.
Default is comma (',').
@see propgrid_property_attributes
@subsection wxDateProperty @subsection wxDateProperty
wxDateTime property. Default editor is DatePickerCtrl, although TextCtrl Property representing wxDateTime. Default editor is DatePickerCtrl,
should work as well. wxPG_DATE_FORMAT attribute can be used to change although TextCtrl should work as well.
string wxDateTime::Format uses (although default is recommended as it is
locale-dependent), and wxPG_DATE_PICKER_STYLE allows changing window Supported special attributes:
style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY). - wxPG_DATE_FORMAT: Determines displayed date format (with wxDateTime::Format).
Using wxDP_ALLOWNONE will enable better unspecified value support. Default is recommended as it is locale-dependent.
- wxPG_DATE_PICKER_STYLE: Determines window style used with wxDatePickerCtrl.
Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE
enables additional support for unspecified property value.
@see propgrid_property_attributes
@subsection wxEditEnumProperty @subsection wxEditEnumProperty
Represents a string that can be freely edited or selected from list of choices - Represents a string that can be freely edited or selected from list of choices -
custom combobox control is used to edit the value. custom combobox control is used to edit the value.
@remarks
Uses int value, similar to wxEnumProperty, unless text entered by user is
is not in choices (in which case string value is used).
@subsection wxMultiChoiceProperty @subsection wxMultiChoiceProperty
Allows editing a multiple selection from a list of strings. This is Allows editing a multiple selection from a list of strings. This is
property is pretty much built around concept of wxMultiChoiceDialog. property is pretty much built around concept of wxMultiChoiceDialog.
It uses wxArrayString value. It uses wxArrayString value.
Supported special attributes:
- wxPG_ATTR_MULTICHOICE_USERSTRINGMODE: If > 0, allows user to manually
enter strings that are not in the list of choices. If this value is 1,
user strings are preferably placed in front of valid choices. If value
is 2, then those strings will placed behind valid choices.
@see propgrid_property_attributes
@subsection wxImageFileProperty @subsection wxImageFileProperty
Like wxFileProperty, but has thumbnail of the image in front of Property representing image file(name). Like wxFileProperty,
the filename and autogenerates wildcard from available image handlers. but has thumbnail of the image in front of the filename
and autogenerates wildcard from available image handlers.
@subsection wxColourProperty @subsection wxColourProperty
@@ -586,8 +677,10 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
There are various sub-classing opportunities with this class. See There are various sub-classing opportunities with this class. See
below in wxSystemColourProperty section for details. below in wxSystemColourProperty section for details.
Setting "HasAlpha" attribute to @true for this property allows user to Supported special attributes:
edit the alpha colour component. - wxPG_COLOUR_HAS_ALPHA: If set to @true allows user to edit the alpha
colour component.
@see propgrid_property_attributes
@subsection wxFontProperty @subsection wxFontProperty
@@ -618,7 +711,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
}; };
@endcode @endcode
in wxSystemColourProperty, and its derived class wxColourProperty, there In wxSystemColourProperty, and its derived class wxColourProperty, there
are various sub-classing features. To set a basic list of colour are various sub-classing features. To set a basic list of colour
names, call wxPGProperty::SetChoices(). names, call wxPGProperty::SetChoices().
@@ -1488,19 +1581,19 @@ public:
wxPGProperty* GetItemAtY( unsigned int y ) const; wxPGProperty* GetItemAtY( unsigned int y ) const;
/** /**
Returns true if property has given flag set. Returns @true if property has given flag set.
@see propgrid_propflags @see propgrid_propflags
*/ */
bool HasFlag(wxPGPropertyFlags flag) const; bool HasFlag(wxPGPropertyFlags flag) const;
/** /**
Returns true if property has given flag set. Returns @true if property has given flag set.
*/ */
bool HasFlag(FlagType flag) const; bool HasFlag(FlagType flag) const;
/** /**
Returns true if property has all given flags set. Returns @true if property has all given flags set.
*/ */
bool HasFlagsExact(FlagType flags) const; bool HasFlagsExact(FlagType flags) const;

View File

@@ -71,6 +71,38 @@ wxPG_SORT_TOP_LEVEL_ONLY = 0x00000200
/** @} /** @}
*/ */
/** @section propgrid_misc_data wxPropertyGrid Miscellaneous
This section describes some miscellaneous values, types and macros.
@{
*/
/**
Used to tell wxPGProperty to use label as name as well.
*/
#define wxPG_LABEL (*wxPGProperty::sm_wxPG_LABEL)
/**
This is the value placed in wxPGProperty::sm_wxPG_LABEL
*/
#define wxPG_LABEL_STRING wxS("@!")
#define wxPG_COLOUR_BLACK (*wxBLACK)
/**
Convert Red, Green and Blue to a single 32-bit value.
*/
#define wxPG_COLOUR(R,G,B) ((wxUint32)(R+(G<<8)+(B<<16)))
/**
If property is supposed to have custom-painted image, then returning
this in OnMeasureImage() will usually be enough.
*/
#define wxPG_DEFAULT_IMAGE_SIZE wxDefaultSize
/** @}
*/
/** /**
@class wxPropertyGridInterface @class wxPropertyGridInterface