the text control without changes, a @c EVT_LIST_END_LABEL_EDIT event
will be sent which can be vetoed as well.
*/
- void EditLabel(long item);
+ wxTextCtrl* EditLabel(long item,
+ wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
/**
Ensures this item is visible.
Find an item whose data matches this data, starting from start or the
beginning if 'start' is @c -1.
*/
- long FindItem(long start, long data);
+ long FindItem(long start, wxUIntPtr data);
/**
Find an item nearest this position in the specified direction,
/**
Gets the application-defined data associated with this item.
*/
- long GetItemData(long item) const;
+ wxUIntPtr GetItemData(long item) const;
/**
Returns the item's font.
To compile this feature into wxWidgets library you need to have access to
commctrl.h of version 4.70 that is provided by Microsoft.
*/
- long HitTest(const wxPoint& point, int& flags, long* ptrSubItem) const;
+ long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const;
/**
For report view mode (only), inserts a column. For more details, see SetItem().
long InsertItem(long index, const wxString& label,
int imageIndex);
- /**
- This function may be overloaded in the derived class for a control with
- @c wxLC_VIRTUAL style. It should return the attribute for the specified
- @c item or @NULL to use the default appearance parameters.
-
- wxListCtrl will not delete the pointer or keep a reference of it.
- You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
-
- The base class version always returns @NULL.
-
- @see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText()
- */
- virtual wxListItemAttr* OnGetItemAttr(long item) const;
-
- /**
- Overload this function in the derived class for a control with
- @c wxLC_VIRTUAL and @c wxLC_REPORT styles in order to specify the image
- index for the given line and column.
-
- The base class version always calls OnGetItemImage() for the first column, else
- it returns -1.
-
- @see OnGetItemText(), OnGetItemImage(), OnGetItemAttr()
- */
- virtual int OnGetItemColumnImage(long item, long column) const;
-
- /**
- This function must be overloaded in the derived class for a control with
- @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.
-
- In a control with @c wxLC_REPORT style, OnGetItemImage() only gets called for
- the first column of each line.
-
- The base class version always returns -1.
-
- @see OnGetItemText(), OnGetItemColumnImage(), OnGetItemAttr()
- */
- virtual int OnGetItemImage(long item) const;
-
- /**
- This function @b must be overloaded in the derived class for a control with
- @c wxLC_VIRTUAL style. It should return the string containing the text of
- the given @a column for the specified @c item.
-
- @see SetItemCount(), OnGetItemImage(), OnGetItemColumnImage(), OnGetItemAttr()
- */
- virtual wxString OnGetItemText(long item, long column) const;
-
/**
Redraws the given @e item.
Note that the wxWindow::GetBackgroundColour() function of wxWindow base
class can be used to retrieve the current background colour.
*/
- void SetBackgroundColour(const wxColour& col);
+ virtual bool SetBackgroundColour(const wxColour& col);
/**
Sets information about this column.
Sets the unselected and selected images associated with the item.
The images are indices into the image list associated with the list control.
*/
- bool SetItemImage(long item, int image);
+ bool SetItemImage(long item, int image, int selImage = -1);
/**
Sets the unselected and selected images associated with the item.
This form is deprecated: @a selImage is not used; use the other
SetItemImage() overload.
*/
- bool SetItemImage(long item, int image, int selImage);
+ bool SetItemImage(long item, int image, int selImage = -1);
/**
Sets the position of the item, in icon or small icon view. Windows only.
Please see the @ref page_samples_listctrl for an example of using this function.
*/
bool SortItems(wxListCtrlCompare fnSortCallBack, long data);
+
+protected:
+
+ /**
+ This function may be overloaded in the derived class for a control with
+ @c wxLC_VIRTUAL style. It should return the attribute for the specified
+ @c item or @NULL to use the default appearance parameters.
+
+ wxListCtrl will not delete the pointer or keep a reference of it.
+ You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
+
+ The base class version always returns @NULL.
+
+ @see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText()
+ */
+ virtual wxListItemAttr* OnGetItemAttr(long item) const;
+
+ /**
+ Overload this function in the derived class for a control with
+ @c wxLC_VIRTUAL and @c wxLC_REPORT styles in order to specify the image
+ index for the given line and column.
+
+ The base class version always calls OnGetItemImage() for the first column, else
+ it returns -1.
+
+ @see OnGetItemText(), OnGetItemImage(), OnGetItemAttr()
+ */
+ virtual int OnGetItemColumnImage(long item, long column) const;
+
+ /**
+ This function must be overloaded in the derived class for a control with
+ @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.
+
+ In a control with @c wxLC_REPORT style, OnGetItemImage() only gets called for
+ the first column of each line.
+
+ The base class version always returns -1.
+
+ @see OnGetItemText(), OnGetItemColumnImage(), OnGetItemAttr()
+ */
+ virtual int OnGetItemImage(long item) const;
+
+ /**
+ This function @b must be overloaded in the derived class for a control with
+ @c wxLC_VIRTUAL style. It should return the string containing the text of
+ the given @a column for the specified @c item.
+
+ @see SetItemCount(), OnGetItemImage(), OnGetItemColumnImage(), OnGetItemAttr()
+ */
+ virtual wxString OnGetItemText(long item, long column) const;
};
/**
Constructor.
*/
- wxListEvent(wxEventType commandType = 0, int id = 0);
+ wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
/**
For @c EVT_LIST_CACHE_HINT event only: return the first item which the
/**
An item object, used by some events. See also wxListCtrl::SetItem.
*/
- const wxListItem GetItem() const;
+ const wxListItem& GetItem() const;
/**
Key code if the event is a keypress event.
/**
The (new) item label for @c EVT_LIST_END_LABEL_EDIT event.
*/
- const wxString GetLabel() const;
+ const wxString& GetLabel() const;
/**
The mask.
/**
The text.
*/
- const wxString GetText() const;
+ const wxString& GetText() const;
/**
This method only makes sense for @c EVT_LIST_END_LABEL_EDIT message and
Construct a wxListItemAttr with the specified foreground and
background colors and font.
*/
- wxListItemAttr(const wxColour colText,
- const wxColour colBack,
- const wxFont font);
+ wxListItemAttr(const wxColour& colText,
+ const wxColour& colBack,
+ const wxFont& font);
/**
Returns the currently set background color.
Returns client data associated with the control.
Please note that client data is associated with the item and not with subitems.
*/
- long GetData() const;
+ wxUIntPtr GetData() const;
/**
Returns the font used to display the item.