]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgrid.cpp
Source changes needed to get MDI support compiling on OS X Cocoa, and a explicit...
[wxWidgets.git] / src / propgrid / propgrid.cpp
index 2229e3feae222cdb11ef3a991ea54a04161f62c0..fc40bcf90b45c9ac200577d573b116d19a4a5d75 100644 (file)
@@ -3397,7 +3397,7 @@ wxSize wxPropertyGrid::GetImageSize( wxPGProperty* p, int item ) const
 
     wxSize cis = p->OnMeasureImage(item);
 
-    int choiceCount = p->GetChoiceCount();
+    int choiceCount = p->m_choices.GetCount();
     int comVals = p->GetDisplayedCommonValueCount();
     if ( item >= choiceCount && comVals > 0 )
     {
@@ -3594,8 +3594,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
                 }
                 else
                 {
-                    canvas->SetFocusIgnoringChildren();
-                    m_editorFocused = 0;
+                    SetFocusOnCanvas();
                 }
             }
 
@@ -3813,8 +3812,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
             }
             else
             {
-                // wxGTK atleast seems to need this (wxMSW not)
-                canvas->SetFocusIgnoringChildren();
+                // Make sure focus is in grid canvas (important for wxGTK, at least)
+                SetFocusOnCanvas();
             }
 
             EditorsValueWasNotModified();
@@ -3836,8 +3835,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
         }
         else
         {
-            // Make sure focus is in grid
-            canvas->SetFocusIgnoringChildren();
+            // Make sure focus is in grid canvas
+            SetFocusOnCanvas();
         }
 
         ClearInternalFlag(wxPG_FL_IN_SELECT_PROPERTY);
@@ -3906,7 +3905,7 @@ bool wxPropertyGrid::UnfocusEditor()
     if ( !CommitChangesFromEditor(0) )
         return false;
 
-    m_canvas->SetFocusIgnoringChildren();
+    SetFocusOnCanvas();
     DrawItem(m_selected);
 
     return true;
@@ -4227,7 +4226,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even
     // Need to set focus?
     if ( !(m_iFlags & wxPG_FL_FOCUSED) )
     {
-        m_canvas->SetFocusIgnoringChildren();
+        SetFocusOnCanvas();
     }
 
     wxPropertyGridPageState* state = m_pState;