No changes, just make wxDataViewEditorCtrlEvtHandler private.

This class is used by wxDataViewCtrl implementation only, there is no need for
it to be in a public header.

Move the class declaration from wx/dataview.h to datavcmn.cpp.

See #11732.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-05 12:45:14 +00:00
parent 66c02e6e33
commit fd61f68445
2 changed files with 37 additions and 38 deletions

View File

@@ -418,34 +418,6 @@ private:
};
#endif
//-----------------------------------------------------------------------------
// wxDataViewEditorCtrlEvtHandler
//-----------------------------------------------------------------------------
class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
{
public:
wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner );
void AcceptChangesAndFinish();
void SetFocusOnIdle( bool focus = true ) { m_focusOnIdle = focus; }
protected:
void OnChar( wxKeyEvent &event );
void OnTextEnter( wxCommandEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnIdle( wxIdleEvent &event );
private:
wxDataViewRenderer *m_owner;
wxControl *m_editorCtrl;
bool m_finished;
bool m_focusOnIdle;
private:
DECLARE_EVENT_TABLE()
};
// ----------------------------------------------------------------------------
// wxDataViewRenderer and related classes
// ----------------------------------------------------------------------------

View File

@@ -32,6 +32,43 @@
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";
namespace
{
// Custom handler pushed on top of the edit control used by wxDataViewCtrl to
// forward some events to the main control itself.
class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
{
public:
wxDataViewEditorCtrlEvtHandler(wxControl *editor, wxDataViewRenderer *owner)
{
m_editorCtrl = editor;
m_owner = owner;
m_finished = false;
}
void AcceptChangesAndFinish();
void SetFocusOnIdle( bool focus = true ) { m_focusOnIdle = focus; }
protected:
void OnChar( wxKeyEvent &event );
void OnTextEnter( wxCommandEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnIdle( wxIdleEvent &event );
private:
wxDataViewRenderer *m_owner;
wxControl *m_editorCtrl;
bool m_finished;
bool m_focusOnIdle;
private:
DECLARE_EVENT_TABLE()
};
} // anonymous namespace
// ---------------------------------------------------------
// wxDataViewModelNotifier
// ---------------------------------------------------------
@@ -817,16 +854,6 @@ BEGIN_EVENT_TABLE(wxDataViewEditorCtrlEvtHandler, wxEvtHandler)
EVT_TEXT_ENTER (-1, wxDataViewEditorCtrlEvtHandler::OnTextEnter)
END_EVENT_TABLE()
wxDataViewEditorCtrlEvtHandler::wxDataViewEditorCtrlEvtHandler(
wxControl *editorCtrl,
wxDataViewRenderer *owner )
{
m_owner = owner;
m_editorCtrl = editorCtrl;
m_finished = false;
}
void wxDataViewEditorCtrlEvtHandler::OnIdle( wxIdleEvent &event )
{
if (m_focusOnIdle)