X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2ebca9b9cc5365cf7e53d6a95482b282fbc0b51..71a0f42d2a5606098e3e7abbb50b9bb1cd718f9e:/interface/wx/listctrl.h diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 860049943c..bb6865f7e2 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -3,7 +3,7 @@ // Purpose: interface of wxListCtrl // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -19,7 +19,7 @@ and attributes) is managed by the main program and is requested by the control itself only when needed which allows to have controls with millions of items without consuming much memory. To use virtual list control you must use - wxListCtrl::SetItemCount first and overload at least wxListCtrl::OnGetItemText + wxListCtrl::SetItemCount first and override at least wxListCtrl::OnGetItemText (and optionally wxListCtrl::OnGetItemImage or wxListCtrl::OnGetItemColumnImage and wxListCtrl::OnGetItemAttr) to return the information about the items when the control requests it. @@ -88,7 +88,7 @@ Begin dragging with the left mouse button. @event{EVT_LIST_BEGIN_RDRAG(id, func)} Begin dragging with the right mouse button.. - @event{EVT_BEGIN_LABEL_EDIT(id, func)} + @event{EVT_LIST_BEGIN_LABEL_EDIT(id, func)} Begin editing a label. This can be prevented by calling Veto(). @event{EVT_LIST_END_LABEL_EDIT(id, func)} Finish editing a label. This can be prevented by calling Veto(). @@ -245,7 +245,30 @@ public: will be sent which can be vetoed as well. */ wxTextCtrl* EditLabel(long item, - wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); + wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl)); + + /** + Finish editing the label. + + This method allows to programmatically end editing a list control item + in place. Usually it will only be called when editing is in progress, + i.e. if GetEditControl() returns non-NULL. In particular, do not call + it from EVT_LIST_BEGIN_LABEL_EDIT handler as the edit control is not + yet fully created by then, just veto the event in this handler instead + to prevent the editing from even starting. + + Notice that calling this method will result in EVT_LIST_END_LABEL_EDIT + event being generated. + + Currently only implemented in wxMSW. + + @param cancel If @true, discard the changes made by user, as if @c + Escape key was pressed. Otherwise, accept the changes as if @c + Return was pressed. + @return @true if item editing wad finished or @false if no item as + being edited. + */ + bool EndEditLabel(bool cancel); /** Ensures this item is visible. @@ -449,8 +472,14 @@ public: /** Gets the item text for this item. + + @param item + Item (zero-based) index. + @param col + Item column (zero-based) index. Column 0 is the default. This + parameter is new in wxWidgets 2.9.1. */ - wxString GetItemText(long item) const; + wxString GetItemText(long item, int col = 0) const; /** Returns the colour for this item. @@ -923,7 +952,7 @@ public: protected: /** - This function may be overloaded in the derived class for a control with + This function may be overridden 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. @@ -955,7 +984,7 @@ protected: virtual wxListItemAttr* OnGetItemColumnAttr(long item, long column) const; /** - Overload this function in the derived class for a control with + Override 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. @@ -968,9 +997,9 @@ protected: virtual int OnGetItemColumnImage(long item, long column) const; /** - This function must be overloaded in the derived class for a control with + This function must be overridden in the derived class for a control with @c wxLC_VIRTUAL style having an "image list" (see SetImageList(); if the - control doesn't have an image list, it is not necessary to overload it). + control doesn't have an image list, it is not necessary to override it). It should return the index of the items image in the controls image list or -1 for no image. @@ -984,7 +1013,7 @@ protected: virtual int OnGetItemImage(long item) const; /** - This function @b must be overloaded in the derived class for a control with + This function @b must be overridden 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.