Reworked wxPGCell. It is now reference counted, and therefore much more user friendly, and is used internally as basis for most property colour values instead of separate row text and bg colours.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-10-31 18:53:37 +00:00
parent 42632bcee1
commit d7e2b52235
11 changed files with 852 additions and 607 deletions

View File

@@ -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.
*/
@@ -1373,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)
@@ -1619,14 +1640,17 @@ protected:
// background colour for empty space below the grid
wxColour m_colEmptySpace;
// Default property colours
wxPGCell m_propertyDefaultCell;
// Default property category
wxPGCell m_categoryDefaultCell;
// Backup of selected property's cells
wxVector<wxPGCell> m_propCellsBackup;
// NB: These *cannot* be moved to globals.
// Array of background colour brushes.
wxArrayPtrVoid m_arrBgBrushes;
// Array of foreground colours.
wxArrayPtrVoid m_arrFgCols;
// labels when properties use common values
wxVector<wxPGCommonValue*> m_commonValues;
@@ -1790,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 );