#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+ #pragma hdrstop
#endif
#if wxUSE_LISTCTRL
-#ifndef WX_PRECOMP
- #include "wx/app.h"
- #include "wx/dynarray.h"
- #include "wx/dcscreen.h"
- #include "wx/textctrl.h"
-#endif
-
// under Win32 we always use the native version and also may use the generic
// one, however some things should be done only if we use only the generic
// version
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxGenericListCtrl)
#endif // HAVE_NATIVE_LISTCTRL/!HAVE_NATIVE_LISTCTRL
+#ifndef WX_PRECOMP
+ #include "wx/dynarray.h"
+ #include "wx/app.h"
+ #include "wx/dcscreen.h"
+ #include "wx/textctrl.h"
+ #include "wx/listbox.h"
+ #include "wx/math.h"
+#endif
+
#include "wx/selstore.h"
#include "wx/renderer.h"
-#include "wx/math.h"
#ifdef __WXMAC__
#include "wx/mac/private.h"
{
protected:
wxListMainWindow *m_owner;
- wxCursor *m_currentCursor;
+ const wxCursor *m_currentCursor;
wxCursor *m_resizeCursor;
bool m_isDragging;
long FindItem( long start, const wxString& str, bool partial = false );
long FindItem( long start, wxUIntPtr data);
long FindItem( const wxPoint& pt );
- long HitTest( int x, int y, int &flags );
+ long HitTest( int x, int y, int &flags ) const;
void InsertItem( wxListItem &item );
void InsertColumn( long col, wxListItem &item );
int GetItemWidthWithImage(wxListItem * item);
return wxNOT_FOUND;
}
-long wxListMainWindow::HitTest( int x, int y, int &flags )
+long wxListMainWindow::HitTest( int x, int y, int &flags ) const
{
CalcUnscrolledPosition( x, y, &x, &y );
void wxListMainWindow::OnScroll(wxScrollWinEvent& event)
{
- int cw, ch, vw, vh;
- GetVirtualSize(&vw, &vh);
- GetClientSize(&cw, &ch);
-
- if ( event.GetOrientation() == wxVERTICAL && ch >= vh )
- return;
-
// update our idea of which lines are shown when we redraw the window the
// next time
ResetVisibleLinesRange();
return m_mainWin->FindItem( pt );
}
-long wxGenericListCtrl::HitTest( const wxPoint &point, int &flags )
+// TODO: sub item hit testing
+long wxGenericListCtrl::HitTest(const wxPoint& point, int& flags, long *) const
{
return m_mainWin->HitTest( (int)point.x, (int)point.y, flags );
}
return true;
}
-#if _USE_VISATTR
-#include "wx/listbox.h"
-#endif
-
// static
wxVisualAttributes
wxGenericListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)