// Mostly useful for page switching.
void SwitchState( wxPropertyGridPageState* pNewState );
- /** Pass this function to Connect calls in propertyclass::CreateEditor.
+ /**
+ When creating custom property editors, connect required editor events to
+ this function. For instance:
+
+ @code
+ control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ NULL, propgrid);
+ @endcode
+
+ @remarks You should never need to call this function directly!
+
+ @see wxPGEditor::CreateControls(), wxEvtHandler::Connect()
*/
- void OnCustomEditorEvent( wxCommandEvent &event );
+ void OnCustomEditorEvent( wxEvent &event );
long GetInternalFlags() const { return m_iFlags; }
bool HasInternalFlag( long flag ) const
- Primary control shall use id wxPG_SUBID1, and secondary (button) control
shall use wxPG_SUBID2.
- Implementation shoud connect all necessary events to the
- wxPropertyGrid::OnCustomEditorEvent. For Example:
+ wxPropertyGrid::OnCustomEditorEvent(). For example:
@code
- // Relays wxEVT_COMMAND_TEXT_UPDATED events of primary editor
- // control to the OnEvent.
control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
NULL, propgrid);
@endcode
OnCustomEditorEvent will then forward events, first to
wxPGEditor::OnEvent() and then to wxPGProperty::OnEvent().
+
+ @see wxPropertyGrid::OnCustomEditorEvent(), wxEvtHandler::Connect()
*/
virtual wxPGWindowList CreateControls( wxPropertyGrid* propgrid,
wxPGProperty* property,
*/
bool IsFrozen() const;
+ /**
+ When creating custom property editors, connect required editor events to
+ this function. For instance:
+
+ @code
+ control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ NULL, propgrid);
+ @endcode
+
+ @remarks You should never need to call this function directly!
+
+ @see wxPGEditor::CreateControls(), wxEvtHandler::Connect()
+ */
+ void OnCustomEditorEvent( wxEvent &event );
+
/**
Redraws given property.
*/
wxWindowID id = wnd2->GetId();
wnd2->Connect( id, wxEVT_SCROLL_LINEUP,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
NULL, propgrid );
wnd2->Connect( id, wxEVT_SCROLL_LINEDOWN,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
NULL, propgrid );
// Let's add validator to make sure only numbers can be entered
wnd1->SetValidator(validator);
wnd1->Connect( wnd1->GetId(), wxEVT_KEY_DOWN,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
NULL, propgrid );
return wxPGWindowList(wnd1, wnd2);
// (all relevenat wxTextCtrl, wxComboBox and wxButton events are
// already connected)
ctrl->Connect( wxPG_SUBID1, wxEVT_DATE_CHANGED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
NULL, propgrid );
#ifdef __WXMSW__
// Connect event handling
wxWindowID id = cb->GetId();
propGrid->Connect(id, wxEVT_COMMAND_COMBOBOX_SELECTED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
propGrid->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
propGrid->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
#ifdef __WXMSW__
cb->Show();
// Connect event handling
id = ed->GetId();
this->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
this->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
return (wxWindow*) ed;
}
// Connect event handling
id = but->GetId();
this->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
return but;
}
{
wxWindowID id = GetButtonId(i);
propGrid->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
- wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+ wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
}
}
(parent == m_canvas ||
parent->GetParent() == m_canvas) )
{
- OnCustomEditorEvent((wxCommandEvent&)event);
+ OnCustomEditorEvent(event);
return true;
}
}
// -----------------------------------------------------------------------
-// NB: It may really not be wxCommandEvent - must check if necessary
-// (usually not).
-void wxPropertyGrid::OnCustomEditorEvent( wxCommandEvent &event )
+void wxPropertyGrid::OnCustomEditorEvent( wxEvent &event )
{
wxPGProperty* selected = m_selected;