Return wxWindow* from wxDataViewCustomRenderer::CreateEditorCtrl().
There's no reason to limit custom editor controls to wxControl, which would rule out e.g. composite controls or any custom widgets. Make appropriate changes to related functions and code too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
16
src/common/datavcmn.cpp
Normal file → Executable file
16
src/common/datavcmn.cpp
Normal file → Executable file
@@ -40,7 +40,7 @@ namespace
|
||||
class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
wxDataViewEditorCtrlEvtHandler(wxControl *editor, wxDataViewRenderer *owner)
|
||||
wxDataViewEditorCtrlEvtHandler(wxWindow *editor, wxDataViewRenderer *owner)
|
||||
{
|
||||
m_editorCtrl = editor;
|
||||
m_owner = owner;
|
||||
@@ -59,7 +59,7 @@ protected:
|
||||
|
||||
private:
|
||||
wxDataViewRenderer *m_owner;
|
||||
wxControl *m_editorCtrl;
|
||||
wxWindow *m_editorCtrl;
|
||||
bool m_finished;
|
||||
bool m_focusOnIdle;
|
||||
|
||||
@@ -1417,7 +1417,7 @@ wxDataViewSpinRenderer::wxDataViewSpinRenderer( int min, int max, wxDataViewCell
|
||||
m_max = max;
|
||||
}
|
||||
|
||||
wxControl* wxDataViewSpinRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
wxWindow* wxDataViewSpinRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
{
|
||||
long l = value;
|
||||
wxSize size = labelRect.GetSize();
|
||||
@@ -1437,7 +1437,7 @@ wxControl* wxDataViewSpinRenderer::CreateEditorCtrl( wxWindow *parent, wxRect la
|
||||
return sc;
|
||||
}
|
||||
|
||||
bool wxDataViewSpinRenderer::GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
|
||||
bool wxDataViewSpinRenderer::GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value )
|
||||
{
|
||||
wxSpinCtrl *sc = (wxSpinCtrl*) editor;
|
||||
long l = sc->GetValue();
|
||||
@@ -1482,7 +1482,7 @@ wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString& choices
|
||||
m_choices = choices;
|
||||
}
|
||||
|
||||
wxControl* wxDataViewChoiceRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
wxWindow* wxDataViewChoiceRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
{
|
||||
wxChoice* c = new wxChoice
|
||||
(
|
||||
@@ -1497,7 +1497,7 @@ wxControl* wxDataViewChoiceRenderer::CreateEditorCtrl( wxWindow *parent, wxRect
|
||||
return c;
|
||||
}
|
||||
|
||||
bool wxDataViewChoiceRenderer::GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
|
||||
bool wxDataViewChoiceRenderer::GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value )
|
||||
{
|
||||
wxChoice *c = (wxChoice*) editor;
|
||||
wxString s = c->GetStringSelection();
|
||||
@@ -1538,14 +1538,14 @@ wxDataViewChoiceByIndexRenderer::wxDataViewChoiceByIndexRenderer( const wxArrayS
|
||||
{
|
||||
}
|
||||
|
||||
wxControl* wxDataViewChoiceByIndexRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
wxWindow* wxDataViewChoiceByIndexRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
|
||||
{
|
||||
wxVariant string_value = GetChoice( value.GetLong() );
|
||||
|
||||
return wxDataViewChoiceRenderer::CreateEditorCtrl( parent, labelRect, string_value );
|
||||
}
|
||||
|
||||
bool wxDataViewChoiceByIndexRenderer::GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
|
||||
bool wxDataViewChoiceByIndexRenderer::GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value )
|
||||
{
|
||||
wxVariant string_value;
|
||||
if (!wxDataViewChoiceRenderer::GetValueFromEditorCtrl( editor, string_value ))
|
||||
|
||||
Reference in New Issue
Block a user