]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/listctrl.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListCtrl class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_LISTCTRL_H_BASE_
13 #define _WX_LISTCTRL_H_BASE_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "listctrlbase.h"
21 #include "wx/listbase.h"
23 // ----------------------------------------------------------------------------
24 // include the wxListCtrl class declaration
25 // ----------------------------------------------------------------------------
27 #if defined(__WIN32__) && !defined(__WXUNIVERSAL__)
28 #include "wx/msw/listctrl.h"
30 #include "wx/generic/listctrl.h"
33 // ----------------------------------------------------------------------------
34 // wxListView: a class which provides a better API for list control
35 // ----------------------------------------------------------------------------
37 class WXDLLEXPORT wxListView
: public wxListCtrl
41 wxListView( wxWindow
*parent
,
42 wxWindowID winid
= -1,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxLC_REPORT
,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
&name
= wxT("listctrl") )
49 Create(parent
, winid
, pos
, size
, style
, validator
, name
);
52 // focus/selection stuff
53 // ---------------------
56 void Select(long n
, bool on
= TRUE
)
58 SetItemState(n
, on
? wxLIST_STATE_SELECTED
: 0, wxLIST_STATE_SELECTED
);
61 // focus and show the given item
62 void Focus(long index
)
64 SetItemState(index
, wxLIST_STATE_FOCUSED
, wxLIST_STATE_FOCUSED
);
68 // get the currently focused item or -1 if none
69 long GetFocusedItem() const
71 return GetNextItem(-1, wxLIST_NEXT_ALL
, wxLIST_STATE_FOCUSED
);
74 // get first and subsequent selected items, return -1 when no more
75 long GetNextSelected(long item
) const
76 { return GetNextItem(item
, wxLIST_NEXT_ALL
, wxLIST_STATE_SELECTED
); }
77 long GetFirstSelected() const
78 { return GetNextSelected(-1); }
80 // return TRUE if the item is selected
81 bool IsSelected(long index
)
82 { return GetItemState(index
, wxLIST_STATE_SELECTED
) != 0; }
87 void SetColumnImage(int col
, int image
)
90 item
.SetMask(wxLIST_MASK_IMAGE
);
95 void ClearColumnImage(int col
) { SetColumnImage(col
, -1); }
98 DECLARE_DYNAMIC_CLASS_NO_COPY(wxListView
)
101 #endif // wxUSE_LISTCTRL
104 // _WX_LISTCTRL_H_BASE_