/** 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.
*/
// 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
// 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)
// 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<wxPGCell> m_propCellsBackup;
+
+ // NB: These *cannot* be moved to globals.
// labels when properties use common values
wxVector<wxPGCommonValue*> m_commonValues;
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 );