Better use of Connect()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,15 +142,13 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP
|
|||||||
wnd2->SetRange( INT_MIN, INT_MAX );
|
wnd2->SetRange( INT_MIN, INT_MAX );
|
||||||
wnd2->SetValue( 0 );
|
wnd2->SetValue( 0 );
|
||||||
|
|
||||||
propgrid->Connect( wxPG_SUBID2, wxEVT_SCROLL_LINEUP,
|
wxWindowID id = wnd2->GetId();
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
wnd2->Connect( id, wxEVT_SCROLL_LINEUP,
|
||||||
&wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid );
|
wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
|
||||||
propgrid->Connect( wxPG_SUBID2, wxEVT_SCROLL_LINEDOWN,
|
NULL, propgrid );
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
wnd2->Connect( id, wxEVT_SCROLL_LINEDOWN,
|
||||||
&wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid );
|
wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
|
||||||
propgrid->Connect( wxPG_SUBID1, wxEVT_KEY_DOWN,
|
NULL, propgrid );
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
|
||||||
&wxPropertyGrid::OnCustomEditorEvent, NULL, propgrid );
|
|
||||||
|
|
||||||
// Let's add validator to make sure only numbers can be entered
|
// Let's add validator to make sure only numbers can be entered
|
||||||
wxTextValidator validator(wxFILTER_NUMERIC, &m_tempString);
|
wxTextValidator validator(wxFILTER_NUMERIC, &m_tempString);
|
||||||
@@ -158,6 +156,10 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP
|
|||||||
wxTextCtrl* wnd1 = (wxTextCtrl*) wxPGTextCtrlEditor::CreateControls( propgrid, property, pos, tcSz ).m_primary;
|
wxTextCtrl* wnd1 = (wxTextCtrl*) wxPGTextCtrlEditor::CreateControls( propgrid, property, pos, tcSz ).m_primary;
|
||||||
wnd1->SetValidator(validator);
|
wnd1->SetValidator(validator);
|
||||||
|
|
||||||
|
wnd1->Connect( wnd1->GetId(), wxEVT_KEY_DOWN,
|
||||||
|
wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
|
||||||
|
NULL, propgrid );
|
||||||
|
|
||||||
return wxPGWindowList(wnd1, wnd2);
|
return wxPGWindowList(wnd1, wnd2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,9 +337,9 @@ wxPGWindowList wxPGDatePickerCtrlEditor::CreateControls( wxPropertyGrid* propgri
|
|||||||
// Connect all required events to grid's OnCustomEditorEvent
|
// Connect all required events to grid's OnCustomEditorEvent
|
||||||
// (all relevenat wxTextCtrl, wxComboBox and wxButton events are
|
// (all relevenat wxTextCtrl, wxComboBox and wxButton events are
|
||||||
// already connected)
|
// already connected)
|
||||||
propgrid->Connect( wxPG_SUBID1, wxEVT_DATE_CHANGED,
|
ctrl->Connect( wxPG_SUBID1, wxEVT_DATE_CHANGED,
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
|
||||||
&wxPropertyGrid::OnCustomEditorEvent );
|
NULL, propgrid );
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
ctrl->Show();
|
ctrl->Show();
|
||||||
|
Reference in New Issue
Block a user