X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5405bfb439dcb552bd79e6f35c347498811f85ef..75a2c6a1ee034a5d866b4a121a97351603bce98b:/include/wx/propgrid/propgrid.h?ds=sidebyside diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 2cd2d51d7b..ab69fecc4d 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -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) @@ -192,8 +195,8 @@ wxPG_TOOLBAR = 0x00001000, */ wxPG_DESCRIPTION = 0x00002000, -/** wxPropertyGridManager only: don't show an internal border around - the property grid. +/** wxPropertyGridManager only: don't show an internal border around the + property grid. Recommended if you use a header. */ wxPG_NO_INTERNAL_BORDER = 0x00004000 }; @@ -511,6 +514,19 @@ enum wxPG_KEYBOARD_ACTIONS // Don't make any graphics updates #define wxPG_SEL_NO_REFRESH 0x0100 +// ----------------------------------------------------------------------- + +// DoSetSplitterPosition() flags + +enum wxPG_SET_SPLITTER_POSITION_SPLITTER_FLAGS +{ + wxPG_SPLITTER_REFRESH = 0x0001, + wxPG_SPLITTER_ALL_PAGES = 0x0002, + wxPG_SPLITTER_FROM_EVENT = 0x0004, + wxPG_SPLITTER_FROM_AUTO_CENTER = 0x0008 +}; + + // ----------------------------------------------------------------------- #ifndef SWIG @@ -640,7 +656,9 @@ enum wxPG_KEYBOARD_ACTIONS starts resizing a column - can be vetoed. @event{EVT_PG_COL_DRAGGING,(id, func)} Respond to wxEVT_PG_COL_DRAGGING, event, generated when a - column resize by user is in progress. + column resize by user is in progress. This event is also generated + when user double-clicks the splitter in order to recenter + it. @event{EVT_PG_COL_END_DRAG(id, func)} Respond to wxEVT_PG_COL_END_DRAG event, generated after column resize by user has finished. @@ -662,6 +680,7 @@ class WXDLLIMPEXP_PROPGRID friend class wxPropertyGridPageState; friend class wxPropertyGridInterface; friend class wxPropertyGridManager; + friend class wxPGHeaderCtrl; DECLARE_DYNAMIC_CLASS(wxPropertyGrid) public: @@ -894,6 +913,9 @@ public: /** Returns background colour of margin. */ wxColour GetMarginColour() const { return m_colMargin; } + /** Returns margin width. */ + int GetMarginWidth() const { return m_marginWidth; } + /** Returns most up-to-date value of selected property. This will return value different from GetSelectedProperty()->GetValue() only when text @@ -1176,10 +1198,9 @@ public: during form creation may fail as initial grid size is often smaller than desired splitter position, especially when sizers are being used. */ - void SetSplitterPosition( int newxpos, int col = 0 ) + void SetSplitterPosition( int newXPos, int col = 0 ) { - DoSetSplitterPosition_(newxpos, true, col); - m_pState->m_isSplitterPreSet = true; + DoSetSplitterPosition(newXPos, col, wxPG_SPLITTER_REFRESH); } /** @@ -1221,6 +1242,41 @@ 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. + + @param argFlags For internal use only. + */ + wxString GetUnspecifiedValueText( int argFlags = 0 ) const; + /** Set virtual width for this particular page. Width -1 indicates that the virtual width should be disabled. */ void SetVirtualWidth( int width ); @@ -1738,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 // @@ -1994,6 +2056,10 @@ protected: void DoSetSelection( const wxArrayPGProperty& newSelection, int selFlags = 0 ); + void DoSetSplitterPosition( int newxpos, + int splitterIndex = 0, + int flags = wxPG_SPLITTER_REFRESH ); + bool DoAddToSelection( wxPGProperty* prop, int selFlags = 0 ); @@ -2007,11 +2073,6 @@ protected: wxPGProperty* DoGetItemAtY( int y ) const; - void DoSetSplitterPosition_( int newxpos, - bool refresh = true, - int splitterIndex = 0, - bool allPages = false ); - void DestroyEditorWnd( wxWindow* wnd ); void FreeEditors(); @@ -2037,9 +2098,23 @@ 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(); - // Omit the wxPG_SEL_NOVALIDATE flag to allow vetoing the event + /** + Send event from the property grid. + + Omit the wxPG_SEL_NOVALIDATE flag to allow vetoing the event + */ bool SendEvent( int eventType, wxPGProperty* p, wxVariant* pValue = NULL, unsigned int selFlags = wxPG_SEL_NOVALIDATE, @@ -2074,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) )