]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/listctrl.h
destructor for wxMenu deletes menu now
[wxWidgets.git] / include / wx / generic / listctrl.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: listctrl.h
3// Purpose: Generic list control
4// Author: Robert Roebling
5// Created: 01/02/97
6// Id:
7// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef __LISTCTRLH_G__
12#define __LISTCTRLH_G__
13
14#ifdef __GNUG__
0d3820b3 15#pragma interface "listctrl.h"
c801d85f
KB
16#endif
17
18#include "wx/defs.h"
19#include "wx/object.h"
f60d0f94 20#include "wx/generic/imaglist.h"
c801d85f
KB
21#include "wx/control.h"
22#include "wx/timer.h"
ee7ee469 23#include "wx/textctrl.h"
c801d85f
KB
24#include "wx/dcclient.h"
25#include "wx/scrolwin.h"
26#include "wx/settings.h"
27
1e6d9499
JS
28#if wxUSE_DRAG_AND_DROP
29class WXDLLEXPORT wxDropTarget;
30#endif
31
c801d85f
KB
32//-----------------------------------------------------------------------------
33// classes
34//-----------------------------------------------------------------------------
35
1e6d9499
JS
36class WXDLLEXPORT wxListItem;
37class WXDLLEXPORT wxListEvent;
38class WXDLLEXPORT wxListCtrl;
c801d85f
KB
39
40//-----------------------------------------------------------------------------
41// internal classes
42//-----------------------------------------------------------------------------
43
1e6d9499
JS
44class WXDLLEXPORT wxListHeaderData;
45class WXDLLEXPORT wxListItemData;
46class WXDLLEXPORT wxListLineData;
c801d85f 47
1e6d9499
JS
48class WXDLLEXPORT wxListHeaderWindow;
49class WXDLLEXPORT wxListMainWindow;
c801d85f 50
1e6d9499 51class WXDLLEXPORT wxListRenameTimer;
e179bd65 52class WXDLLEXPORT wxListTextCtrl;
c801d85f
KB
53
54//-----------------------------------------------------------------------------
55// types
56//-----------------------------------------------------------------------------
57
58// type of compare function for wxListCtrl sort operation
debe6624 59typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData);
c801d85f
KB
60
61//-----------------------------------------------------------------------------
62// wxListCtrl flags
63//-----------------------------------------------------------------------------
64
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
a3622daa 77#define wxLC_SORT_ASCENDING 0x4000
c801d85f
KB
78#define wxLC_SORT_DESCENDING 0x8000 // not supported in wxGLC
79
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)
83
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
89
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
98
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
a3622daa 103#define wxLIST_STATE_SELECTED 0x0004
c801d85f
KB
104#define wxLIST_STATE_CUT 0x0008 // not supported in wxGLC
105
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.
116
117#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
118
119
120
121// Flags for GetNextItem // always wxLIST_NEXT_ALL in wxGLC
122enum {
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
a3622daa 127 wxLIST_NEXT_RIGHT // Searches for an item to the right of the specified item
c801d85f
KB
128};
129
130// Alignment flags for Arrange // always wxLIST_ALIGN_LEFT in wxGLC
131enum {
132 wxLIST_ALIGN_DEFAULT,
133 wxLIST_ALIGN_LEFT,
134 wxLIST_ALIGN_TOP,
135 wxLIST_ALIGN_SNAP_TO_GRID
136};
137
138// Column format // always wxLIST_FORMAT_LEFT in wxGLC
139enum {
140 wxLIST_FORMAT_LEFT,
141 wxLIST_FORMAT_RIGHT,
142 wxLIST_FORMAT_CENTRE,
143 wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
144};
145
146// Autosize values for SetColumnWidth
147enum {
0180dad6
RR
148 wxLIST_AUTOSIZE = -1, // width of longest item
149 wxLIST_AUTOSIZE_USEHEADER = -2 // always 80 in wxGLC
c801d85f
KB
150};
151
152// Flag values for GetItemRect
153enum {
154 wxLIST_RECT_BOUNDS,
155 wxLIST_RECT_ICON,
156 wxLIST_RECT_LABEL
157};
158
159// Flag values for FindItem // not supported by wxGLC
160enum {
161 wxLIST_FIND_UP,
162 wxLIST_FIND_DOWN,
163 wxLIST_FIND_LEFT,
164 wxLIST_FIND_RIGHT
165};
166
c801d85f
KB
167//-----------------------------------------------------------------------------
168// wxListItem
169//-----------------------------------------------------------------------------
170
1e6d9499 171class WXDLLEXPORT wxListItem: public wxObject
c801d85f
KB
172{
173 DECLARE_DYNAMIC_CLASS(wxListItem)
174
175 public:
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 ;->
185
186 // For columns only
187 int m_format; // left, right, centre
188 int m_width; // width of column
189
190 wxListItem(void);
191};
192
c801d85f
KB
193//-----------------------------------------------------------------------------
194// wxListItemData (internal)
195//-----------------------------------------------------------------------------
196
1e6d9499 197class WXDLLEXPORT wxListItemData : public wxObject
c801d85f
KB
198{
199 DECLARE_DYNAMIC_CLASS(wxListItemData);
200
0208334d 201 public:
c801d85f
KB
202 wxString m_text;
203 int m_image;
204 long m_data;
205 int m_xpos,m_ypos;
206 int m_width,m_height;
207 wxColour *m_colour;
a3622daa 208
c801d85f
KB
209 public:
210 wxListItemData(void);
211 wxListItemData( const wxListItem &info );
212 void SetItem( const wxListItem &info );
213 void SetText( const wxString &s );
debe6624
JS
214 void SetImage( int image );
215 void SetData( long data );
216 void SetPosition( int x, int y );
217 void SetSize( int width, int height );
c801d85f
KB
218 void SetColour( wxColour *col );
219 bool HasImage(void) const;
220 bool HasText(void) const;
debe6624 221 bool IsHit( int x, int y ) const;
c801d85f
KB
222 void GetText( wxString &s );
223 int GetX( void ) const;
224 int GetY( void ) const;
225 int GetWidth(void) const;
226 int GetHeight(void) const;
227 int GetImage(void) const;
228 void GetItem( wxListItem &info );
229 wxColour *GetColour(void);
230};
231
232//-----------------------------------------------------------------------------
233// wxListHeaderData (internal)
234//-----------------------------------------------------------------------------
235
1e6d9499 236class WXDLLEXPORT wxListHeaderData : public wxObject
c801d85f
KB
237{
238 DECLARE_DYNAMIC_CLASS(wxListHeaderData);
239
240 protected:
241 long m_mask;
242 int m_image;
243 wxString m_text;
244 int m_format;
245 int m_width;
246 int m_xpos,m_ypos;
247 int m_height;
a3622daa 248
c801d85f
KB
249 public:
250 wxListHeaderData(void);
251 wxListHeaderData( const wxListItem &info );
252 void SetItem( const wxListItem &item );
debe6624
JS
253 void SetPosition( int x, int y );
254 void SetWidth( int w );
255 void SetFormat( int format );
256 void SetHeight( int h );
c801d85f
KB
257 bool HasImage(void) const;
258 bool HasText(void) const;
debe6624 259 bool IsHit( int x, int y ) const;
c801d85f
KB
260 void GetItem( wxListItem &item );
261 void GetText( wxString &s );
262 int GetImage(void) const;
263 int GetWidth(void) const;
264 int GetFormat(void) const;
265};
266
267//-----------------------------------------------------------------------------
268// wxListLineData (internal)
269//-----------------------------------------------------------------------------
270
1e6d9499 271class WXDLLEXPORT wxListLineData : public wxObject
c801d85f
KB
272{
273 DECLARE_DYNAMIC_CLASS(wxListLineData);
274
0208334d 275 public:
c801d85f 276 wxList m_items;
0a240683
JS
277 wxRect m_bound_all;
278 wxRect m_bound_label;
279 wxRect m_bound_icon;
280 wxRect m_bound_hilight;
c801d85f
KB
281 int m_mode;
282 bool m_hilighted;
283 wxBrush *m_hilightBrush;
284 int m_spacing;
285 wxListMainWindow *m_owner;
286
1e6d9499 287 void DoDraw( wxDC *dc, bool hilight, bool paintBG );
c801d85f
KB
288
289 public:
290 wxListLineData( void ) {};
debe6624 291 wxListLineData( wxListMainWindow *owner, int mode, wxBrush *hilightBrush );
1e6d9499
JS
292 void CalculateSize( wxDC *dc, int spacing );
293 void SetPosition( wxDC *dc, int x, int y, int window_width );
debe6624 294 void SetColumnPosition( int index, int x );
c801d85f
KB
295 void GetSize( int &width, int &height );
296 void GetExtent( int &x, int &y, int &width, int &height );
297 void GetLabelExtent( int &x, int &y, int &width, int &height );
debe6624
JS
298 long IsHit( int x, int y );
299 void InitItems( int num );
300 void SetItem( int index, const wxListItem &info );
301 void GetItem( int index, wxListItem &info );
302 void GetText( int index, wxString &s );
303 void SetText( int index, const wxString s );
304 int GetImage( int index );
0a240683 305 void GetRect( wxRect &rect );
debe6624 306 void Hilight( bool on );
c801d85f 307 void ReverseHilight( void );
1e6d9499
JS
308 void DrawRubberBand( wxDC *dc, bool on );
309 void Draw( wxDC *dc );
0a240683 310 bool IsInRect( int x, int y, const wxRect &rect );
c801d85f 311 bool IsHilighted( void );
0a240683
JS
312 void AssignRect( wxRect &dest, int x, int y, int width, int height );
313 void AssignRect( wxRect &dest, const wxRect &source );
c801d85f
KB
314};
315
316//-----------------------------------------------------------------------------
317// wxListHeaderWindow (internal)
318//-----------------------------------------------------------------------------
319
1e6d9499 320class WXDLLEXPORT wxListHeaderWindow : public wxWindow
c801d85f
KB
321{
322 DECLARE_DYNAMIC_CLASS(wxListHeaderWindow)
323
324 protected:
325 wxListMainWindow *m_owner;
326 wxCursor *m_currentCursor;
327 wxCursor *m_resizeCursor;
cfb50f14 328 bool m_isDragging;
0208334d
RR
329 int m_column;
330 int m_minX;
331 int m_currentX;
c801d85f
KB
332
333 public:
334 wxListHeaderWindow( void );
a367b9b3 335 ~wxListHeaderWindow( void );
a3622daa 336 wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
debe6624
JS
337 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
338 long style = 0, const wxString &name = "columntitles" );
1e6d9499 339 void DoDrawRect( wxDC *dc, int x, int y, int w, int h );
c801d85f 340 void OnPaint( wxPaintEvent &event );
0208334d 341 void DrawCurrent();
c801d85f
KB
342 void OnMouse( wxMouseEvent &event );
343 void OnSetFocus( wxFocusEvent &event );
a3622daa 344
c801d85f
KB
345 DECLARE_EVENT_TABLE()
346};
347
348//-----------------------------------------------------------------------------
349// wxListRenameTimer (internal)
350//-----------------------------------------------------------------------------
351
1e6d9499 352class WXDLLEXPORT wxListRenameTimer: public wxTimer
c801d85f
KB
353{
354 private:
355 wxListMainWindow *m_owner;
a3622daa 356
c801d85f
KB
357 public:
358 wxListRenameTimer( wxListMainWindow *owner );
359 void Notify();
360};
361
c801d85f
KB
362//-----------------------------------------------------------------------------
363// wxListTextCtrl (internal)
364//-----------------------------------------------------------------------------
365
1e6d9499 366class WXDLLEXPORT wxListTextCtrl: public wxTextCtrl
c801d85f
KB
367{
368 DECLARE_DYNAMIC_CLASS(wxListTextCtrl);
a3622daa 369
c801d85f
KB
370 private:
371 bool *m_accept;
372 wxString *m_res;
373 wxListMainWindow *m_owner;
374
375 public:
ee7ee469
RR
376 wxListTextCtrl(void) {};
377 wxListTextCtrl( wxWindow *parent, const wxWindowID id,
378 bool *accept, wxString *res, wxListMainWindow *owner,
379 const wxString &value = "",
380 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
381 int style = 0, const wxValidator& validator = wxDefaultValidator,
382 const wxString &name = "wxListTextCtrlText" );
383 void OnChar( wxKeyEvent &event );
384 void OnKillFocus( wxFocusEvent &event );
385
386 DECLARE_EVENT_TABLE()
c801d85f
KB
387};
388
c801d85f
KB
389//-----------------------------------------------------------------------------
390// wxListMainWindow (internal)
391//-----------------------------------------------------------------------------
392
1e6d9499 393class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow
c801d85f
KB
394{
395 DECLARE_DYNAMIC_CLASS(wxListMainWindow);
396
397 public:
398 long m_mode;
399 wxList m_lines;
a3622daa 400 wxList m_columns;
c801d85f 401 wxListLineData *m_current;
e179bd65 402 wxListLineData *m_currentEdit;
c801d85f
KB
403 int m_visibleLines;
404 wxBrush *m_hilightBrush;
405 wxColour *m_hilightColour;
c801d85f
KB
406 int m_xScroll,m_yScroll;
407 bool m_dirty;
408 wxImageList *m_small_image_list;
409 wxImageList *m_normal_image_list;
410 int m_small_spacing;
411 int m_normal_spacing;
412 bool m_hasFocus;
413 bool m_usedKeys;
414 bool m_lastOnSame;
415 wxTimer *m_renameTimer;
c801d85f
KB
416 bool m_renameAccept;
417 wxString m_renameRes;
418 bool m_isCreated;
e3e65dac 419 int m_dragCount;
c801d85f
KB
420
421 public:
e179bd65 422 wxListMainWindow();
a3622daa 423 wxListMainWindow( wxWindow *parent, wxWindowID id,
debe6624
JS
424 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
425 long style = 0, const wxString &name = "listctrl" );
e179bd65 426 ~wxListMainWindow();
c801d85f
KB
427 void RefreshLine( wxListLineData *line );
428 void OnPaint( wxPaintEvent &event );
debe6624 429 void HilightAll( bool on );
64693098 430 void SendNotify( wxListLineData *line, wxEventType command );
c801d85f
KB
431 void FocusLine( wxListLineData *line );
432 void UnfocusLine( wxListLineData *line );
433 void SelectLine( wxListLineData *line );
434 void DeselectLine( wxListLineData *line );
435 void DeleteLine( wxListLineData *line );
e179bd65 436
86f975a8
VZ
437 wxTextCtrl *EditLabel( long item );
438 void Edit( long item ) { (void)EditLabel(item); } // deprecated
e179bd65
RR
439 void OnRenameTimer();
440 void OnRenameAccept();
441
c801d85f 442 void OnMouse( wxMouseEvent &event );
e179bd65 443 void MoveToFocus();
c801d85f
KB
444 void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
445 void OnChar( wxKeyEvent &event );
3dfb93fd 446 void OnKeyDown( wxKeyEvent &event );
c801d85f
KB
447 void OnSetFocus( wxFocusEvent &event );
448 void OnKillFocus( wxFocusEvent &event );
449 void OnSize( wxSizeEvent &event );
e179bd65 450
1e6d9499 451 void DrawImage( int index, wxDC *dc, int x, int y );
c801d85f
KB
452 void GetImageSize( int index, int &width, int &height );
453 int GetIndexOfLine( const wxListLineData *line );
454 int GetTextLength( wxString &s ); // should be const
455
debe6624
JS
456 void SetImageList( wxImageList *imageList, int which );
457 void SetItemSpacing( int spacing, bool isSmall = FALSE );
458 int GetItemSpacing( bool isSmall = FALSE );
459 void SetColumn( int col, wxListItem &item );
460 void SetColumnWidth( int col, int width );
461 void GetColumn( int col, wxListItem &item );
462 int GetColumnWidth( int vol );
e179bd65
RR
463 int GetColumnCount();
464 int GetCountPerPage();
c801d85f
KB
465 void SetItem( wxListItem &item );
466 void GetItem( wxListItem &item );
a3622daa 467 void SetItemState( long item, long state, long stateMask );
debe6624 468 int GetItemState( long item, long stateMask );
e179bd65 469 int GetItemCount();
0a240683 470 void GetItemRect( long index, wxRect &rect );
e179bd65
RR
471 bool GetItemPosition( long item, wxPoint& pos );
472 int GetSelectedItemCount();
debe6624 473 void SetMode( long mode );
e179bd65
RR
474 long GetMode() const;
475 void CalculatePositions();
476 void RealizeChanges();
debe6624
JS
477 long GetNextItem( long item, int geometry, int state );
478 void DeleteItem( long index );
e179bd65 479 void DeleteAllItems();
debe6624 480 void DeleteColumn( int col );
e179bd65 481 void DeleteEverything();
debe6624 482 void EnsureVisible( long index );
e179bd65
RR
483 long FindItem( long start, const wxString& str, bool partial = FALSE );
484 long FindItem( long start, long data);
debe6624 485 long HitTest( int x, int y, int &flags );
c801d85f 486 void InsertItem( wxListItem &item );
30dea054 487// void AddItem( wxListItem &item );
debe6624 488 void InsertColumn( long col, wxListItem &item );
30dea054 489// void AddColumn( wxListItem &item );
c801d85f 490 void SortItems( wxListCtrlCompare fn, long data );
a3622daa 491
c801d85f
KB
492 DECLARE_EVENT_TABLE()
493};
494
495//-----------------------------------------------------------------------------
496// wxListCtrl
497//-----------------------------------------------------------------------------
498
1e6d9499 499class WXDLLEXPORT wxListCtrl: public wxControl
c801d85f
KB
500{
501 DECLARE_DYNAMIC_CLASS(wxListCtrl);
a3622daa 502
c801d85f 503 public:
e179bd65 504 wxListCtrl();
32e9da8b 505 wxListCtrl( wxWindow *parent, wxWindowID id = -1,
debe6624 506 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
32e9da8b
RR
507 long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
508 const wxString &name = "listctrl" )
509 {
510 Create(parent, id, pos, size, style, validator, name);
511 }
e179bd65 512 ~wxListCtrl();
32e9da8b 513 bool Create( wxWindow *parent, wxWindowID id = -1,
debe6624 514 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
32e9da8b
RR
515 long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
516 const wxString &name = "listctrl" );
c801d85f 517 void OnSize( wxSizeEvent &event );
e487524e 518 bool GetColumn( int col, wxListItem& item ) const;
debe6624 519 bool SetColumn( int col, wxListItem& item );
e487524e 520 int GetColumnWidth( int col ) const;
debe6624 521 bool SetColumnWidth( int col, int width);
e179bd65 522 int GetCountPerPage() const; // not the same in wxGLC as in Windows, I think
e487524e 523 bool GetItem( wxListItem& info ) const;
c801d85f 524 bool SetItem( wxListItem& info ) ;
debe6624 525 long SetItem( long index, int col, const wxString& label, int imageId = -1 );
e487524e 526 int GetItemState( long item, long stateMask ) const;
debe6624
JS
527 bool SetItemState( long item, long state, long stateMask);
528 bool SetItemImage( long item, int image, int selImage);
e487524e 529 wxString GetItemText( long item ) const;
debe6624 530 void SetItemText( long item, const wxString& str );
e487524e 531 long GetItemData( long item ) const;
debe6624 532 bool SetItemData( long item, long data );
0a240683 533 bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
e487524e 534 bool GetItemPosition( long item, wxPoint& pos ) const;
debe6624 535 bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
e179bd65
RR
536 int GetItemCount() const;
537 int GetColumnCount() const;
33d0b396 538 void SetItemSpacing( int spacing, bool isSmall = FALSE );
e487524e 539 int GetItemSpacing( bool isSmall ) const;
e179bd65
RR
540 int GetSelectedItemCount() const;
541// wxColour GetTextColour() const; // wxGLC has colours for every Item (see wxListItem)
c801d85f 542// void SetTextColour(const wxColour& col);
e179bd65 543 long GetTopItem() const;
debe6624 544 void SetSingleStyle( long style, bool add = TRUE ) ;
e179bd65
RR
545 void SetWindowStyleFlag( long style );
546 void RecreateWindow() {}
547 long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const;
548 wxImageList *GetImageList( int which ) const;
549 void SetImageList( wxImageList *imageList, int which );
debe6624 550 bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
e179bd65 551
4f22cf8d 552 void ClearAll();
debe6624 553 bool DeleteItem( long item );
e179bd65
RR
554 bool DeleteAllItems();
555 bool DeleteAllColumns();
debe6624 556 bool DeleteColumn( int col );
e179bd65
RR
557
558 void EditLabel( long item ) { Edit(item); }
559 void Edit( long item );
560
debe6624 561 bool EnsureVisible( long item );
e179bd65
RR
562 long FindItem( long start, const wxString& str, bool partial = FALSE );
563 long FindItem( long start, long data );
564 long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC
565 long HitTest( const wxPoint& point, int& flags);
c801d85f 566 long InsertItem(wxListItem& info);
e179bd65
RR
567 long InsertItem( long index, const wxString& label );
568 long InsertItem( long index, int imageIndex );
569 long InsertItem( long index, const wxString& label, int imageIndex );
570 long InsertColumn( long col, wxListItem& info );
571 long InsertColumn( long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT,
572 int width = -1 );
573 bool ScrollList( int dx, int dy );
574 bool SortItems( wxListCtrlCompare fn, long data );
575 bool Update( long item );
77e7a1dc
RR
576 void OnIdle( wxIdleEvent &event );
577
578 // We have to hand down a few functions
579
f03fc89f
VZ
580 bool SetBackgroundColour( const wxColour &colour );
581 bool SetForegroundColour( const wxColour &colour );
582 bool SetFont( const wxFont &font );
e4d06860 583
1e6d9499 584#if wxUSE_DRAG_AND_DROP
c801d85f 585 void SetDropTarget( wxDropTarget *dropTarget )
77e7a1dc 586 { m_mainWin->SetDropTarget( dropTarget ); }
c801d85f 587 wxDropTarget *GetDropTarget() const
77e7a1dc 588 { return m_mainWin->GetDropTarget(); }
1e6d9499
JS
589#endif
590
f03fc89f
VZ
591 bool SetCursor( const wxCursor &cursor )
592 { return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : FALSE; }
77e7a1dc 593 wxColour GetBackgroundColour() const
f03fc89f 594 { return m_mainWin ? m_mainWin->GetBackgroundColour() : wxColour(); }
77e7a1dc 595 wxColour GetForegroundColour() const
f03fc89f 596 { return m_mainWin ? m_mainWin->GetForegroundColour() : wxColour(); }
a1665b22 597 bool DoPopupMenu( wxMenu *menu, int x, int y )
39570cd4 598 { return m_mainWin->PopupMenu( menu, x, y ); }
b292e2f5
RR
599 void SetFocus()
600 { m_mainWin->SetFocus(); }
c801d85f 601
0208334d 602 // implementation
e179bd65 603
a3622daa
VZ
604 wxImageList *m_imageListNormal;
605 wxImageList *m_imageListSmall;
c801d85f
KB
606 wxImageList *m_imageListState; // what's that ?
607 wxListHeaderWindow *m_headerWin;
608 wxListMainWindow *m_mainWin;
a3622daa 609
c801d85f
KB
610 DECLARE_EVENT_TABLE()
611
612};
613
614
615#endif // __LISTCTRLH_G__