#include "wx/stattext.h"
#include "wx/scrolwin.h"
#include "wx/dirdlg.h"
- #include "wx/layout.h"
#include "wx/sizer.h"
#include "wx/textdlg.h"
#include "wx/filedlg.h"
#include <wx/msw/private.h>
#endif
-#include <typeinfo>
-
// Two pics for the expand / collapse buttons.
// Files are not supplied with this project (since it is
// recommended to use either custom or native rendering).
wxSize cis = p->OnMeasureImage(item);
- int choiceCount = p->GetChoiceCount();
+ int choiceCount = p->m_choices.GetCount();
int comVals = p->GetDisplayedCommonValueCount();
if ( item >= choiceCount && comVals > 0 )
{
// Call with NULL to de-select property
bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
{
+ wxPanel* canvas = GetPanel();
+
/*
if (p)
wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->m_label.c_str(),
}
else
{
- wxScrolledWindow::SetFocus();
- m_editorFocused = 0;
+ SetFocusOnCanvas();
}
}
if ( m_wndEditor )
{
- wxASSERT_MSG( m_wndEditor->GetParent() == m_canvas,
+ wxASSERT_MSG( m_wndEditor->GetParent() == canvas,
wxT("CreateControls must use result of wxPropertyGrid::GetPanel() as parent of controls.") );
// Set validator, if any
if ( m_wndEditor2 )
{
- wxASSERT_MSG( m_wndEditor2->GetParent() == m_canvas,
+ wxASSERT_MSG( m_wndEditor2->GetParent() == canvas,
wxT("CreateControls must use result of wxPropertyGrid::GetPanel() as parent of controls.") );
// Get proper id for wndSecondary
}
else
{
- // wxGTK atleast seems to need this (wxMSW not)
- SetFocus();
+ // Make sure focus is in grid canvas (important for wxGTK, at least)
+ SetFocusOnCanvas();
}
EditorsValueWasNotModified();
DrawItems(p, p);
}
+ else
+ {
+ // Make sure focus is in grid canvas
+ SetFocusOnCanvas();
+ }
ClearInternalFlag(wxPG_FL_IN_SELECT_PROPERTY);
}
if ( !CommitChangesFromEditor(0) )
return false;
- m_canvas->SetFocusIgnoringChildren();
+ SetFocusOnCanvas();
DrawItem(m_selected);
return true;
// Need to set focus?
if ( !(m_iFlags & wxPG_FL_FOCUSED) )
{
- m_canvas->SetFocus();
+ SetFocusOnCanvas();
}
wxPropertyGridPageState* state = m_pState;
return new wxPropertyGridEvent( *this );
}
-void wxPropertyGrid::SetPropertyAttributeAll( const wxString& attrName, wxVariant value )
-{
- DoSetPropertyAttribute(GetRoot(), attrName, value, wxPG_RECURSE);
-}
-
// -----------------------------------------------------------------------
// wxPropertyGridPopulator
// -----------------------------------------------------------------------