1.
@beginStyleTable
- @style{wxLC_LIST}:
+ @style{wxLC_LIST}
Multicolumn list view, with optional small icons. Columns are
computed automatically, i.e. you don't set columns as in
wxLC_REPORT. In other words, the list wraps, unlike a wxListBox.
- @style{wxLC_REPORT}:
+ @style{wxLC_REPORT}
Single or multicolumn report view, with optional header.
- @style{wxLC_VIRTUAL}:
+ @style{wxLC_VIRTUAL}
The application provides items text on demand. May only be used
with wxLC_REPORT.
- @style{wxLC_ICON}:
+ @style{wxLC_ICON}
Large icon view, with optional labels.
- @style{wxLC_SMALL_ICON}:
+ @style{wxLC_SMALL_ICON}
Small icon view, with optional labels.
- @style{wxLC_ALIGN_TOP}:
+ @style{wxLC_ALIGN_TOP}
Icons align to the top. Win32 default, Win32 only.
- @style{wxLC_ALIGN_LEFT}:
+ @style{wxLC_ALIGN_LEFT}
Icons align to the left.
- @style{wxLC_AUTOARRANGE}:
+ @style{wxLC_AUTOARRANGE}
Icons arrange themselves. Win32 only.
- @style{wxLC_EDIT_LABELS}:
+ @style{wxLC_EDIT_LABELS}
Labels are editable: the application will be notified when editing
starts.
- @style{wxLC_NO_HEADER}:
+ @style{wxLC_NO_HEADER}
No header in report mode.
- @style{wxLC_SINGLE_SEL}:
+ @style{wxLC_SINGLE_SEL}
Single selection (default is multiple).
- @style{wxLC_SORT_ASCENDING}:
- Sort in ascending order (must still supply a comparison callback in
- SortItems.
- @style{wxLC_SORT_DESCENDING}:
- Sort in descending order (must still supply a comparison callback
- in SortItems.
- @style{wxLC_HRULES}:
+ @style{wxLC_SORT_ASCENDING}
+ Sort in ascending order. (You must still supply a comparison callback
+ in wxListCtrl::SortItems.)
+ @style{wxLC_SORT_DESCENDING}
+ Sort in descending order. (You must still supply a comparison callback
+ in wxListCtrl::SortItems.)
+ @style{wxLC_HRULES}
Draws light horizontal rules between rows in report mode.
- @style{wxLC_VRULES}:
+ @style{wxLC_VRULES}
Draws light vertical rules between columns in report mode.
@endStyleTable
@library{wxcore}
@category{ctrl}
- @appearance{listctrl.png}
+ <!-- @appearance{listctrl.png} -->
- @see @ref overview_wxlistctrloverview "wxListCtrl overview", wxListView,
+ @see @ref overview_listctrl "wxListCtrl Overview", wxListView,
wxListBox, wxTreeCtrl, wxImageList, wxListEvent, wxListItem
*/
class wxListCtrl : public wxControl
{
public:
//@{
+ /**
+ Constructor, creating and showing a list control.
+ */
+ wxListCtrl();
+
/**
Constructor, creating and showing a list control.
Window position.
@param size
Window size. If wxDefaultSize is specified then the window is
- sized
- appropriately.
+ sized appropriately.
@param style
Window style. See wxListCtrl.
@param validator
@see Create(), wxValidator
*/
- wxListCtrl();
wxListCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
/**
Deletes all items in the list control.
- @b NB: This function does @e not send the
+ @note This function does @e not send the
@c wxEVT_COMMAND_LIST_DELETE_ITEM event because deleting many items
from the control would be too slow then (unlike wxListCtrl::DeleteItem).
*/
/**
Returns the edit control being currently used to edit a label. Returns @NULL
if no label is being edited.
- @b NB: It is currently only implemented for wxMSW and the generic version,
+ @note It is currently only implemented for wxMSW and the generic version,
not for the native Mac OS X version.
*/
wxTextCtrl* GetEditControl() const;
Searches for an item to the right of the specified item.
- @b NB: this parameter is only supported by wxMSW currently and ignored on
+ @note this parameter is only supported by wxMSW currently and ignored on
other platforms.
@a state can be a bitlist of the following:
@a code can be one of @c wxLIST_RECT_BOUNDS,
@c wxLIST_RECT_ICON or @c wxLIST_RECT_LABEL.
- @wxsince{2.7.0}
+ @since 2.7.0
*/
bool GetSubItemRect(long item, long subItem, wxRect& rect,
int code = wxLIST_RECT_BOUNDS) const;
//@{
/**
- Insert an image/string item.
-
+ Insert a wxListItem.
@param info
wxListItem object
+ */
+ long InsertItem(wxListItem& info);
+
+ /**
+ Insert an string item.
@param index
Index of the new item, supplied by the application
@param label
String label
- @param imageIndex
- index into the image list associated with this control and view style
*/
- long InsertItem(wxListItem& info);
long InsertItem(long index, const wxString& label);
+
+ /**
+ Insert an image item.
+ @param index
+ Index of the new item, supplied by the application
+ @param imageIndex
+ Index into the image list associated with this control and view style
+ */
long InsertItem(long index, int imageIndex);
+
+ /**
+ Insert an image/string item.
+ @param index
+ Index of the new item, supplied by the application
+ @param label
+ String label
+ @param imageIndex
+ Index into the image list associated with this control and view style
+ */
long InsertItem(long index, const wxString& label,
int imageIndex);
//@}
/**
This function must be overloaded in the derived class for a control with
- @c wxLC_VIRTUAL style having an @ref setimagelist() "image list"
+ @c wxLC_VIRTUAL style having an @ref SetImageList() "image list"
(if the control doesn't have an image list, it is not necessary to overload
it). It should return the index of the items image in the controls image list
or -1 for no image.
@a dx specifies the number of pixels to scroll. If in list view mode,
@a dx specifies the number of columns to scroll. @a dy always specifies
the number of pixels to scroll vertically.
- @b NB: This method is currently only implemented in the Windows version.
+ @note This method is currently only implemented in the Windows version.
*/
bool ScrollList(int dx, int dy);
Sets a string field at a particular column.
*/
bool SetItem(wxListItem& info);
- long SetItem(long index, int col, const wxStringamp; label,
+ long SetItem(long index, int col, const wxString& label,
int imageId = -1);
m_mask m_state field is valid.
bool SetItemColumnImage(long item, long column, int image);
/**
- This method can only be used with virtual list controls. It is used to indicate
- to the control the number of items it contains. After calling it, the main
- program should be ready to handle calls to various item callbacks (such as
- wxListCtrl::OnGetItemText) for all items in the range
- from 0 to @e count.
+ This method can only be used with virtual list controls.
+
+ It is used to indicate to the control the number of items it contains.
+ After calling it, the main program should be ready to handle calls to
+ various item callbacks (such as wxListCtrl::OnGetItemText) for all
+ items in the range from 0 to @a count.
+
+ Notice that the control is not necessarily redrawn after this call as
+ it may be undesirable if an item which is not visible on the screen
+ anyhow was added to or removed from a control displaying many items, if
+ you do need to refresh the display you can just call Refresh() manually.
*/
void SetItemCount(long count);
guaranteed to be large enough to be able to contain all integer types and
pointers.
- @wxsince{2.8.4}
+ @since 2.8.4
*/
bool SetItemPtrData(long item, wxUIntPtr data);
/**
Constructor.
*/
- wxListEvent(WXTYPE commandType = 0, int id = 0);
+ wxListEvent(wxEventType commandType = 0, int id = 0);
/**
For @c EVT_LIST_CACHE_HINT event only: return the first item which the
@library{wxbase}
@category{FIXME}
- @see @ref overview_wxlistctrloverview "wxListCtrl overview", wxListCtrl,
+ @see @ref overview_listctrl "wxListCtrl Overview", wxListCtrl,
wxListItem
*/
class wxListItemAttr
@library{wxcore}
@category{ctrl}
- @appearance{listview.png}
+ <!-- @appearance{listview.png} -->
@see wxListView::SetColumnImage
*/
Together with GetNextSelected() it can be
used to iterate over all selected items in the control.
- @returns The first selected item, if any, -1 otherwise.
+ @return The first selected item, if any, -1 otherwise.
*/
long GetFirstSelected() const;
Used together with GetFirstSelected() to
iterate over all selected items in the control.
- @returns Returns the next selected item or -1 if there are no more of
+ @return Returns the next selected item or -1 if there are no more of
them.
*/
long GetNextSelected(long item) const;