]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/listctrl.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListCtrl class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows 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"
29 #elif defined(__WXPM__)
30 #include "wx/os2/listctrl.h"
32 #include "wx/generic/listctrl.h"
35 // ----------------------------------------------------------------------------
36 // wxListView: a class which provides a better API for list control
37 // ----------------------------------------------------------------------------
39 class WXDLLEXPORT wxListView
: public wxListCtrl
43 wxListView( wxWindow
*parent
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxLC_REPORT
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
&name
= wxT("listctrl") )
51 Create(parent
, id
, pos
, size
, style
, validator
, name
);
54 // focus/selection stuff
55 // ---------------------
58 void Select(long n
, bool on
= TRUE
)
60 SetItemState(n
, on
? wxLIST_STATE_SELECTED
: 0, wxLIST_STATE_SELECTED
);
63 // focus and show the given item
64 void Focus(long index
)
66 SetItemState(index
, wxLIST_STATE_FOCUSED
, wxLIST_STATE_FOCUSED
);
70 // get the currently focused item or -1 if none
71 long GetFocusedItem() const
73 return GetNextItem(-1, wxLIST_NEXT_ALL
, wxLIST_STATE_FOCUSED
);
76 // get first and subsequent selected items, return -1 when no more
77 long GetNextSelected(long item
) const
78 { return GetNextItem(item
, wxLIST_NEXT_ALL
, wxLIST_STATE_SELECTED
); }
79 long GetFirstSelected() const
80 { return GetNextSelected(-1); }
82 // return TRUE if the item is selected
83 bool IsSelected(long index
)
84 { return GetItemState(index
, wxLIST_STATE_SELECTED
) != 0; }
89 void SetColumnImage(int col
, int image
)
92 item
.SetMask(wxLIST_MASK_IMAGE
);
97 void ClearColumnImage(int col
) { SetColumnImage(col
, -1); }
100 DECLARE_DYNAMIC_CLASS_NO_COPY(wxListView
)
103 #endif // wxUSE_LISTCTRL
106 // _WX_LISTCTRL_H_BASE_