#define wxPG_FL_SPLITTER_PRE_SET 0x00400000
// Validation failed. Clear on modify event.
#define wxPG_FL_VALIDATION_FAILED 0x00800000
-// Set if selected is fully painted (ie. both image and text)
-//#define wxPG_FL_SELECTED_IS_FULL_PAINT 0x01000000
+// Auto sort is enabled (for categorized mode)
+#define wxPG_FL_CATMODE_AUTO_SORT 0x01000000
// Set after page has been inserted to manager
#define wxPG_MAN_FL_PAGE_INSERTED 0x02000000
// Active editor control is abnormally large
/** 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;
void OnMouseDoubleClick( wxMouseEvent &event );
void OnMouseUp( wxMouseEvent &event );
void OnKey( wxKeyEvent &event );
- void OnKeyUp( wxKeyEvent &event );
void OnResize( wxSizeEvent &event );
// event handlers
bool HandleMouseRightClick( int x, unsigned int y, wxMouseEvent &event );
bool HandleMouseDoubleClick( int x, unsigned int y, wxMouseEvent &event );
bool HandleMouseUp( int x, unsigned int y, wxMouseEvent &event );
- void HandleKeyEvent( wxKeyEvent &event );
- // Handle TAB and ESCAPE in control
- bool HandleChildKey( wxKeyEvent& event );
+ void HandleKeyEvent( wxKeyEvent &event, bool fromChild );
void OnMouseEntry( wxMouseEvent &event );
void OnMouseMoveChild( wxMouseEvent &event );
void OnMouseUpChild( wxMouseEvent &event );
void OnChildKeyDown( wxKeyEvent &event );
- void OnChildKeyUp( wxKeyEvent &event );
void OnCaptureChange( wxMouseCaptureChangedEvent &event );
void ImprovedClientToScreen( int* px, int* py );
+ // Returns True if editor control has focus
+ bool IsEditorFocused() const;
+
// Called by focus event handlers. newFocused is the window that becomes
// focused.
void HandleFocusChange( wxWindow* newFocused );
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 );