1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Generic list control
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __LISTCTRLH_G__
12 #define __LISTCTRLH_G__
15 #pragma interface "listctrl.h"
19 #include "wx/object.h"
20 #include "wx/generic/imaglist.h"
21 #include "wx/control.h"
23 #include "wx/textctrl.h"
24 #include "wx/dcclient.h"
25 #include "wx/scrolwin.h"
26 #include "wx/settings.h"
28 #if wxUSE_DRAG_AND_DROP
29 class WXDLLEXPORT wxDropTarget
;
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 class WXDLLEXPORT wxListItem
;
37 class WXDLLEXPORT wxListEvent
;
38 class WXDLLEXPORT wxListCtrl
;
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 class WXDLLEXPORT wxListHeaderData
;
45 class WXDLLEXPORT wxListItemData
;
46 class WXDLLEXPORT wxListLineData
;
48 class WXDLLEXPORT wxListHeaderWindow
;
49 class WXDLLEXPORT wxListMainWindow
;
51 class WXDLLEXPORT wxListRenameTimer
;
52 //class wxListTextCtrl;
54 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
58 // type of compare function for wxListCtrl sort operation
59 typedef int (*wxListCtrlCompare
)(long item1
, long item2
, long sortData
);
61 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
65 #define wxLC_ICON 0x0004
66 #define wxLC_SMALL_ICON 0x0008
67 #define wxLC_LIST 0x0010
68 #define wxLC_REPORT 0x0020
69 #define wxLC_ALIGN_TOP 0x0040
70 #define wxLC_ALIGN_LEFT 0x0080
71 #define wxLC_AUTOARRANGE 0x0100 // not supported in wxGLC
72 #define wxLC_USER_TEXT 0x0200 // not supported in wxGLC (how does it work?)
73 #define wxLC_EDIT_LABELS 0x0400
74 #define wxLC_NO_HEADER 0x0800 // not supported in wxGLC
75 #define wxLC_NO_SORT_HEADER 0x1000 // not supported in wxGLC
76 #define wxLC_SINGLE_SEL 0x2000
77 #define wxLC_SORT_ASCENDING 0x4000
78 #define wxLC_SORT_DESCENDING 0x8000 // not supported in wxGLC
80 #define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
81 #define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
82 #define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
84 // Omitted because (a) too much detail (b) not enough style flags
85 // #define wxLC_NO_SCROLL
86 // #define wxLC_NO_LABEL_WRAP
87 // #define wxLC_OWNERDRAW_FIXED
88 // #define wxLC_SHOW_SEL_ALWAYS
90 // Mask flags to tell app/GUI what fields of wxListItem are valid
91 #define wxLIST_MASK_STATE 0x0001
92 #define wxLIST_MASK_TEXT 0x0002
93 #define wxLIST_MASK_IMAGE 0x0004
94 #define wxLIST_MASK_DATA 0x0008
95 #define wxLIST_SET_ITEM 0x0010
96 #define wxLIST_MASK_WIDTH 0x0020
97 #define wxLIST_MASK_FORMAT 0x0040
99 // State flags for indicating the state of an item
100 #define wxLIST_STATE_DONTCARE 0x0000
101 #define wxLIST_STATE_DROPHILITED 0x0001 // not supported in wxGLC
102 #define wxLIST_STATE_FOCUSED 0x0002
103 #define wxLIST_STATE_SELECTED 0x0004
104 #define wxLIST_STATE_CUT 0x0008 // not supported in wxGLC
106 // Hit test flags, used in HitTest // wxGLC suppots 20 and 80
107 #define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
108 #define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
109 #define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
110 #define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
111 #define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
112 #define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
113 #define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
114 #define wxLIST_HITTEST_TOLEFT 0x0400 // To the right of the client area.
115 #define wxLIST_HITTEST_TORIGHT 0x0800 // To the left of the client area.
117 #define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
121 // Flags for GetNextItem // always wxLIST_NEXT_ALL in wxGLC
123 wxLIST_NEXT_ABOVE
, // Searches for an item above the specified item
124 wxLIST_NEXT_ALL
, // Searches for subsequent item by index
125 wxLIST_NEXT_BELOW
, // Searches for an item below the specified item
126 wxLIST_NEXT_LEFT
, // Searches for an item to the left of the specified item
127 wxLIST_NEXT_RIGHT
// Searches for an item to the right of the specified item
130 // Alignment flags for Arrange // always wxLIST_ALIGN_LEFT in wxGLC
132 wxLIST_ALIGN_DEFAULT
,
135 wxLIST_ALIGN_SNAP_TO_GRID
138 // Column format // always wxLIST_FORMAT_LEFT in wxGLC
142 wxLIST_FORMAT_CENTRE
,
143 wxLIST_FORMAT_CENTER
= wxLIST_FORMAT_CENTRE
146 // Autosize values for SetColumnWidth
148 wxLIST_AUTOSIZE
= -1, // always 80 in wxGLC (what else?)
149 wxLIST_AUTOSIZE_USEHEADER
= -2
152 // Flag values for GetItemRect
159 // Flag values for FindItem // not supported by wxGLC
167 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
171 class WXDLLEXPORT wxListItem
: public wxObject
173 DECLARE_DYNAMIC_CLASS(wxListItem
)
176 long m_mask
; // Indicates what fields are valid
177 long m_itemId
; // The zero-based item position
178 int m_col
; // Zero-based column, if in report mode
179 long m_state
; // The state of the item
180 long m_stateMask
; // Which flags of m_state are valid (uses same flags)
181 wxString m_text
; // The label/header text
182 int m_image
; // The zero-based index into an image list
183 long m_data
; // App-defined data
184 wxColour
*m_colour
; // only wxGLC, not supported by Windows ;->
187 int m_format
; // left, right, centre
188 int m_width
; // width of column
193 //-----------------------------------------------------------------------------
195 //-----------------------------------------------------------------------------
197 class WXDLLEXPORT wxListEvent
: public wxNotifyEvent
199 DECLARE_DYNAMIC_CLASS(wxListEvent
)
202 wxListEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
214 typedef void (wxEvtHandler::*wxListEventFunction
)(wxListEvent
&);
216 #define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
217 #define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
218 #define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
219 #define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
220 #define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
221 #define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
222 #define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
223 #define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
224 #define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
225 #define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
226 #define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
227 #define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
228 #define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
229 #define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
230 #define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) { wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
231 #define EVT_LIST_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
233 //-----------------------------------------------------------------------------
234 // wxListItemData (internal)
235 //-----------------------------------------------------------------------------
237 class WXDLLEXPORT wxListItemData
: public wxObject
239 DECLARE_DYNAMIC_CLASS(wxListItemData
);
246 int m_width
,m_height
;
250 wxListItemData(void);
251 wxListItemData( const wxListItem
&info
);
252 void SetItem( const wxListItem
&info
);
253 void SetText( const wxString
&s
);
254 void SetImage( int image
);
255 void SetData( long data
);
256 void SetPosition( int x
, int y
);
257 void SetSize( int width
, int height
);
258 void SetColour( wxColour
*col
);
259 bool HasImage(void) const;
260 bool HasText(void) const;
261 bool IsHit( int x
, int y
) const;
262 void GetText( wxString
&s
);
263 int GetX( void ) const;
264 int GetY( void ) const;
265 int GetWidth(void) const;
266 int GetHeight(void) const;
267 int GetImage(void) const;
268 void GetItem( wxListItem
&info
);
269 wxColour
*GetColour(void);
272 //-----------------------------------------------------------------------------
273 // wxListHeaderData (internal)
274 //-----------------------------------------------------------------------------
276 class WXDLLEXPORT wxListHeaderData
: public wxObject
278 DECLARE_DYNAMIC_CLASS(wxListHeaderData
);
290 wxListHeaderData(void);
291 wxListHeaderData( const wxListItem
&info
);
292 void SetItem( const wxListItem
&item
);
293 void SetPosition( int x
, int y
);
294 void SetWidth( int w
);
295 void SetFormat( int format
);
296 void SetHeight( int h
);
297 bool HasImage(void) const;
298 bool HasText(void) const;
299 bool IsHit( int x
, int y
) const;
300 void GetItem( wxListItem
&item
);
301 void GetText( wxString
&s
);
302 int GetImage(void) const;
303 int GetWidth(void) const;
304 int GetFormat(void) const;
307 //-----------------------------------------------------------------------------
308 // wxListLineData (internal)
309 //-----------------------------------------------------------------------------
311 class WXDLLEXPORT wxListLineData
: public wxObject
313 DECLARE_DYNAMIC_CLASS(wxListLineData
);
318 wxRect m_bound_label
;
320 wxRect m_bound_hilight
;
323 wxBrush
*m_hilightBrush
;
325 wxListMainWindow
*m_owner
;
327 void DoDraw( wxDC
*dc
, bool hilight
, bool paintBG
);
330 wxListLineData( void ) {};
331 wxListLineData( wxListMainWindow
*owner
, int mode
, wxBrush
*hilightBrush
);
332 void CalculateSize( wxDC
*dc
, int spacing
);
333 void SetPosition( wxDC
*dc
, int x
, int y
, int window_width
);
334 void SetColumnPosition( int index
, int x
);
335 void GetSize( int &width
, int &height
);
336 void GetExtent( int &x
, int &y
, int &width
, int &height
);
337 void GetLabelExtent( int &x
, int &y
, int &width
, int &height
);
338 long IsHit( int x
, int y
);
339 void InitItems( int num
);
340 void SetItem( int index
, const wxListItem
&info
);
341 void GetItem( int index
, wxListItem
&info
);
342 void GetText( int index
, wxString
&s
);
343 void SetText( int index
, const wxString s
);
344 int GetImage( int index
);
345 void GetRect( wxRect
&rect
);
346 void Hilight( bool on
);
347 void ReverseHilight( void );
348 void DrawRubberBand( wxDC
*dc
, bool on
);
349 void Draw( wxDC
*dc
);
350 bool IsInRect( int x
, int y
, const wxRect
&rect
);
351 bool IsHilighted( void );
352 void AssignRect( wxRect
&dest
, int x
, int y
, int width
, int height
);
353 void AssignRect( wxRect
&dest
, const wxRect
&source
);
356 //-----------------------------------------------------------------------------
357 // wxListHeaderWindow (internal)
358 //-----------------------------------------------------------------------------
360 class WXDLLEXPORT wxListHeaderWindow
: public wxWindow
362 DECLARE_DYNAMIC_CLASS(wxListHeaderWindow
)
365 wxListMainWindow
*m_owner
;
366 wxCursor
*m_currentCursor
;
367 wxCursor
*m_resizeCursor
;
374 wxListHeaderWindow( void );
375 ~wxListHeaderWindow( void );
376 wxListHeaderWindow( wxWindow
*win
, wxWindowID id
, wxListMainWindow
*owner
,
377 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
378 long style
= 0, const wxString
&name
= "columntitles" );
379 void DoDrawRect( wxDC
*dc
, int x
, int y
, int w
, int h
);
380 void OnPaint( wxPaintEvent
&event
);
382 void OnMouse( wxMouseEvent
&event
);
383 void OnSetFocus( wxFocusEvent
&event
);
385 DECLARE_EVENT_TABLE()
388 //-----------------------------------------------------------------------------
389 // wxListRenameTimer (internal)
390 //-----------------------------------------------------------------------------
392 class WXDLLEXPORT wxListRenameTimer
: public wxTimer
395 wxListMainWindow
*m_owner
;
398 wxListRenameTimer( wxListMainWindow
*owner
);
402 //-----------------------------------------------------------------------------
403 // wxListTextCtrl (internal)
404 //-----------------------------------------------------------------------------
406 class WXDLLEXPORT wxListTextCtrl
: public wxTextCtrl
408 DECLARE_DYNAMIC_CLASS(wxListTextCtrl
);
413 wxListMainWindow
*m_owner
;
416 wxListTextCtrl(void) {};
417 wxListTextCtrl( wxWindow
*parent
, const wxWindowID id
,
418 bool *accept
, wxString
*res
, wxListMainWindow
*owner
,
419 const wxString
&value
= "",
420 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
421 int style
= 0, const wxValidator
& validator
= wxDefaultValidator
,
422 const wxString
&name
= "wxListTextCtrlText" );
423 void OnChar( wxKeyEvent
&event
);
424 void OnKillFocus( wxFocusEvent
&event
);
426 DECLARE_EVENT_TABLE()
429 //-----------------------------------------------------------------------------
430 // wxListMainWindow (internal)
431 //-----------------------------------------------------------------------------
433 class WXDLLEXPORT wxListMainWindow
: public wxScrolledWindow
435 DECLARE_DYNAMIC_CLASS(wxListMainWindow
);
441 wxListLineData
*m_current
;
443 wxBrush
*m_hilightBrush
;
444 wxColour
*m_hilightColour
;
445 int m_xScroll
,m_yScroll
;
447 wxImageList
*m_small_image_list
;
448 wxImageList
*m_normal_image_list
;
450 int m_normal_spacing
;
454 wxTimer
*m_renameTimer
;
455 // wxListTextCtrl *m_text;
457 wxString m_renameRes
;
462 wxListMainWindow(void);
463 wxListMainWindow( wxWindow
*parent
, wxWindowID id
,
464 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
465 long style
= 0, const wxString
&name
= "listctrl" );
466 ~wxListMainWindow(void);
467 void RefreshLine( wxListLineData
*line
);
468 void OnPaint( wxPaintEvent
&event
);
469 void HilightAll( bool on
);
470 void SendNotify( wxListLineData
*line
, wxEventType command
);
471 void FocusLine( wxListLineData
*line
);
472 void UnfocusLine( wxListLineData
*line
);
473 void SelectLine( wxListLineData
*line
);
474 void DeselectLine( wxListLineData
*line
);
475 void DeleteLine( wxListLineData
*line
);
476 void RenameLine( wxListLineData
*line
, const wxString
&newName
);
477 void StartLabelEdit( wxListLineData
*line
);
478 void OnRenameTimer(void);
479 void OnRenameAccept(void);
480 void OnMouse( wxMouseEvent
&event
);
481 void MoveToFocus( void );
482 void OnArrowChar( wxListLineData
*newCurrent
, bool shiftDown
);
483 void OnChar( wxKeyEvent
&event
);
484 void OnKeyDown( wxKeyEvent
&event
);
485 void OnSetFocus( wxFocusEvent
&event
);
486 void OnKillFocus( wxFocusEvent
&event
);
487 void OnSize( wxSizeEvent
&event
);
488 void DrawImage( int index
, wxDC
*dc
, int x
, int y
);
489 void GetImageSize( int index
, int &width
, int &height
);
490 int GetIndexOfLine( const wxListLineData
*line
);
491 int GetTextLength( wxString
&s
); // should be const
493 void SetImageList( wxImageList
*imageList
, int which
);
494 void SetItemSpacing( int spacing
, bool isSmall
= FALSE
);
495 int GetItemSpacing( bool isSmall
= FALSE
);
496 void SetColumn( int col
, wxListItem
&item
);
497 void SetColumnWidth( int col
, int width
);
498 void GetColumn( int col
, wxListItem
&item
);
499 int GetColumnWidth( int vol
);
500 int GetColumnCount( void );
501 int GetCountPerPage( void );
502 void SetItem( wxListItem
&item
);
503 void GetItem( wxListItem
&item
);
504 void SetItemState( long item
, long state
, long stateMask
);
505 int GetItemState( long item
, long stateMask
);
506 int GetItemCount( void );
507 void GetItemRect( long index
, wxRect
&rect
);
508 bool GetItemPosition(long item
, wxPoint
& pos
);
509 int GetSelectedItemCount( void );
510 void SetMode( long mode
);
511 long GetMode( void ) const;
512 void CalculatePositions( void );
513 void RealizeChanges(void);
514 long GetNextItem( long item
, int geometry
, int state
);
515 void DeleteItem( long index
);
516 void DeleteAllItems( void );
517 void DeleteColumn( int col
);
518 void DeleteEverything( void );
519 void EnsureVisible( long index
);
520 long FindItem(long start
, const wxString
& str
, bool partial
= FALSE
);
521 long FindItem(long start
, long data
);
522 long HitTest( int x
, int y
, int &flags
);
523 void InsertItem( wxListItem
&item
);
524 // void AddItem( wxListItem &item );
525 void InsertColumn( long col
, wxListItem
&item
);
526 // void AddColumn( wxListItem &item );
527 void SortItems( wxListCtrlCompare fn
, long data
);
529 DECLARE_EVENT_TABLE()
532 //-----------------------------------------------------------------------------
534 //-----------------------------------------------------------------------------
536 class WXDLLEXPORT wxListCtrl
: public wxControl
538 DECLARE_DYNAMIC_CLASS(wxListCtrl
);
543 wxListCtrl( wxWindow
*parent
, wxWindowID id
= -1,
544 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
545 long style
= wxLC_ICON
, const wxValidator
& validator
= wxDefaultValidator
,
546 const wxString
&name
= "listctrl" )
548 Create(parent
, id
, pos
, size
, style
, validator
, name
);
551 bool Create( wxWindow
*parent
, wxWindowID id
= -1,
552 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
553 long style
= wxLC_ICON
, const wxValidator
& validator
= wxDefaultValidator
,
554 const wxString
&name
= "listctrl" );
555 void OnSize( wxSizeEvent
&event
);
556 bool GetColumn( int col
, wxListItem
& item
) const;
557 bool SetColumn( int col
, wxListItem
& item
);
558 int GetColumnWidth( int col
) const;
559 bool SetColumnWidth( int col
, int width
);
560 int GetCountPerPage(void) const; // not the same in wxGLC as in Windows, I think
561 // wxText& GetEditControl(void) const; // not supported in wxGLC
562 bool GetItem( wxListItem
& info
) const;
563 bool SetItem( wxListItem
& info
) ;
564 long SetItem( long index
, int col
, const wxString
& label
, int imageId
= -1 );
565 int GetItemState( long item
, long stateMask
) const;
566 bool SetItemState( long item
, long state
, long stateMask
);
567 bool SetItemImage( long item
, int image
, int selImage
);
568 wxString
GetItemText( long item
) const;
569 void SetItemText( long item
, const wxString
& str
);
570 long GetItemData( long item
) const;
571 bool SetItemData( long item
, long data
);
572 bool GetItemRect( long item
, wxRect
& rect
, int code
= wxLIST_RECT_BOUNDS
) const;
573 bool GetItemPosition( long item
, wxPoint
& pos
) const;
574 bool SetItemPosition( long item
, const wxPoint
& pos
); // not supported in wxGLC
575 int GetItemCount(void) const;
576 int GetColumnCount(void) const;
577 void SetItemSpacing( int spacing
, bool isSmall
= FALSE
);
578 int GetItemSpacing( bool isSmall
) const;
579 int GetSelectedItemCount(void) const;
580 // wxColour GetTextColour(void) const; // wxGLC has colours for every Item (see wxListItem)
581 // void SetTextColour(const wxColour& col);
582 long GetTopItem(void) const;
583 void SetSingleStyle( long style
, bool add
= TRUE
) ;
584 void SetWindowStyleFlag(long style
);
585 void RecreateWindow(void) {};
586 long GetNextItem(long item
, int geometry
= wxLIST_NEXT_ALL
, int state
= wxLIST_STATE_DONTCARE
) const;
587 wxImageList
*GetImageList(int which
) const;
588 void SetImageList(wxImageList
*imageList
, int which
) ;
589 bool Arrange( int flag
= wxLIST_ALIGN_DEFAULT
); // always wxLIST_ALIGN_LEFT in wxGLC
591 bool DeleteItem( long item
);
592 bool DeleteAllItems(void);
593 bool DeleteAllColumns(void);
594 bool DeleteColumn( int col
);
595 // wxText& Edit(long item) ; // not supported in wxGLC
596 bool EnsureVisible( long item
);
597 long FindItem(long start
, const wxString
& str
, bool partial
= FALSE
);
598 long FindItem(long start
, long data
);
599 long FindItem(long start
, const wxPoint
& pt
, int direction
); // not supported in wxGLC
600 long HitTest(const wxPoint
& point
, int& flags
);
601 long InsertItem(wxListItem
& info
);
602 long InsertItem(long index
, const wxString
& label
);
603 long InsertItem(long index
, int imageIndex
);
604 long InsertItem(long index
, const wxString
& label
, int imageIndex
);
605 long InsertColumn(long col
, wxListItem
& info
);
606 long InsertColumn(long col
, const wxString
& heading
, int format
= wxLIST_FORMAT_LEFT
,
608 bool ScrollList(int dx
, int dy
);
609 bool SortItems(wxListCtrlCompare fn
, long data
);
610 bool Update(long item
);
611 void OnIdle( wxIdleEvent
&event
);
613 // We have to hand down a few functions
615 bool SetBackgroundColour( const wxColour
&colour
);
616 bool SetForegroundColour( const wxColour
&colour
);
617 bool SetFont( const wxFont
&font
);
619 #if wxUSE_DRAG_AND_DROP
620 void SetDropTarget( wxDropTarget
*dropTarget
)
621 { m_mainWin
->SetDropTarget( dropTarget
); }
622 wxDropTarget
*GetDropTarget() const
623 { return m_mainWin
->GetDropTarget(); }
626 bool SetCursor( const wxCursor
&cursor
)
627 { return m_mainWin
? m_mainWin
->wxWindow::SetCursor(cursor
) : FALSE
; }
628 wxColour
GetBackgroundColour() const
629 { return m_mainWin
? m_mainWin
->GetBackgroundColour() : wxColour(); }
630 wxColour
GetForegroundColour() const
631 { return m_mainWin
? m_mainWin
->GetForegroundColour() : wxColour(); }
632 bool PopupMenu( wxMenu
*menu
, int x
, int y
)
633 { return m_mainWin
->PopupMenu( menu
, x
, y
); }
635 { m_mainWin
->SetFocus(); }
639 // wxListTextCtrl m_textCtrl;
640 wxImageList
*m_imageListNormal
;
641 wxImageList
*m_imageListSmall
;
642 wxImageList
*m_imageListState
; // what's that ?
643 wxListHeaderWindow
*m_headerWin
;
644 wxListMainWindow
*m_mainWin
;
646 DECLARE_EVENT_TABLE()
651 #endif // __LISTCTRLH_G__