]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgrid.cpp
work around probable bug in GTK+ 2.18 when calling WriteText on a new, empty control...
[wxWidgets.git] / src / propgrid / propgrid.cpp
index aa7864d43a076c5bf7f509faf3ea6d7ae20ff46c..4ae155754c8290e1f2461579f82dc7f046234fe4 100644 (file)
 
 //#define wxPG_TOOLTIP_DELAY              1000
 
+// This is the number of pixels the expander button inside
+// property cells (i.e. not in the grey margin area are
+// adjusted.
+#define IN_CELL_EXPANDER_BUTTON_X_ADJUST    2
+
 // -----------------------------------------------------------------------
 
 #if wxUSE_INTL
@@ -662,7 +667,7 @@ void wxPropertyGrid::Thaw()
         // Force property re-selection
         // NB: We must copy the selection.
         wxArrayPGProperty selection = m_pState->m_selection;
-        DoSetSelection(selection, wxPG_SEL_FORCE);
+        DoSetSelection(selection, wxPG_SEL_FORCE | wxPG_SEL_NONVISIBLE);
     }
 }
 
@@ -2272,6 +2277,10 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
         }
         else
         {
+            // Fine tune button rectangle to actually fit the cell
+            if ( butRect.x > 0 )
+                butRect.x += IN_CELL_EXPANDER_BUTTON_X_ADJUST;
+
             if ( p->m_flags & wxPG_PROP_MODIFIED && (windowStyle & wxPG_BOLD_MODIFIED) )
             {
                 dc.SetFont(m_captionFont);
@@ -4506,6 +4515,10 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even
             {
                 int nx = x + m_marginWidth - marginEnds; // Normalize x.
 
+                // Fine tune cell button x
+                if ( !p->IsCategory() )
+                    nx -= IN_CELL_EXPANDER_BUTTON_X_ADJUST;
+
                 if ( (nx >= m_gutterWidth && nx < (m_gutterWidth+m_iconWidth)) )
                 {
                     int y2 = y % m_lineHeight;