//#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
// 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);
}
}
// FIXME: This is just a workaround for a bug that causes splitters not
// to paint when other windows are being dragged over the grid.
- wxRect fullRect = GetRect();
- r.x = fullRect.x;
- r.width = fullRect.width;
+ r.x = 0;
+ r.width = GetClientSize().x;
// Repaint this rectangle
DrawItems( dc, r.y, r.y + r.height, &r );
}
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);
void wxPropertyGrid::HandleCustomEditorEvent( wxEvent &event )
{
+ // It is possible that this handler receives event even before
+ // the control has been properly initialized. Let's skip the
+ // event handling in that case.
+ if ( !m_pState )
+ return;
+
wxPGProperty* selected = GetSelection();
// Somehow, event is handled after property has been deselected.
void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
{
- if ( (m_iFlags & wxPG_FL_RECALCULATING_VIRTUAL_SIZE) || m_frozen )
+ if ( (m_iFlags & wxPG_FL_RECALCULATING_VIRTUAL_SIZE) ||
+ m_frozen ||
+ !m_pState )
return;
//
{
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;