diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 6322ca1874..a51ff229e9 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -106,7 +106,7 @@ public: 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. */ virtual bool IsHandlingAllEvents() const; @@ -231,7 +231,9 @@ public: long style = wxPGMAN_DEFAULT_STYLE, const wxString& name = wxPropertyGridManagerNameStr ); - /** Destructor */ + /** + Destructor. + */ virtual ~wxPropertyGridManager(); /** @@ -293,7 +295,7 @@ public: Enables or disables (shows/hides) categories according to parameter enable. @remarks - Calling his may not properly update toolbar buttons. + Calling this may not properly update toolbar buttons. */ bool EnableCategories( bool enable ); @@ -325,7 +327,7 @@ public: 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 containers. */ @@ -405,7 +407,7 @@ public: @param pageObj 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. */ @@ -445,7 +447,7 @@ public: Select and displays a given page. @param index - Index of page being seleced. Can be -1 to select nothing. + Index of page being selected. Can be -1 to select nothing. */ void SelectPage( int index ); diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 045291967e..c53e0bd8ac 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -33,190 +33,6 @@ struct wxPGPaintData int m_drawnHeight; }; -/** - @class wxPGPaintData - - Contains information relayed to property's OnCustomPaint. -*/ -struct wxPGPaintData -{ - /** wxPropertyGrid. */ - const wxPropertyGrid* m_parent; - - /** - Normally -1, otherwise index to drop-down list item that has to be - drawn. - */ - int m_choiceItem; - - /** Set to drawn width in OnCustomPaint (optional). */ - int m_drawnWidth; - - /** - In a measure item call, set this to the height of item at m_choiceItem - index. - */ - int m_drawnHeight; -}; - - -// space between vertical sides of a custom image -#define wxPG_CUSTOM_IMAGE_SPACINGY 1 - -// space between caption and selection rectangle, -#define wxPG_CAPRECTXMARGIN 2 - -// horizontally and vertically -#define wxPG_CAPRECTYMARGIN 1 - - -/** - @class wxPGCellRenderer - - Base class for wxPropertyGrid cell renderers. -*/ -class wxPGCellRenderer : public wxObjectRefData -{ -public: - - wxPGCellRenderer() - : wxObjectRefData() { } - virtual ~wxPGCellRenderer() { } - - // Render flags - enum - { - // We are painting selected item - Selected = 0x00010000, - - // We are painting item in choice popup - ChoicePopup = 0x00020000, - - // We are rendering wxOwnerDrawnComboBox control - // (or other owner drawn control, but that is only - // officially supported one ATM). - Control = 0x00040000, - - // We are painting a disable property - Disabled = 0x00080000, - - // We are painting selected, disabled, or similar - // item that dictates fore- and background colours, - // overriding any cell values. - DontUseCellFgCol = 0x00100000, - DontUseCellBgCol = 0x00200000, - DontUseCellColours = DontUseCellFgCol | - DontUseCellBgCol - }; - - /** - Returns @true if rendered something in the foreground (text or - bitmap. - */ - virtual bool Render( wxDC& dc, - const wxRect& rect, - const wxPropertyGrid* propertyGrid, - wxPGProperty* property, - int column, - int item, - int flags ) const = 0; - - /** Returns size of the image in front of the editable area. - @remarks - If property is NULL, then this call is for a custom value. In that case - the item is index to wxPropertyGrid's custom values. - */ - virtual wxSize GetImageSize( const wxPGProperty* property, - int column, - int item ) const; - - /** Paints property category selection rectangle. - */ - virtual void DrawCaptionSelectionRect( wxDC& dc, - int x, int y, - int w, int h ) const; - - /** Utility to draw vertically centered text. - */ - void DrawText( wxDC& dc, - const wxRect& rect, - int imageWidth, - const wxString& text ) const; - - /** - Utility to draw editor's value, or vertically aligned text if editor is - NULL. - */ - void DrawEditorValue( wxDC& dc, const wxRect& rect, - int xOffset, const wxString& text, - wxPGProperty* property, - const wxPGEditor* editor ) const; - - /** Utility to render cell bitmap and set text colour plus bg brush - colour. - - @return Returns image width, which, for instance, can be passed to - DrawText. - */ - int PreDrawCell( wxDC& dc, - const wxRect& rect, - const wxPGCell& cell, - int flags ) const; - - /** - Utility to be called after drawing is done, to revert whatever - changes PreDrawCell() did. - - @param flags - Same as those passed to PreDrawCell(). - */ - void PostDrawCell( wxDC& dc, - const wxPropertyGrid* propGrid, - const wxPGCell& cell, - int flags ) const; -}; - - -/** - @class wxPGDefaultRenderer - - Default cell renderer, that can handles the common - scenarios. -*/ -class wxPGDefaultRenderer : public wxPGCellRenderer -{ -public: - virtual bool Render( wxDC& dc, - const wxRect& rect, - const wxPropertyGrid* propertyGrid, - wxPGProperty* property, - int column, - int item, - int flags ) const; - - virtual wxSize GetImageSize( const wxPGProperty* property, - int column, - int item ) const; -}; - - -class wxPGCellData : public wxObjectRefData -{ -public: - wxPGCellData(); - - void SetText( const wxString& text ); - void SetBitmap( const wxBitmap& bitmap ); - void SetFgCol( const wxColour& col ); - void SetBgCol( const wxColour& col ); - void SetFont( const wxFont& font ); - -protected: - virtual ~wxPGCellData() { } -}; - - - /** @section propgrid_property_attributes wxPropertyGrid Property Attribute Identifiers @@ -284,7 +100,8 @@ protected: */ #define wxPG_FLOAT_PRECISION wxS("Precision") -/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed to textctrl etc). +/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed + to textctrl etc.). */ #define wxPG_STRING_PASSWORD wxS("Password") @@ -400,29 +217,35 @@ enum wxPGPropertyFlags { /** Indicates bold font. + @hideinitializer */ wxPG_PROP_MODIFIED = 0x0001, /** Disables ('greyed' text and editor does not activate) property. + @hideinitializer */ wxPG_PROP_DISABLED = 0x0002, /** Hider button will hide this property. + @hideinitializer */ wxPG_PROP_HIDDEN = 0x0004, /** This property has custom paint image just in front of its value. If property only draws custom images into a popup list, then this flag should not be set. + @hideinitializer */ wxPG_PROP_CUSTOMIMAGE = 0x0008, /** Do not create text based editor for this property (but button-triggered dialog and choice are ok). + @hideinitializer */ wxPG_PROP_NOEDITOR = 0x0010, -/** Property is collapsed, i.e. it's children are hidden. +/** Property is collapsed, ie. it's children are hidden. + @hideinitializer */ wxPG_PROP_COLLAPSED = 0x0020, @@ -433,22 +256,26 @@ wxPG_PROP_COLLAPSED = 0x0020, If property is not selected, then indicates that the actual property value has failed validation (NB: this behaviour is not currently supported, but may be used in the future). + @hideinitializer */ wxPG_PROP_INVALID_VALUE = 0x0040, /** Switched via SetWasModified(). Temporary flag - only used when setting/changing property value. + @hideinitializer */ wxPG_PROP_WAS_MODIFIED = 0x0200, /** If set, then child properties (if any) are private, and should be "invisible" to the application. + @hideinitializer */ wxPG_PROP_AGGREGATE = 0x0400, /** If set, then child properties (if any) are copies and should not be deleted in dtor. + @hideinitializer */ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, @@ -456,6 +283,7 @@ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, Classifies this item as a non-category. Used for faster item type identification. + @hideinitializer */ wxPG_PROP_PROPERTY = 0x1000, @@ -463,17 +291,20 @@ wxPG_PROP_PROPERTY = 0x1000, Classifies this item as a category. Used for faster item type identification. + @hideinitializer */ wxPG_PROP_CATEGORY = 0x2000, /** Classifies this item as a property that has children, but is not aggregate - (ie children are not private). + (i.e. children are not private). + @hideinitializer */ wxPG_PROP_MISC_PARENT = 0x4000, /** Property is read-only. Editor is still created for wxTextCtrl-based property editors. For others, editor is not usually created because they do implement wxTE_READONLY style or equivalent. + @hideinitializer */ wxPG_PROP_READONLY = 0x8000, @@ -484,12 +315,14 @@ wxPG_PROP_READONLY = 0x8000, /** Property's value is composed from values of child properties. @remarks This flag cannot be used with property iterators. + @hideinitializer */ wxPG_PROP_COMPOSED_VALUE = 0x00010000, /** Common value of property is selectable in editor. @remarks This flag cannot be used with property iterators. + @hideinitializer */ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, @@ -502,18 +335,22 @@ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, This flag cannot be used with property iterators. @see wxPGProperty::SetAutoUnspecified() + @hideinitializer */ wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000, /** Indicates the bit useable by derived properties. + @hideinitializer */ wxPG_PROP_CLASS_SPECIFIC_1 = 0x00080000, /** Indicates the bit useable by derived properties. + @hideinitializer */ wxPG_PROP_CLASS_SPECIFIC_2 = 0x00100000, /** Indicates that the property is being deleted and should be ignored. + @hideinitializer */ wxPG_PROP_BEING_DELETED = 0x00200000 @@ -592,11 +429,15 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxStringProperty - Simple string property. wxPG_STRING_PASSWORD attribute may be used - to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl. - wxPG_ATTR_AUTOCOMPLETE attribute may be used to enable auto-completion + Simple string property. + + Supported special attributes: + - @c wxPG_STRING_PASSWORD: Set to @true in order to echo value as asterisks and + to use @c wxTE_PASSWORD on the editor (wxTextCtrl). + - @c wxPG_ATTR_AUTOCOMPLETE: Set to @true to enable auto-completion (use a wxArrayString value), and is also supported by any property that happens to use a wxTextCtrl-based editor. + @see @ref propgrid_property_attributes @remarks wxStringProperty has a special trait: if it has value of "", and also has child properties, then its displayed @@ -606,7 +447,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxIntProperty Like wxStringProperty, but converts text to a signed long integer. - wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong). + wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong) on overlfow. To safely convert variant to integer, use code like this: @code @@ -617,21 +458,61 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property); @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: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX to specify acceptable value range. + @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 + the prefix used globally, manipulate @c wxPG_UINT_PREFIX string attribute. + To set the globally used base, manipulate @c wxPG_UINT_BASE int 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 integers (i.e. wxULongLong). Same wxVariant safety rules apply. + Supported special attributes: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. + - @c wxPG_UINT_BASE: Defines base. Valid constants are @c wxPG_BASE_OCT, + @c wxPG_BASE_DEC, @c wxPG_BASE_HEX and @c wxPG_BASE_HEXL (lowercase characters). + Arbitrary bases are not supported. + - @c wxPG_UINT_PREFIX: Defines displayed prefix. Possible values are + @c wxPG_PREFIX_NONE, @c wxPG_PREFIX_0x and @c wxPG_PREFIX_DOLLAR_SIGN. + Only @c wxPG_PREFIX_NONE works with decimal and octal numbers. + @see @ref 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 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. + by modifying @c wxPG_FLOAT_PRECISION attribute. Note that when displaying the value, sign is omitted if the resulting textual representation is effectively zero (for example, -0.0001 with @@ -639,12 +520,26 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 what C standard library does, but should result in better end-user experience in almost all cases. + Supported special attributes: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. + - @c 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 @ref propgrid_property_attributes + @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 in order to + default. @c wxPG_BOOL_USE_CHECKBOX attribute can be set to @true in order to use check box instead. + Supported special attributes: + - @c wxPG_BOOL_USE_CHECKBOX: If set to @true uses check box editor instead + of combo box. + - @c wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING: If set to @true cycles combo box + instead showing the list. + @see @ref propgrid_property_attributes + @subsection wxLongStringProperty Like wxStringProperty, but has a button that triggers a small text editor @@ -685,15 +580,27 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxDirProperty Like wxLongStringProperty, but the button triggers dir selector instead. - Supported properties (all with string value): wxPG_DIR_DIALOG_MESSAGE. + + Supported special attributes: + - @c wxPG_DIR_DIALOG_MESSAGE: Sets specific message in the dir selector. + @see @ref propgrid_property_attributes @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 in order to show - only the filename, not the entire path. + @c wxPG_FILE_WILDCARD attribute. + + Supported special attributes: + - @c wxPG_FILE_WILDCARD: Sets wildcard (see wxFileDialog for format details), "All + files..." is default. + - @c wxPG_FILE_SHOW_FULL_PATH: Default @true. When @false, only the file name is shown + (i.e. drive and directory are hidden). + - @c wxPG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the + given path string. + - @c wxPG_FILE_INITIAL_PATH: Sets the initial path of where to look for files. + - @c wxPG_FILE_DIALOG_TITLE: Sets a specific title for the dir dialog. + @see @ref propgrid_property_attributes @subsection wxEnumProperty @@ -715,33 +622,54 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxArrayStringProperty - Allows editing of a list of strings in wxTextCtrl and in a separate - dialog. Supports "Delimiter" attribute, which defaults to comma (','). + Property that manages a list of strings. Allows editing of a list + of strings in wxTextCtrl and in a separate dialog. + + Supported special attributes: + - @c wxPG_ARRAY_DELIMITER: Sets string delimiter character. + Default is comma (','). + @see @ref propgrid_property_attributes @subsection wxDateProperty - wxDateTime property. Default editor is DatePickerCtrl, although TextCtrl - should work as well. wxPG_DATE_FORMAT attribute can be used to change - string wxDateTime::Format uses (although default is recommended as it is - locale-dependent), and wxPG_DATE_PICKER_STYLE allows changing window - style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY). - Using wxDP_ALLOWNONE will enable better unspecified value support. + Property representing wxDateTime. Default editor is DatePickerCtrl, + although TextCtrl should work as well. + + Supported special attributes: + - @c wxPG_DATE_FORMAT: Determines displayed date format (with wxDateTime::Format). + Default is recommended as it is locale-dependent. + - @c wxPG_DATE_PICKER_STYLE: Determines window style used with wxDatePickerCtrl. + Default is @c wxDP_DEFAULT | @c wxDP_SHOWCENTURY. Using @c wxDP_ALLOWNONE + enables additional support for unspecified property value. + @see @ref propgrid_property_attributes @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. + @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 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. + Supported special attributes: + - @c 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 @ref propgrid_property_attributes + @subsection wxImageFileProperty - Like wxFileProperty, but has thumbnail of the image in front of - the filename and autogenerates wildcard from available image handlers. + Property representing image file(name). Like wxFileProperty, + but has thumbnail of the image in front of the filename + and autogenerates wildcard from available image handlers. @subsection wxColourProperty @@ -751,8 +679,10 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 There are various sub-classing opportunities with this class. See below in wxSystemColourProperty section for details. - Setting "HasAlpha" attribute to @true for this property allows user to - edit the alpha colour component. + Supported special attributes: + - @c wxPG_COLOUR_HAS_ALPHA: If set to @true allows user to edit the alpha + colour component. + @see @ref propgrid_property_attributes @subsection wxFontProperty @@ -783,7 +713,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 }; @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 names, call wxPGProperty::SetChoices(). @@ -1071,7 +1001,7 @@ public: @remarks - Default behaviour is to return wxSize(0,0), which means no image. - Default image width or height is indicated with dimension -1. - - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxSize(-1, -1). + - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxDefaultSize. */ virtual wxSize OnMeasureImage( int item = -1 ) const; @@ -1447,7 +1377,7 @@ public: double GetAttributeAsDouble( const wxString& name, double defVal ) const; /** - Returns attributes as list wxVariant. + Returns comma-delimited string of property attributes. */ const wxPGAttributeStorage& GetAttributes() const; @@ -1461,7 +1391,9 @@ public: */ const wxPGEditor* GetColumnEditor( int column ) const; - /** Returns property's base name (i.e. parent's name is not added in any case) */ + /** Returns property's base name (i.e. parent's name is not added + in any case). + */ const wxString& GetBaseName() const; /** @@ -1510,7 +1442,7 @@ public: */ void* GetClientData() const; - /** Sets managed client object of a property. + /** Gets managed client object of a property. */ wxClientData *GetClientObject() const; @@ -1545,7 +1477,7 @@ public: const wxPGEditor* GetEditorClass() const; /** - Returns property flags. + Returns property's hint text (shown in empty value cell). */ inline wxString GetHintText() const; @@ -1762,6 +1694,7 @@ public: /** Returns @true if candidateParent is some parent of this property. + Use, for example, to detect if item is inside collapsed section. */ bool IsSomeParent( wxPGProperty* candidateParent ) const; @@ -1820,9 +1753,8 @@ public: */ void SetAttribute( const wxString& name, wxVariant value ); - void SetAttributes( const wxPGAttributeStorage& attributes ); - + /** Set if user can change the property's value to unspecified by modifying the value of the editor control (usually by clearing @@ -1845,6 +1777,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyBackgroundColour(), + this does not automatically update the display. */ void SetBackgroundColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1890,7 +1826,7 @@ public: */ void SetClientData( void* clientData ); - /** Returns client object of a property. + /** Sets client object of a property. */ void SetClientObject(wxClientData* clientObject); @@ -1934,8 +1870,11 @@ public: /** Sets property's label. - @remarks Properties under same parent may have same labels. However, - property names must still remain unique. + @remarks + - Properties under same parent may have same labels. However, + property names must still remain unique. + - Unlike wxPropertyGridInterface::SetPropertyLabel(), + this does not automatically update the display. */ void SetLabel( const wxString& label ); @@ -1977,6 +1916,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyTextColour(), + this does not automatically update the display. */ void SetTextColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -2050,6 +1993,9 @@ public: /** Updates composed values of parent non-category properties, recursively. Returns topmost property updated. + + @remarks + Must not call SetValue() (as can be called in it). */ wxPGProperty* UpdateParentValues(); @@ -2065,7 +2011,34 @@ public: protected: /** - Helper for language bindings. + Sets property cell in fashion that reduces number of exclusive + copies of cell data. Used when setting, for instance, same + background colour for a number of properties. + + @param firstCol + First column to affect. + + @param lastCol + Last column to affect. + + @param preparedCell + Pre-prepared cell that is used for those which cell data + before this matched unmodCellData. + + @param srcData + If unmodCellData did not match, valid cell data from this + is merged into cell (usually generating new exclusive copy + of cell's data). + + @param unmodCellData + If cell's cell data matches this, its cell is now set to + preparedCell. + + @param ignoreWithFlags + Properties with any one of these flags are skipped. + + @param recursively + If @true, apply this operation recursively in child properties. */ void AdaptiveSetCell( unsigned int firstCol, unsigned int lastCol, @@ -2112,9 +2085,6 @@ protected: Returns true if child property is selected. */ bool IsChildSelected( bool recursive = false ) const; - - void SetFlag( wxPGPropertyFlags flag ); - void ClearFlag( FlagType flag ); }; // ----------------------------------------------------------------------- @@ -2501,38 +2471,80 @@ public: */ wxPGChoices( const wxPGChoices& a ); - /** Constructor. */ + /** + Constructor. + + @param labels + Labels for choices. + + @param values + Values for choices. If @NULL, indexes are used. + */ wxPGChoices( const wxChar** labels, const long* values = NULL ); - /** Constructor. */ + /** + Constructor. + + @param labels + Labels for choices. + + @param values + Values for choices. If empty, indexes are used. + */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); - /** Constructor. */ + /** + Simple interface constructor. + */ wxPGChoices( wxPGChoicesData* data ); - /** Destructor. */ + /** + Destructor. + */ ~wxPGChoices(); /** Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies. + + @param labels + Labels for added choices. + + @param values + Values for added choices. If empty, relevant entry indexes are used. */ void Add( const wxChar** labels, const ValArrItem* values = NULL ); - /** Version that works with wxArrayString and wxArrayInt. */ + /** + Adds to current. Version that works with wxArrayString and wxArrayInt. + */ void Add( const wxArrayString& arr, const wxArrayInt& arrint ); - /** Adds single item. */ + /** + Adds a single choice item. + + @param label + Label for added choice. + + @param value + Value for added choice. If unspecified, index is used. + */ wxPGChoiceEntry& Add( const wxString& label, int value = wxPG_INVALID_VALUE ); - /** Adds a single item, with bitmap. */ + /** + Adds a single item, with bitmap. + */ wxPGChoiceEntry& Add( const wxString& label, const wxBitmap& bitmap, int value = wxPG_INVALID_VALUE ); - /** Adds a single item with full entry information. */ + /** + Adds a single item with full entry information. + */ wxPGChoiceEntry& Add( const wxPGChoiceEntry& entry ); - /** Adds single item, sorted. */ + /** + Adds a single item, sorted. + */ wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); /** @@ -2574,7 +2586,7 @@ public: unsigned int GetCount() const; /** - Returns value of item; + Returns value of item. */ int GetValue( unsigned int ind ) const; @@ -2602,7 +2614,7 @@ public: int Index( int val ) const; /** - Inserts single item. + Inserts a single item. */ wxPGChoiceEntry& Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index 21637fa6bd..38131acb31 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -398,7 +398,7 @@ public: void GetPropertiesWithFlag( wxArrayPGProperty* targetArr, wxPGProperty::FlagType flags, bool inverse = false, - int iterFlags = wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES ) const; + int iterFlags = (wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES) ) const; /** Returns value of given attribute. If none found, returns wxNullVariant.