Fixed wxPG sourceforge tracker bug #2138858, applied other appropriate uses of GetEditorControl() as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2847,8 +2847,9 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
|||||||
{
|
{
|
||||||
if ( changedProperty == m_selected )
|
if ( changedProperty == m_selected )
|
||||||
{
|
{
|
||||||
wxASSERT( m_wndEditor->IsKindOf(CLASSINFO(wxTextCtrl)) );
|
wxWindow* editor = GetEditorControl();
|
||||||
evtChangingValue = ((wxTextCtrl*)m_wndEditor)->GetValue();
|
wxASSERT( editor->IsKindOf(CLASSINFO(wxTextCtrl)) );
|
||||||
|
evtChangingValue = wxStaticCast(editor, wxTextCtrl)->GetValue();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3637,10 +3638,11 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
|
|
||||||
m_wndEditor = wndList.m_primary;
|
m_wndEditor = wndList.m_primary;
|
||||||
m_wndEditor2 = wndList.m_secondary;
|
m_wndEditor2 = wndList.m_secondary;
|
||||||
|
wxWindow* primaryCtrl = GetEditorControl();
|
||||||
|
|
||||||
// NOTE: It is allowed for m_wndEditor to be NULL - in this case
|
// NOTE: It is allowed for m_wndEditor to be NULL - in this case
|
||||||
// value is drawn as normal, and m_wndEditor2 is assumed
|
// value is drawn as normal, and m_wndEditor2 is assumed
|
||||||
// to be a right-aligned button that triggers a separate editor
|
// to be a right-aligned button that triggers a separate editorCtrl
|
||||||
// window.
|
// window.
|
||||||
|
|
||||||
if ( m_wndEditor )
|
if ( m_wndEditor )
|
||||||
@@ -3652,7 +3654,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
#if wxUSE_VALIDATORS
|
#if wxUSE_VALIDATORS
|
||||||
wxValidator* validator = p->GetValidator();
|
wxValidator* validator = p->GetValidator();
|
||||||
if ( validator )
|
if ( validator )
|
||||||
m_wndEditor->SetValidator(*validator);
|
primaryCtrl->SetValidator(*validator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( m_wndEditor->GetSize().y > (m_lineHeight+6) )
|
if ( m_wndEditor->GetSize().y > (m_lineHeight+6) )
|
||||||
@@ -3667,10 +3669,10 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
// Fix TextCtrl indentation
|
// Fix TextCtrl indentation
|
||||||
#if defined(__WXMSW__) && !defined(__WXWINCE__)
|
#if defined(__WXMSW__) && !defined(__WXWINCE__)
|
||||||
wxTextCtrl* tc = NULL;
|
wxTextCtrl* tc = NULL;
|
||||||
if ( m_wndEditor->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
|
if ( primaryCtrl->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
|
||||||
tc = ((wxOwnerDrawnComboBox*)m_wndEditor)->GetTextCtrl();
|
tc = ((wxOwnerDrawnComboBox*)primaryCtrl)->GetTextCtrl();
|
||||||
else
|
else
|
||||||
tc = wxDynamicCast(m_wndEditor, wxTextCtrl);
|
tc = wxDynamicCast(primaryCtrl, wxTextCtrl);
|
||||||
if ( tc )
|
if ( tc )
|
||||||
::SendMessage(GetHwndOf(tc), EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
|
::SendMessage(GetHwndOf(tc), EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
|
||||||
#endif
|
#endif
|
||||||
@@ -3686,6 +3688,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_wndEditor->SetSizeHints(3, 3);
|
m_wndEditor->SetSizeHints(3, 3);
|
||||||
|
if ( m_wndEditor != primaryCtrl )
|
||||||
|
primaryCtrl->SetSizeHints(3, 3);
|
||||||
|
|
||||||
#if wxPG_CREATE_CONTROLS_HIDDEN
|
#if wxPG_CREATE_CONTROLS_HIDDEN
|
||||||
m_wndEditor->Show(false);
|
m_wndEditor->Show(false);
|
||||||
@@ -3696,7 +3700,6 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
m_wndEditor->Move( goodPos );
|
m_wndEditor->Move( goodPos );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxWindow* primaryCtrl = GetEditorControl();
|
|
||||||
SetupChildEventHandling(primaryCtrl);
|
SetupChildEventHandling(primaryCtrl);
|
||||||
|
|
||||||
// Focus and select all (wxTextCtrl, wxComboBox etc)
|
// Focus and select all (wxTextCtrl, wxComboBox etc)
|
||||||
@@ -4658,13 +4661,13 @@ bool wxPropertyGrid::OnMouseCommon( wxMouseEvent& event, int* px, int* py )
|
|||||||
int ux = event.m_x;
|
int ux = event.m_x;
|
||||||
int uy = event.m_y;
|
int uy = event.m_y;
|
||||||
|
|
||||||
wxWindow* wnd = m_wndEditor;
|
wxWindow* wnd = GetEditorControl();
|
||||||
|
|
||||||
// Hide popup on clicks
|
// Hide popup on clicks
|
||||||
if ( event.GetEventType() != wxEVT_MOTION )
|
if ( event.GetEventType() != wxEVT_MOTION )
|
||||||
if ( wnd && wnd->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
|
if ( wnd && wnd->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
|
||||||
{
|
{
|
||||||
((wxOwnerDrawnComboBox*)m_wndEditor)->HidePopup();
|
((wxOwnerDrawnComboBox*)wnd)->HidePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect r;
|
wxRect r;
|
||||||
@@ -5095,7 +5098,7 @@ bool wxPropertyGrid::HandleChildKey( wxKeyEvent& event )
|
|||||||
|
|
||||||
// Update the control as well
|
// Update the control as well
|
||||||
m_selected->GetEditorClass()->SetControlStringValue( m_selected,
|
m_selected->GetEditorClass()->SetControlStringValue( m_selected,
|
||||||
m_wndEditor,
|
GetEditorControl(),
|
||||||
m_selected->GetDisplayedString() );
|
m_selected->GetDisplayedString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user