- return wxColour(*((wxPGColour*)m_arrFgCols.Item(p->m_fgColIndex)));
-}
-
-void wxPropertyGrid::SetPropertyColoursToDefault( wxPGPropArg id )
-{
- wxPG_PROP_ARG_CALL_PROLOG()
-
- SetBackgroundColourIndex( p, 0 );
- SetTextColourIndex( p, 0, wxPG_RECURSE );
-
- if ( p->IsCategory() )
- {
- wxPropertyCategory* cat = (wxPropertyCategory*) p;
- cat->SetTextColIndex(1);
- }
-}
-
-// -----------------------------------------------------------------------
-// wxPropertyGrid property adding and removal
-// -----------------------------------------------------------------------
-
-void wxPropertyGrid::PrepareAfterItemsAdded()
-{
- if ( !m_pState || !m_pState->m_itemsAdded ) return;
-
- m_pState->m_itemsAdded = 0;
-
- if ( m_windowStyle & wxPG_AUTO_SORT )
- Sort();
-
- RecalculateVirtualSize();
-}
-
-// -----------------------------------------------------------------------
-// wxPropertyGrid property value setting and getting
-// -----------------------------------------------------------------------
-
-void wxPropertyGrid::DoSetPropertyValueUnspecified( wxPGProperty* p )
-{
- m_pState->DoSetPropertyValueUnspecified(p);
- DrawItemAndChildren(p);
-
- wxPGProperty* parent = p->GetParent();
- while ( (parent->GetFlags() & wxPG_PROP_PARENTAL_FLAGS) == wxPG_PROP_MISC_PARENT )
- {
- DrawItem(parent);
- parent = parent->GetParent();
- }
-}
-
-// -----------------------------------------------------------------------
-// wxPropertyGrid property operations
-// -----------------------------------------------------------------------
-
-bool wxPropertyGrid::EnsureVisible( wxPGPropArg id )
-{
- wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
-
- Update();
-
- bool changed = false;
-
- // Is it inside collapsed section?
- if ( !p->IsVisible() )
- {
- // expand parents
- wxPGProperty* parent = p->GetParent();
- wxPGProperty* grandparent = parent->GetParent();
-
- if ( grandparent && grandparent != m_pState->m_properties )
- Expand( grandparent );
-
- Expand( parent );
- changed = true;
- }
-
- // Need to scroll?
- int vx, vy;
- GetViewStart(&vx,&vy);
- vy*=wxPG_PIXELS_PER_UNIT;
-
- int y = p->GetY();
-
- if ( y < vy )
- {
- Scroll(vx, y/wxPG_PIXELS_PER_UNIT );
- m_iFlags |= wxPG_FL_SCROLLED;
- changed = true;
- }
- else if ( (y+m_lineHeight) > (vy+m_height) )
- {
- Scroll(vx, (y-m_height+(m_lineHeight*2))/wxPG_PIXELS_PER_UNIT );
- m_iFlags |= wxPG_FL_SCROLLED;
- changed = true;
- }
-
- if ( changed )
- DrawItems( p, p );
-
- return changed;
-}
-
-// -----------------------------------------------------------------------
-// wxPropertyGrid helper methods called by properties
-// -----------------------------------------------------------------------
-
-// Control font changer helper.
-void wxPropertyGrid::SetCurControlBoldFont()
-{
- wxASSERT( m_wndEditor );
- m_wndEditor->SetFont( m_captionFont );
-}
-
-// -----------------------------------------------------------------------
-
-wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p,
- const wxSize& sz )
-{
-#if wxPG_SMALL_SCREEN
- // On small-screen devices, always show dialogs with default position and size.
- return wxDefaultPosition;
-#else
- int splitterX = GetSplitterPosition();
- int x = splitterX;
- int y = p->GetY();
-
- wxCHECK_MSG( y >= 0, wxPoint(-1,-1), wxT("invalid y?") );