#include "wx/textctrl.h"
#endif
-#include "wx/imaglist.h"
-#include "wx/listctrl.h"
+// Include wx/listctrl.h (with wxListView declaration)
+// only when wxGenericListCtrl is the only
+// implementation, and therefore wxListView needs
+// to be derived from the 'generic' version.
+
+#if defined(__WIN32__) && !defined(__WXUNIVERSAL__)
+ #include "wx/generic/listctrl.h"
+#else
+ #include "wx/listctrl.h"
+#endif
#if defined(__WXGTK__)
#include <gtk/gtk.h>
void SetItemCount(size_t count) { m_count = count; }
// special case of SetItemCount(0)
- void Clear() { m_itemsSel.Clear(); m_count = 0; }
+ void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = FALSE; }
// must be called when a new item is inserted/added
void OnItemAdd(size_t item) { wxFAIL_MSG( _T("TODO") ); }
void GetImageSize( int index, int &width, int &height ) const;
int GetTextLength( const wxString &s ) const;
- void SetImageList( wxGenericImageList *imageList, int which );
+ void SetImageList( wxImageListType *imageList, int which );
void SetItemSpacing( int spacing, bool isSmall = FALSE );
int GetItemSpacing( bool isSmall = FALSE );
wxColour *m_highlightColour;
int m_xScroll,
m_yScroll;
- wxGenericImageList *m_small_image_list;
- wxGenericImageList *m_normal_image_list;
+ wxImageListType *m_small_image_list;
+ wxImageListType *m_normal_image_list;
int m_small_spacing;
int m_normal_spacing;
bool m_hasFocus;
int image = item.m_image;
if ( image != -1 )
{
- wxGenericImageList *imageList = m_owner->m_small_image_list;
+ wxImageListType *imageList = m_owner->m_small_image_list;
if ( imageList )
{
int ix, iy;
m_headerWidth =
m_lineHeight = 0;
- m_small_image_list = (wxGenericImageList *) NULL;
- m_normal_image_list = (wxGenericImageList *) NULL;
+ m_small_image_list = (wxImageListType *) NULL;
+ m_normal_image_list = (wxImageListType *) NULL;
m_small_spacing = 30;
m_normal_spacing = 40;
{
if ( HasFlag(wxLC_REPORT) )
{
- size_t visibleFrom;
- GetVisibleLinesRange(&visibleFrom, NULL);
+ size_t visibleFrom, visibleTo;
+ GetVisibleLinesRange(&visibleFrom, &visibleTo);
if ( lineFrom < visibleFrom )
lineFrom = visibleFrom;
+ else if ( lineFrom > visibleTo )
+ return;
wxRect rect;
rect.x = 0;
rect.y = GetLineY(lineFrom);
+ CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
wxSize size = GetClientSize();
rect.width = size.x;
// refresh till the bottom of the window
rect.height = size.y - rect.y;
- CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
RefreshRect( rect );
}
else // !report
return lw + AUTOSIZE_COL_MARGIN;
}
-void wxListMainWindow::SetImageList( wxGenericImageList *imageList, int which )
+void wxListMainWindow::SetImageList( wxImageListType *imageList, int which )
{
m_dirty = TRUE;
IMPLEMENT_DYNAMIC_CLASS(wxGenericListCtrl, wxControl)
#if !defined(__WIN32__)
-IMPLEMENT_DYNAMIC_CLASS(wxListView, wxGenericListCtrl)
+IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
#endif
wxGenericListCtrl::wxGenericListCtrl()
{
- m_imageListNormal = (wxGenericImageList *) NULL;
- m_imageListSmall = (wxGenericImageList *) NULL;
- m_imageListState = (wxGenericImageList *) NULL;
+ m_imageListNormal = (wxImageListType *) NULL;
+ m_imageListSmall = (wxImageListType *) NULL;
+ m_imageListState = (wxImageListType *) NULL;
m_ownsImageListNormal =
m_ownsImageListSmall =
{
m_imageListNormal =
m_imageListSmall =
- m_imageListState = (wxGenericImageList *) NULL;
+ m_imageListState = (wxImageListType *) NULL;
m_ownsImageListNormal =
m_ownsImageListSmall =
m_ownsImageListState = FALSE;
return m_mainWin->GetNextItem( item, geom, state );
}
-wxGenericImageList *wxGenericListCtrl::GetImageList(int which) const
+wxImageListType *wxGenericListCtrl::GetImageList(int which) const
{
if (which == wxIMAGE_LIST_NORMAL)
{
{
return m_imageListState;
}
- return (wxGenericImageList *) NULL;
+ return (wxImageListType *) NULL;
}
-void wxGenericListCtrl::SetImageList( wxGenericImageList *imageList, int which )
+void wxGenericListCtrl::SetImageList( wxImageListType *imageList, int which )
{
if ( which == wxIMAGE_LIST_NORMAL )
{
m_mainWin->SetImageList( imageList, which );
}
-void wxGenericListCtrl::AssignImageList(wxGenericImageList *imageList, int which)
+void wxGenericListCtrl::AssignImageList(wxImageListType *imageList, int which)
{
SetImageList(imageList, which);
if ( which == wxIMAGE_LIST_NORMAL )