Add wxListCtrlBase common base class for port-specific wxListCtrl.

This base class is currently trivial, more methods will be moved to it from
the derived classes later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-01-07 15:09:34 +00:00
parent 3b2f80c205
commit 26df5dd39a
7 changed files with 39 additions and 23 deletions

View File

@@ -31,7 +31,7 @@ class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
// wxListCtrl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxControl,
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxListCtrlBase,
public wxScrollHelper
{
public:

View File

@@ -371,6 +371,20 @@ private:
DECLARE_DYNAMIC_CLASS(wxListItem)
};
// ----------------------------------------------------------------------------
// wxListCtrlBase: the base class for the main control itself.
// ----------------------------------------------------------------------------
// Unlike other base classes, this class doesn't currently define the API of
// the real control class but is just used for implementation convenience. We
// should define the public class functions as pure virtual here in the future
// however.
class WXDLLIMPEXP_CORE wxListCtrlBase : public wxControl
{
public:
wxListCtrlBase() { }
};
// ----------------------------------------------------------------------------
// wxListEvent - the event class for the wxListCtrl notifications
// ----------------------------------------------------------------------------

View File

@@ -77,7 +77,7 @@ class wxMSWListItemData;
*/
class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase
{
public:
/*

View File

@@ -23,7 +23,7 @@ class wxListCtrlRenameTimer;
WX_DECLARE_EXPORTED_LIST(wxListItem, wxColumnList);
class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase
{
DECLARE_DYNAMIC_CLASS(wxListCtrl)
public:

View File

@@ -4300,7 +4300,7 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to)
IMPLEMENT_DYNAMIC_CLASS(wxGenericListCtrl, wxControl)
BEGIN_EVENT_TABLE(wxGenericListCtrl,wxControl)
BEGIN_EVENT_TABLE(wxGenericListCtrl,wxListCtrlBase)
EVT_SIZE(wxGenericListCtrl::OnSize)
EVT_SCROLLWIN(wxGenericListCtrl::OnScroll)
END_EVENT_TABLE()
@@ -4380,7 +4380,9 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
wxASSERT_MSG( (style & wxLC_MASK_TYPE),
wxT("wxListCtrl style should have exactly one mode bit set") );
if ( !wxControl::Create( parent, id, pos, size, style|wxVSCROLL|wxHSCROLL, validator, name ) )
if ( !wxListCtrlBase::Create( parent, id, pos, size,
style | wxVSCROLL | wxHSCROLL,
validator, name ) )
return false;
#ifdef __WXGTK__
@@ -4418,7 +4420,7 @@ WXLRESULT wxGenericListCtrl::MSWWindowProc(WXUINT nMsg,
WXWPARAM wParam,
WXLPARAM lParam)
{
WXLRESULT rc = wxControl::MSWWindowProc(nMsg, wParam, lParam);
WXLRESULT rc = wxListCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
// we need to process arrows ourselves for scrolling
if ( nMsg == WM_GETDLGCODE )
@@ -5145,7 +5147,7 @@ void wxGenericListCtrl::DoClientToScreen( int *x, int *y ) const
if ( m_mainWin )
m_mainWin->DoClientToScreen(x, y);
else
wxControl::DoClientToScreen(x, y);
wxListCtrlBase::DoClientToScreen(x, y);
}
void wxGenericListCtrl::DoScreenToClient( int *x, int *y ) const
@@ -5155,7 +5157,7 @@ void wxGenericListCtrl::DoScreenToClient( int *x, int *y ) const
if ( m_mainWin )
m_mainWin->DoScreenToClient(x, y);
else
wxControl::DoScreenToClient(x, y);
wxListCtrlBase::DoScreenToClient(x, y);
}
void wxGenericListCtrl::SetFocus()

View File

@@ -226,7 +226,7 @@ public:
wxDECLARE_NO_COPY_CLASS(wxMSWListItemData);
};
BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
BEGIN_EVENT_TABLE(wxListCtrl, wxListCtrlBase)
EVT_PAINT(wxListCtrl::OnPaint)
EVT_CHAR_HOOK(wxListCtrl::OnCharHook)
END_EVENT_TABLE()
@@ -309,7 +309,7 @@ void wxListCtrl::MSWSetExListStyles()
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
{
WXDWORD wstyle = wxControl::MSWGetStyle(style, exstyle);
WXDWORD wstyle = wxListCtrlBase::MSWGetStyle(style, exstyle);
wstyle |= LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
@@ -478,7 +478,7 @@ void wxListCtrl::SetWindowStyleFlag(long flag)
{
if ( flag != m_windowStyle )
{
wxControl::SetWindowStyleFlag(flag);
wxListCtrlBase::SetWindowStyleFlag(flag);
UpdateStyle();
@@ -1862,7 +1862,7 @@ bool wxListCtrl::MSWShouldPreProcessMessage(WXMSG* msg)
return false;
}
}
return wxControl::MSWShouldPreProcessMessage(msg);
return wxListCtrlBase::MSWShouldPreProcessMessage(msg);
}
bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id_)
@@ -2047,7 +2047,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
}
if ( ignore )
return wxControl::MSWOnNotify(idCtrl, lParam, result);
return wxListCtrlBase::MSWOnNotify(idCtrl, lParam, result);
}
else
#endif // defined(HDN_BEGINTRACKA)
@@ -2275,7 +2275,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
case NM_DBLCLK:
// if the user processes it in wxEVT_COMMAND_LEFT_CLICK(), don't do
// anything else
if ( wxControl::MSWOnNotify(idCtrl, lParam, result) )
if ( wxListCtrlBase::MSWOnNotify(idCtrl, lParam, result) )
{
return true;
}
@@ -2300,7 +2300,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
case NM_RCLICK:
// if the user processes it in wxEVT_COMMAND_RIGHT_CLICK(),
// don't do anything else
if ( wxControl::MSWOnNotify(idCtrl, lParam, result) )
if ( wxListCtrlBase::MSWOnNotify(idCtrl, lParam, result) )
{
return true;
}
@@ -2513,7 +2513,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
}
if ( !processed )
return wxControl::MSWOnNotify(idCtrl, lParam, result);
return wxListCtrlBase::MSWOnNotify(idCtrl, lParam, result);
}
else
{
@@ -2903,7 +2903,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
wxPaintDC dc(this);
wxControl::OnPaint(event);
wxListCtrlBase::OnPaint(event);
// Reset the device origin since it may have been set
dc.SetDeviceOrigin(0, 0);
@@ -3022,7 +3022,7 @@ wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
//else: break
}
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
return wxListCtrlBase::MSWWindowProc(nMsg, wParam, lParam);
}
// ----------------------------------------------------------------------------

View File

@@ -775,7 +775,7 @@ void wxListCtrl::SetWindowStyleFlag(long flag)
void wxListCtrl::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxControl::DoSetSize(x, y, width, height, sizeFlags);
wxListCtrlBase::DoSetSize(x, y, width, height, sizeFlags);
if (m_genericImpl)
m_genericImpl->SetSize(0, 0, width, height, sizeFlags);
@@ -809,7 +809,7 @@ wxSize wxListCtrl::DoGetBestSize() const
bool wxListCtrl::SetFont(const wxFont& font)
{
bool rv = true;
rv = wxControl::SetFont(font);
rv = wxListCtrlBase::SetFont(font);
if (m_genericImpl)
rv = m_genericImpl->SetFont(font);
return rv;
@@ -849,21 +849,21 @@ void wxListCtrl::Freeze ()
{
if (m_genericImpl)
m_genericImpl->Freeze();
wxControl::Freeze();
wxListCtrlBase::Freeze();
}
void wxListCtrl::Thaw ()
{
if (m_genericImpl)
m_genericImpl->Thaw();
wxControl::Thaw();
wxListCtrlBase::Thaw();
}
void wxListCtrl::Update ()
{
if (m_genericImpl)
m_genericImpl->Update();
wxControl::Update();
wxListCtrlBase::Update();
}
// ----------------------------------------------------------------------------