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