]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/propgridiface.h
Made wxInfoBar::SetFont() change the text message font.
[wxWidgets.git] / include / wx / propgrid / propgridiface.h
index 2ef34d7a2de8697acdb9a542bcf575d2b9aa74d9..29d0116aad92fcd2aeba263b40432f14986b3669 100644 (file)
@@ -210,8 +210,12 @@ public:
         @return Returns @true if successful or if there was no selection. May
                 fail if validation was enabled and active editor had invalid
                 value.
         @return Returns @true if successful or if there was no selection. May
                 fail if validation was enabled and active editor had invalid
                 value.
+
+        @remarks In wxPropertyGrid 1.4, this member function used to send
+                 wxPG_EVT_SELECTED. In wxWidgets 2.9 and later, it no longer
+                 does that.
     */
     */
-    bool ClearSelection( bool validation = false);
+    bool ClearSelection( bool validation = false );
 
     /** Resets modified status of all properties.
     */
 
     /** Resets modified status of all properties.
     */
@@ -537,23 +541,17 @@ public:
         return value.GetArrayString();
     }
 
         return value.GetArrayString();
     }
 
-#if wxUSE_LONGLONG_NATIVE
+#ifdef wxLongLong_t
     wxLongLong_t GetPropertyValueAsLongLong( wxPGPropArg id ) const
     {
     wxLongLong_t GetPropertyValueAsLongLong( wxPGPropArg id ) const
     {
-        wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL_WFALLBACK("wxLongLong",
-                                             (long) GetPropertyValueAsLong(id))
-        wxLongLong ll;
-        ll << value;
-        return ll.GetValue();
+        wxPG_PROP_ARG_CALL_PROLOG_RETVAL(0)
+        return p->GetValue().GetLongLong().GetValue();
     }
 
     wxULongLong_t GetPropertyValueAsULongLong( wxPGPropArg id ) const
     {
     }
 
     wxULongLong_t GetPropertyValueAsULongLong( wxPGPropArg id ) const
     {
-        wxPG_PROP_ID_GETPROPVAL_CALL_PROLOG_RETVAL_WFALLBACK("wxULongLong",
-                                    (unsigned long) GetPropertyValueAsULong(id))
-        wxULongLong ull;
-        ull << value;
-        return ull.GetValue();
+        wxPG_PROP_ARG_CALL_PROLOG_RETVAL(0)
+        return p->GetValue().GetULongLong().GetValue();
     }
 #endif
 
     }
 #endif
 
@@ -593,10 +591,23 @@ public:
     }
 #endif
 
     }
 #endif
 
-    /** Returns currently selected property. */
-    wxPGProperty* GetSelection() const
+    /**
+        Returns currently selected property. NULL if none.
+
+        @remarks When wxPG_EX_MULTIPLE_SELECTION extra style is used, this
+                 member function returns the focused property, that is the
+                 one which can have active editor.
+    */
+    wxPGProperty* GetSelection() const;
+
+    /**
+        Returns list of currently selected properties.
+
+        @remarks wxArrayPGProperty should be compatible with std::vector API.
+    */
+    const wxArrayPGProperty& GetSelectedProperties() const
     {
     {
-        return m_pState->GetSelection();
+        return m_pState->m_selection;
     }
 
 #ifndef SWIG
     }
 
 #ifndef SWIG
@@ -726,10 +737,19 @@ public:
         return ( (p->GetFlags() & wxPG_PROP_MODIFIED) ? true : false );
     }
 
         return ( (p->GetFlags() & wxPG_PROP_MODIFIED) ? true : false );
     }
 
+    /**
+        Returns true if property is selected.
+    */
+    bool IsPropertySelected( wxPGPropArg id ) const
+    {
+        wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
+        return m_pState->DoIsPropertySelected(p);
+    }
+
     /**
         Returns true if property is shown (ie hideproperty with true not
         called for it).
     /**
         Returns true if property is shown (ie hideproperty with true not
         called for it).
-     */
+    */
     bool IsPropertyShown( wxPGPropArg id ) const
     {
         wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
     bool IsPropertyShown( wxPGPropArg id ) const
     {
         wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
@@ -1036,9 +1056,8 @@ public:
     }
 
 #ifndef SWIG
     }
 
 #ifndef SWIG
-    /** Sets various property values from a list of wxVariants. If property with
-        name is missing from the grid, new property is created under given
-        default category (or root if omitted).
+    /**
+        Sets property values from a list of wxVariants.
     */
     void SetPropertyValues( const wxVariantList& list,
                             wxPGPropArg defaultCategory = wxNullProperty )
     */
     void SetPropertyValues( const wxVariantList& list,
                             wxPGPropArg defaultCategory = wxNullProperty )
@@ -1049,6 +1068,9 @@ public:
         m_pState->DoSetPropertyValues(list, p);
     }
 
         m_pState->DoSetPropertyValues(list, p);
     }
 
+    /**
+        Sets property values from a list of wxVariants.
+    */
     void SetPropertyValues( const wxVariant& list,
                             wxPGPropArg defaultCategory = wxNullProperty )
     {
     void SetPropertyValues( const wxVariant& list,
                             wxPGPropArg defaultCategory = wxNullProperty )
     {
@@ -1170,7 +1192,7 @@ public:
         SetPropVal( id, v );
     }
 
         SetPropVal( id, v );
     }
 
-#if wxUSE_LONGLONG_NATIVE
+#ifdef wxLongLong_t
     /** Sets value (wxLongLong&) of a property.
     */
     void SetPropertyValue( wxPGPropArg id, wxLongLong_t value )
     /** Sets value (wxLongLong&) of a property.
     */
     void SetPropertyValue( wxPGPropArg id, wxLongLong_t value )
@@ -1265,10 +1287,16 @@ public:
 
     static wxPGEditor* GetEditorByName( const wxString& editorName );
 
 
     static wxPGEditor* GetEditorByName( const wxString& editorName );
 
+    // NOTE: This function reselects the property and may cause
+    //       excess flicker, so to just call Refresh() on a rect
+    //       of single property, call DrawItem() instead.
     virtual void RefreshProperty( wxPGProperty* p ) = 0;
 
 protected:
 
     virtual void RefreshProperty( wxPGProperty* p ) = 0;
 
 protected:
 
+    bool DoClearSelection( bool validation = false,
+                           int selFlags = 0 );
+
     /**
         In derived class, implement to set editable state component with
         given name to given value.
     /**
         In derived class, implement to set editable state component with
         given name to given value.
@@ -1321,13 +1349,17 @@ private:
     // Cannot be GetGrid() due to ambiguity issues.
     wxPropertyGrid* GetPropertyGrid()
     {
     // Cannot be GetGrid() due to ambiguity issues.
     wxPropertyGrid* GetPropertyGrid()
     {
+        if ( !m_pState )
+            return NULL;
         return m_pState->GetGrid();
     }
 
     // Cannot be GetGrid() due to ambiguity issues.
     const wxPropertyGrid* GetPropertyGrid() const
     {
         return m_pState->GetGrid();
     }
 
     // Cannot be GetGrid() due to ambiguity issues.
     const wxPropertyGrid* GetPropertyGrid() const
     {
-        return (const wxPropertyGrid*) m_pState->GetGrid();
+        if ( !m_pState )
+            return NULL;
+        return static_cast<const wxPropertyGrid*>(m_pState->GetGrid());
     }
 #endif // #ifndef SWIG
 
     }
 #endif // #ifndef SWIG