X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9bc11214291c792335fc7820d57d799f61d63943..74cc3ec18e117a6ea6bc1c23a9b70ff960f4c0ae:/include/wx/propgrid/propgrid.h diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index ac5d71c018..9eae5fad80 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -987,11 +987,22 @@ public: /** Sets background colour of margin. */ void SetMarginColour(const wxColour& col); - /** Sets background colour of property and all its children. Colours of - captions are not affected. Background brush cache is optimized for often - set colours to be set last. + /** + Sets background colour of property. + + @param id + Property name or pointer. + + @param colour + New background colour. + + @param recursively + If True, child properties are affected recursively. Property + categories are skipped if this flag is used. */ - void SetPropertyBackgroundColour( wxPGPropArg id, const wxColour& col ); + void SetPropertyBackgroundColour( wxPGPropArg id, + const wxColour& colour, + bool recursively = false); /** Resets text and background colours of given property. */ @@ -1215,9 +1226,21 @@ public: // Mostly useful for page switching. void SwitchState( wxPropertyGridPageState* pNewState ); - /** Pass this function to Connect calls in propertyclass::CreateEditor. + /** + When creating custom property editors, connect required editor events to + this function. For instance: + + @code + control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED, + wxEventHandler(wxPropertyGrid::OnCustomEditorEvent), + NULL, propgrid); + @endcode + + @remarks You should never need to call this function directly! + + @see wxPGEditor::CreateControls(), wxEvtHandler::Connect() */ - void OnCustomEditorEvent( wxCommandEvent &event ); + void OnCustomEditorEvent( wxEvent &event ); long GetInternalFlags() const { return m_iFlags; } bool HasInternalFlag( long flag ) const @@ -1361,6 +1384,16 @@ public: // Control font changer helper. void SetCurControlBoldFont(); + wxPGCell& GetPropertyDefaultCell() + { + return m_propertyDefaultCell; + } + + wxPGCell& GetCategoryDefaultCell() + { + return m_categoryDefaultCell; + } + // // Public methods for semi-public use // (not protected for optimization) @@ -1607,13 +1640,16 @@ protected: // background colour for empty space below the grid wxColour m_colEmptySpace; - // NB: These *cannot* be moved to globals. + // Default property colours + wxPGCell m_propertyDefaultCell; - // Array of background colour brushes. - wxArrayPtrVoid m_arrBgBrushes; + // Default property category + wxPGCell m_categoryDefaultCell; - // Array of foreground colours. - wxArrayPtrVoid m_arrFgCols; + // Backup of selected property's cells + wxVector m_propCellsBackup; + + // NB: These *cannot* be moved to globals. // labels when properties use common values wxVector m_commonValues; @@ -1778,14 +1814,6 @@ protected: static void RegisterDefaultEditors(); - // Sets m_bgColIndex to this property and all its children. - void SetBackgroundColourIndex( wxPGProperty* p, int index ); - - // Sets m_fgColIndex to this property and all its children. - void SetTextColourIndex( wxPGProperty* p, int index, int flags ); - - int CacheColour( const wxColour& colour ); - // Sets up basic event handling for child control void SetupChildEventHandling( wxWindow* wnd );