+//-----------------------------------------------------------------------------
+// wxListMainWindow (internal)
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow
+{
+public:
+ long m_mode;
+ wxListLineDataArray m_lines;
+ wxList m_columns;
+ wxListLineData *m_current;
+ wxListLineData *m_currentEdit;
+ int m_visibleLines;
+ wxBrush *m_hilightBrush;
+ wxColour *m_hilightColour;
+ int m_xScroll,m_yScroll;
+ bool m_dirty;
+ wxImageList *m_small_image_list;
+ wxImageList *m_normal_image_list;
+ int m_small_spacing;
+ int m_normal_spacing;
+ bool m_hasFocus;
+ bool m_usedKeys;
+ bool m_lastOnSame;
+ wxTimer *m_renameTimer;
+ bool m_renameAccept;
+ wxString m_renameRes;
+ bool m_isCreated;
+ int m_dragCount;
+ wxPoint m_dragStart;
+
+ // for double click logic
+ wxListLineData *m_lineLastClicked,
+ *m_lineBeforeLastClicked;
+
+public:
+ wxListMainWindow();
+ wxListMainWindow( wxWindow *parent, wxWindowID id,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ long style = 0, const wxString &name = "listctrlmainwindow" );
+ ~wxListMainWindow();
+ void RefreshLine( wxListLineData *line );
+ void OnPaint( wxPaintEvent &event );
+ void HilightAll( bool on );
+ void SendNotify( wxListLineData *line,
+ wxEventType command,
+ wxPoint point = wxDefaultPosition );
+ void FocusLine( wxListLineData *line );
+ void UnfocusLine( wxListLineData *line );
+ void SelectLine( wxListLineData *line );
+ void DeselectLine( wxListLineData *line );
+ void DeleteLine( wxListLineData *line );
+
+ void EditLabel( long item );
+ void Edit( long item ) { EditLabel(item); } // deprecated
+ void OnRenameTimer();
+ void OnRenameAccept();
+
+ void OnMouse( wxMouseEvent &event );
+ void MoveToFocus();
+ void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
+ void OnChar( wxKeyEvent &event );
+ void OnKeyDown( wxKeyEvent &event );
+ void OnSetFocus( wxFocusEvent &event );
+ void OnKillFocus( wxFocusEvent &event );
+ void OnSize( wxSizeEvent &event );
+ void OnScroll(wxScrollWinEvent& event) ;
+
+ void DrawImage( int index, wxDC *dc, int x, int y );
+ void GetImageSize( int index, int &width, int &height );
+ int GetIndexOfLine( const wxListLineData *line );
+ int GetTextLength( wxString &s ); // should be const
+
+ void SetImageList( wxImageList *imageList, int which );
+ void SetItemSpacing( int spacing, bool isSmall = FALSE );
+ int GetItemSpacing( bool isSmall = FALSE );
+ void SetColumn( int col, wxListItem &item );
+ void SetColumnWidth( int col, int width );
+ void GetColumn( int col, wxListItem &item );
+ int GetColumnWidth( int vol );
+ int GetColumnCount();
+ int GetCountPerPage();
+ void SetItem( wxListItem &item );
+ void GetItem( wxListItem &item );
+ void SetItemState( long item, long state, long stateMask );
+ int GetItemState( long item, long stateMask );
+ int GetItemCount();
+ void GetItemRect( long index, wxRect &rect );
+ bool GetItemPosition( long item, wxPoint& pos );
+ int GetSelectedItemCount();
+ void SetMode( long mode );
+ long GetMode() const;
+ void CalculatePositions();
+ void RealizeChanges();
+ long GetNextItem( long item, int geometry, int state );
+ void DeleteItem( long index );
+ void DeleteAllItems();
+ void DeleteColumn( int col );
+ void DeleteEverything();
+ void EnsureVisible( long index );
+ long FindItem( long start, const wxString& str, bool partial = FALSE );
+ long FindItem( long start, long data);
+ long HitTest( int x, int y, int &flags );
+ void InsertItem( wxListItem &item );
+// void AddItem( wxListItem &item );
+ void InsertColumn( long col, wxListItem &item );
+// void AddColumn( wxListItem &item );
+ void SortItems( wxListCtrlCompare fn, long data );
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxListMainWindow);
+ DECLARE_EVENT_TABLE()
+};
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+//-----------------------------------------------------------------------------
+// wxListItemData
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxListItemData,wxObject);
+
+wxListItemData::wxListItemData()