]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxListCtrlBase common base class for port-specific wxListCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Jan 2012 15:09:34 +0000 (15:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Jan 2012 15:09:34 +0000 (15:09 +0000)
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

include/wx/generic/listctrl.h
include/wx/listbase.h
include/wx/msw/listctrl.h
include/wx/osx/listctrl.h
src/generic/listctrl.cpp
src/msw/listctrl.cpp
src/osx/carbon/listctrl_mac.cpp

index f2db368a54db5b8a0fce3db50da2530b26a6623f..63de1ff1ac60b1ae015cff51624faea89ffa03bd 100644 (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:
index 237c593f06c35a6a577aa8db1cb9416e61ebe513..8246ad83c815d3c028cb131aae731f8990765de9 100644 (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
 // ----------------------------------------------------------------------------
index 172197bf6206192f0b017cb02b046f685e3d1cb5..dd11f1e4a4bb518926686e803c18284f664d9099 100644 (file)
@@ -77,7 +77,7 @@ class wxMSWListItemData;
 
  */
 
-class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
+class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase
 {
 public:
     /*
index 9f9f7f3f60acff1cc0ed78bdd008180b91b9967a..681775f0cac79baa44f0a72168dd2fb6eff1114d 100644 (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:
index dffb7e1bf7715b627717171b06de69b385b55611..49d023895badc4aebf1afa2cf7ac333d2c21db7f 100644 (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()
index 6c29d0ea064b76b5221fd44bf5f4207217aff290..45e1d0c50360fa2fdc352201d10d472d6770d5f4 100644 (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);
 }
 
 // ----------------------------------------------------------------------------
index fcb9796ec0f2eb5e7736a66026ccd7b562b0f2cf..96d9a10738ca8634467f61e59195393f2ad15dbb 100644 (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();
 }
 
 // ----------------------------------------------------------------------------