]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/property.h
Correct the check for MRU menu items range.
[wxWidgets.git] / include / wx / propgrid / property.h
index 7057e9c2f44ddf8959e788ca2ccd39bb51a39915..14eca1252b3ee07b40877927a4aee2bc7f8a4ed0 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2008-08-23
 // RCS-ID:      $Id$
 // Copyright:   (c) Jaakko Salli
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_PROPGRID_PROPERTY_H_
@@ -367,7 +367,7 @@ protected:
     @{
 */
 
-enum wxPG_PROPERTY_FLAGS
+enum wxPGPropertyFlags
 {
 
 /** Indicates bold font.
@@ -499,7 +499,9 @@ wxPG_PROP_BEING_DELETED             = 0x00200000
     Code should automatically take care of this, however.
 */
 #define wxPG_PROP_PARENTAL_FLAGS \
-    (wxPG_PROP_AGGREGATE|wxPG_PROP_CATEGORY|wxPG_PROP_MISC_PARENT)
+    ((wxPGPropertyFlags)(wxPG_PROP_AGGREGATE | \
+                         wxPG_PROP_CATEGORY | \
+                         wxPG_PROP_MISC_PARENT))
 
 /** @}
 */
@@ -642,6 +644,15 @@ wxPG_PROP_BEING_DELETED             = 0x00200000
 */
 #define wxPG_DIR_DIALOG_MESSAGE             wxS("DialogMessage")
 
+/**
+    wxArrayStringProperty's string delimiter character. If this is aquotation
+    mark or hyphen, then strings will be quoted instead (with given
+    character).
+
+    Default delimiter is quotation mark.
+*/
+#define wxPG_ARRAY_DELIMITER                wxS("Delimiter")
+
 /** Sets displayed date format for wxDateProperty.
 */
 #define wxPG_DATE_FORMAT                    wxS("DateFormat")
@@ -1679,7 +1690,12 @@ public:
         return m_value.IsNull();
     }
 
-    FlagType HasFlag( FlagType flag ) const
+    /**
+        Returns non-zero if property has given flag set.
+
+        @see propgrid_propflags
+    */
+    FlagType HasFlag( wxPGPropertyFlags flag ) const
     {
         return ( m_flags & flag );
     }
@@ -1695,6 +1711,9 @@ public:
     */
     wxVariant GetAttributesAsList() const;
 
+    /**
+        Returns property flags.
+    */
     FlagType GetFlags() const
     {
         return m_flags;
@@ -1848,7 +1867,7 @@ public:
             By default changes are applied recursively. Set this paramter
             wxPG_DONT_RECURSE to prevent this.
     */
-    inline bool Hide( bool hide, int flags = wxPG_RECURSE );
+    bool Hide( bool hide, int flags = wxPG_RECURSE );
 
     bool IsExpanded() const
         { return (!(m_flags & wxPG_PROP_COLLAPSED) && GetChildCount()); }
@@ -2009,14 +2028,25 @@ public:
     }
 
     /**
-        Sets given property flag(s).
+        Sets given property flag.
+
+        @see propgrid_propflags
     */
-    void SetFlag( FlagType flag ) { m_flags |= flag; }
+    void SetFlag( wxPGPropertyFlags flag )
+    {
+        //
+        // NB: While using wxPGPropertyFlags here makes it difficult to
+        //     combine different flags, it usefully prevents user from
+        //     using incorrect flags (say, wxWindow styles).
+        m_flags |= flag;
+    }
 
     /**
-        Sets or clears given property flag(s).
+        Sets or clears given property flag.
+
+        @see propgrid_propflags
     */
-    void ChangeFlag( FlagType flag, bool set )
+    void ChangeFlag( wxPGPropertyFlags flag, bool set )
     {
         if ( set )
             m_flags |= flag;
@@ -2024,7 +2054,12 @@ public:
             m_flags &= ~flag;
     }
 
-    void SetFlagRecursively( FlagType flag, bool set );
+    /**
+        Sets or clears given property flag, recursively.
+
+        @see propgrid_propflags
+    */
+    void SetFlagRecursively( wxPGPropertyFlags flag, bool set );
 
     void SetHelpString( const wxString& helpString )
     {
@@ -2115,7 +2150,7 @@ public:
         @remarks This operation deselects the property and clears its
                  value.
     */
-    bool SetChoices( wxPGChoices& choices );
+    bool SetChoices( const wxPGChoices& choices );
 
     /** Set max length of text in text editor.
     */
@@ -2302,6 +2337,8 @@ protected:
                                   const wxVariantList* valueOverrides = NULL,
                                   wxPGHashMapS2S* childResults = NULL ) const;
 
+    bool DoHide( bool hide, int flags );
+
     void DoSetName(const wxString& str) { m_name = str; }
 
     /** Deletes all sub-properties. */