]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/propgrid.h
Get wxSearchCtrl text events working, and share the text event handler code among...
[wxWidgets.git] / include / wx / propgrid / propgrid.h
index 494423697da92c4b64373a99488303b788a0506a..ab69fecc4d6f161f22a50525beb7d445981af109 100644 (file)
@@ -87,7 +87,10 @@ public:
     wxPGCachedString    m_strMin;
     wxPGCachedString    m_strMax;
     wxPGCachedString    m_strUnits;
+    wxPGCachedString    m_strHint;
+#if wxPG_COMPATIBILITY_1_4
     wxPGCachedString    m_strInlineHelp;
+#endif
 
     // If true then some things are automatically translated
     bool                m_autoGetTranslation;
@@ -102,7 +105,7 @@ public:
     int HasExtraStyle( int style ) const { return (m_extraStyle & style); }
 };
 
-extern WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass* wxPGGlobalVars;
+extern WXDLLIMPEXP_DATA_PROPGRID(wxPGGlobalVarsClass*) wxPGGlobalVars;
 
 #define wxPGVariant_EmptyString     (wxPGGlobalVars->m_vEmptyString)
 #define wxPGVariant_Zero            (wxPGGlobalVars->m_vZero)
@@ -1239,6 +1242,33 @@ public:
         return m_sortFunction;
     }
 
+    /**
+        Sets appearance of value cells representing an unspecified property
+        value. Default appearance is blank.
+
+        @remarks If you set the unspecified value to have any
+                 textual representation, then that will override
+                 "InlineHelp" attribute.
+
+        @see wxPGProperty::SetValueToUnspecified(),
+             wxPGProperty::IsValueUnspecified()
+    */
+    void SetUnspecifiedValueAppearance( const wxPGCell& cell )
+    {
+        m_unspecifiedAppearance = m_propertyDefaultCell;
+        m_unspecifiedAppearance.MergeFrom(cell);
+    }
+
+    /**
+        Returns current appearance of unspecified value cells.
+
+        @see SetUnspecifiedValueAppearance()
+    */
+    const wxPGCell& GetUnspecifiedValueAppearance() const
+    {
+        return m_unspecifiedAppearance;
+    }
+
     /**
         Returns (visual) text representation of the unspecified
         property value.
@@ -1764,6 +1794,12 @@ protected:
     /** Actions and keys that trigger them. */
     wxPGHashMapI2I      m_actionTriggers;
 
+    /** Appearance of currently active editor. */
+    wxPGCell            m_editorAppearance;
+
+    /** Appearance of a unspecified value cell. */
+    wxPGCell            m_unspecifiedAppearance;
+
     //
     // Temporary values
     //
@@ -2062,6 +2098,16 @@ protected:
     */
     void RecalculateVirtualSize( int forceXPos = -1 );
 
+    void SetEditorAppearance( const wxPGCell& cell,
+                              bool unspecified = false );
+
+    void ResetEditorAppearance()
+    {
+        wxPGCell cell;
+        cell.SetEmptyData();
+        SetEditorAppearance(cell, false);
+    }
+
     void PrepareAfterItemsAdded();
 
     /**
@@ -2103,6 +2149,22 @@ inline unsigned int wxPropertyGridPageState::GetActualVirtualHeight() const
 }
 #endif
 
+inline wxString wxPGProperty::GetHintText() const
+{
+    wxVariant vHintText = GetAttribute(wxPGGlobalVars->m_strHint);
+
+#if wxPG_COMPATIBILITY_1_4
+    // Try the old, deprecated "InlineHelp"
+    if ( vHintText.IsNull() )
+        vHintText = GetAttribute(wxPGGlobalVars->m_strInlineHelp);
+#endif
+
+    if ( !vHintText.IsNull() )
+        return vHintText.GetString();
+
+    return wxEmptyString;
+}
+
 inline int wxPGProperty::GetDisplayedCommonValueCount() const
 {
     if ( HasFlag(wxPG_PROP_USES_COMMON_VALUE) )