]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgridiface.cpp
compilation fix after wxFont changes (closes #10152)
[wxWidgets.git] / src / propgrid / propgridiface.cpp
index 9d679284e8142aadedd3985cc294fa438b8a8404..3b4bfe078c1538282d4c3711431d55d07e2036fa 100644 (file)
@@ -315,11 +315,7 @@ void wxPropertyGridInterface::DeleteProperty( wxPGPropArg id )
     wxPropertyGrid* grid = state->GetGrid();
 
     if ( grid->GetState() == state )
-    {
-        bool selRes = grid->DoSelectProperty(NULL, wxPG_SEL_DELETING);
-        wxPG_CHECK_RET_DBG( selRes,
-                            wxT("failed to deselect a property (editor probably had invalid value)") );
-    }
+        grid->DoSelectProperty(NULL, wxPG_SEL_DELETING|wxPG_SEL_NOVALIDATE);
 
     state->DoDelete( p );
 
@@ -358,12 +354,16 @@ wxPGProperty* wxPropertyGridInterface::ReplaceProperty( wxPGPropArg id, wxPGProp
 // wxPropertyGridInterface property operations
 // -----------------------------------------------------------------------
 
-bool wxPropertyGridInterface::ClearSelection()
+bool wxPropertyGridInterface::ClearSelection( bool validation )
 {
+    int flags = 0;
+    if ( !validation )
+        flags |= wxPG_SEL_NOVALIDATE;
+
     wxPropertyGridPageState* state = m_pState;
     wxPropertyGrid* pg = state->GetGrid();
     if ( pg->GetState() == state )
-        return pg->DoClearSelection();
+        return pg->DoSelectProperty(NULL, flags);
     else
         state->SetSelection(NULL);
     return true;
@@ -428,8 +428,7 @@ bool wxPropertyGridInterface::ExpandAll( bool doExpand )
     if ( GetSelection() && GetSelection() != state->DoGetRoot() &&
          !doExpand )
     {
-        if ( !pg->ClearSelection() )
-            return false;
+        pg->ClearSelection(false);
     }
 
     wxPGVIterator it;
@@ -774,6 +773,38 @@ bool wxPropertyGridInterface::SetPropertyMaxLength( wxPGPropArg id, int maxLen )
 
 // -----------------------------------------------------------------------
 
+void
+wxPropertyGridInterface::SetPropertyBackgroundColour( wxPGPropArg id,
+                                                      const wxColour& colour,
+                                                      bool recursively )
+{
+    wxPG_PROP_ARG_CALL_PROLOG()
+    p->SetBackgroundColour( colour, recursively );
+    RefreshProperty( p );
+}
+
+// -----------------------------------------------------------------------
+
+void wxPropertyGridInterface::SetPropertyTextColour( wxPGPropArg id,
+                                                     const wxColour& colour,
+                                                     bool recursively )
+{
+    wxPG_PROP_ARG_CALL_PROLOG()
+    p->SetTextColour( colour, recursively );
+    RefreshProperty( p );
+}
+
+// -----------------------------------------------------------------------
+
+void wxPropertyGridInterface::SetPropertyColoursToDefault( wxPGPropArg id )
+{
+    wxPG_PROP_ARG_CALL_PROLOG()
+
+    p->m_cells.clear();
+}
+
+// -----------------------------------------------------------------------
+
 void wxPropertyGridInterface::SetPropertyCell( wxPGPropArg id,
                                                int column,
                                                const wxString& text,