From: Francesco Montorsi Date: Sun, 19 Oct 2008 12:49:07 +0000 (+0000) Subject: interface revisions X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/320ab87c57a457bd953e248d5a51273f9103b34a interface revisions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/list.h b/interface/wx/list.h index 38ba08708e..f3538e12f4 100644 --- a/interface/wx/list.h +++ b/interface/wx/list.h @@ -73,14 +73,14 @@ MyListElement *current = node->GetData(); ...process the current element... - + node = node->GetNext(); } @endcode @library{wxbase} - @category{FIXME} + @category{data} @see wxArray, wxVector */ @@ -91,7 +91,7 @@ public: Default constructor. */ wxList(); - + /** Constructor which initialized the list with an array of @a count elements. */ @@ -109,7 +109,7 @@ public: wxList::compatibility_iterator Append(T* object); /** - Clears the list. + Clears the list. Deletes the actual objects if DeleteContents( @true ) was called previously. */ void Clear(); @@ -124,22 +124,22 @@ public: /** Deletes the given element refered to by @a iter from the list if @a iter is a valid iterator. Returns @true if successful. - + Deletes the actual object if DeleteContents( @true ) was called previously. */ bool DeleteNode(const compatibility_iterator& iter); /** Finds the given @a object and removes it from the list, returning - @true if successful. - + @true if successful. + Deletes @a object if DeleteContents( @true ) was called previously. */ bool DeleteObject(T* object); /** Removes element refered to be @a iter. - + Deletes the actualy object if DeleteContents( @true ) was called previously. */ void Erase(const compatibility_iterator& iter); diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index ed3dfaf77f..029a510b5a 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -9,25 +9,26 @@ /** @class wxListBox - A listbox is used to select one or more of a list of strings. The - strings are displayed in a scrolling box, with the selected string(s) - marked in reverse video. A listbox can be single selection (if an item - is selected, the previous selection is removed) or multiple selection + A listbox is used to select one or more of a list of strings. + + The strings are displayed in a scrolling box, with the selected string(s) + marked in reverse video. A listbox can be single selection (if an item is + selected, the previous selection is removed) or multiple selection (clicking an item toggles the item on or off independently of other selections). - List box elements are numbered from zero. Their number may be limited - under some platforms. + List box elements are numbered from zero. + Their number may be limited under some platforms. - A listbox callback gets an event wxEVT_COMMAND_LISTBOX_SELECTED for - single clicks, and wxEVT_COMMAND_LISTBOX_DOUBLECLICKED for double clicks. + A listbox callback gets an event @c wxEVT_COMMAND_LISTBOX_SELECTED for + single clicks, and @c wxEVT_COMMAND_LISTBOX_DOUBLECLICKED for double clicks. @beginStyleTable @style{wxLB_SINGLE} Single-selection list. @style{wxLB_MULTIPLE} - Multiple-selection list: the user can toggle multiple items on and - off. This is the same as wxLB_EXTENDED in wxGTK2 port. + Multiple-selection list: the user can toggle multiple items on and off. + This is the same as wxLB_EXTENDED in wxGTK2 port. @style{wxLB_EXTENDED} Extended-selection list: the user can extend the selection by using @c SHIFT or @c CTRL keys together with the cursor movement keys or @@ -42,13 +43,17 @@ The listbox contents are sorted in alphabetical order. @endStyleTable + Note that @c wxLB_SINGLE, @c wxLB_MULTIPLE and @c wxLB_EXTENDED styles are + mutually exclusive and you can specify at most one of them (single selection + is the default). See also @ref overview_windowstyles. + @beginEventTable{wxCommandEvent} @event{EVT_LISTBOX(id, func)} Process a wxEVT_COMMAND_LISTBOX_SELECTED event, when an item on the list is selected or the selection changes. @event{EVT_LISTBOX_DCLICK(id, func)} - Process a wxEVT_COMMAND_LISTBOXDOUBLECLICKED event, when the - listbox is double-clicked. + Process a wxEVT_COMMAND_LISTBOXDOUBLECLICKED event, when the listbox + is double-clicked. @endEventTable @library{wxcore} @@ -64,16 +69,31 @@ public: Default constructor. */ wxListBox(); - + /** - Constructor + Constructor, creating and showing a list box. + @param parent + The parent window. + @param id + The ID of this control. A value of @c wxID_ANY indicates a default value. + @param pos + The initial position. + @param size + The initial size. + If wxDefaultSize is specified then the window is sized appropriately. @param n Number of strings with which to initialise the control. + @param choices + The strings to use to initialize the control. @param style Window style. See wxListBox. + @param validator + The validator for this control. + @param name + The name of this class. */ - + wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -81,24 +101,23 @@ public: const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listBox"); - + const wxString& name = wxListBoxNameStr); + /** - Constructor + Constructor, creating and showing a list box. - @param choices - An array of strings with which to initialise the control. - @param style - Window style. See wxListBox. + See the other wxListBox() constructor; the only difference is that + this overload takes a wxArrayString instead of a pointer to an array + of wxString. */ - + wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listBox"); + const wxString& name = wxListBoxNameStr); /** Destructor, destroying the list box. @@ -107,8 +126,8 @@ public: //@{ /** - Creates the listbox for two-step construction. See wxListBox() - for further details. + Creates the listbox for two-step construction. + See wxListBox() for further details. */ bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -142,7 +161,7 @@ public: @param selections A reference to an wxArrayInt instance that is used to store the result of - the query. + the query. @return The number of selections. @@ -154,8 +173,8 @@ public: virtual int GetSelections(wxArrayInt& selections) const; /** - Returns the item located at @e point, or @c wxNOT_FOUND if there - is no item located at @e point. + Returns the item located at @a point, or @c wxNOT_FOUND if there + is no item located at @a point. It is currently implemented for wxMSW, wxMac and wxGTK2 ports. @@ -163,11 +182,11 @@ public: Point of item (in client coordinates) to obtain @return Item located at point, or wxNOT_FOUND if unimplemented or the - item does not exist. + item does not exist. @since 2.7.0 */ - int HitTest(const wxPoint point) const; + int HitTest(const wxPoint& point) const; /** Insert the given number of strings before the specified position. @@ -189,7 +208,7 @@ public: @param items Labels of items to be inserted @param pos - Position before which to insert the items: if pos is 0 the + Position before which to insert the items: if pos is @c 0 the items will be inserted in the beginning of the listbox */ void InsertItems(const wxArrayString& items, @@ -218,8 +237,8 @@ public: void Set(int n, const wxString* choices, void **clientData = NULL); /** - Clears the list box and adds the given strings to it. You may - free the array from the calling program after this method + Clears the list box and adds the given strings to it. + You may free the array from the calling program after this method has been called. @param choices @@ -227,8 +246,7 @@ public: @param clientData Options array of client data pointers */ - void Set(const wxArrayString& choices, - void **clientData = NULL); + void Set(const wxArrayString& choices, void **clientData = NULL); /** Set the specified item to be the first visible item. diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 6efd491173..66acc9a65e 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -19,37 +19,37 @@ 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 (and optionally - wxListCtrl::OnGetItemImage or wxListCtrl::OnGetItemColumnImage and - wxListCtrl::OnGetItemAttr) to return the information - about the items when the control requests it. Virtual list control can be used - as a normal one except that no operations which can take time proportional to - the number of items in the control happen -- this is required to allow having a - practically infinite number of items. For example, in a multiple selection - virtual list control, the selections won't be sent when many items are selected - at once because this could mean iterating over all the items. + wxListCtrl::SetItemCount first and overload 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. + Virtual list control can be used as a normal one except that no operations + which can take time proportional to the number of items in the control happen + -- this is required to allow having a practically infinite number of items. + For example, in a multiple selection virtual list control, the selections won't + be sent when many items are selected at once because this could mean iterating + over all the items. Using many of wxListCtrl features is shown in the - @ref overview_samplelistctrl "corresponding sample". + @ref page_samples_listctrl "corresponding sample". To intercept events from a list control, use the event table macros described in wxListEvent. - @b Mac Note: Starting with 2.8, wxListCtrl uses a native implementation for - report mode, and uses a generic implementation for other modes. You can use the - generic implementation for report mode as well by setting the - mac.listctrl.always_use_generic wxSystemOption() to 1. + wxMac Note: Starting with wxWidgets 2.8, wxListCtrl uses a native + implementation for report mode, and uses a generic implementation for other + modes. You can use the generic implementation for report mode as well by setting + the @c mac.listctrl.always_use_generic system option (see wxSystemOption) to 1. - Column reordering (only wxMSW): In report view, the control has several columns + wxMSW Note: In report view, the control has several columns which are identified by their internal indices. By default, these indices correspond to their order on screen, i.e. the column 0 appears first (in the left-to-right or maybe right-to-left if the current language uses this writing direction), the column 1 next and so on. However it is possible to reorder the columns visual order using SetColumnsOrder() method and the user can also rearrange the columns interactively by dragging them. In this case, the index - of the column is not the same as its order and the functions GetColumnOrder() and - GetColumnIndexFromOrder() should be used to translate between them. + of the column is not the same as its order and the functions GetColumnOrder() + and GetColumnIndexFromOrder() should be used to translate between them. @beginStyleTable @@ -116,7 +116,7 @@ @event{EVT_LIST_ITEM_MIDDLE_CLICK(id, func)} The middle mouse button has been clicked on an item. @event{EVT_LIST_ITEM_RIGHT_CLICK(id, func)} - The right mouse button has been clicked on an item. + The right mouse button has been clicked on an item. @event{EVT_LIST_KEY_DOWN(id, func)} A key has been pressed. @event{EVT_LIST_INSERT_ITEM(id, func)} @@ -140,8 +140,8 @@ @category{ctrl} @appearance{listctrl.png} - @see @ref overview_listctrl "wxListCtrl Overview", wxListView, - wxListBox, wxTreeCtrl, wxImageList, wxListEvent, wxListItem, wxEditableListBox + @see @ref overview_listctrl, wxListView, wxListBox, wxTreeCtrl, wxImageList, + wxListEvent, wxListItem, wxEditableListBox */ class wxListCtrl : public wxControl { @@ -161,8 +161,8 @@ public: @param pos Window position. @param size - Window size. If wxDefaultSize is specified then the window is - sized appropriately. + Window size. + If wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxListCtrl. @param validator @@ -185,9 +185,8 @@ public: virtual ~wxListCtrl(); /** - Arranges the items in icon or small icon view. This only has effect on Win32. - @a flag is one of: - + Arranges the items in icon or small icon view. + This only has effect on Win32. @a flag is one of: - wxLIST_ALIGN_DEFAULT: Default alignment. - wxLIST_ALIGN_LEFT: Align to the left side of the control. - wxLIST_ALIGN_TOP: Align to the top side of the control. @@ -196,11 +195,10 @@ public: bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); /** - Sets the image list associated with the control and - takes ownership of it (i.e. the control will, unlike when using - SetImageList, delete the list when destroyed). @a which is one of - wxIMAGE_LIST_NORMAL, wxIMAGE_LIST_SMALL, wxIMAGE_LIST_STATE (the last is - unimplemented). + Sets the image list associated with the control and takes ownership of it + (i.e. the control will, unlike when using SetImageList(), delete the list + when destroyed). @a which is one of @c wxIMAGE_LIST_NORMAL, @c wxIMAGE_LIST_SMALL, + @c wxIMAGE_LIST_STATE (the last is unimplemented). @see SetImageList() */ @@ -223,9 +221,10 @@ public: /** Deletes all items in the list control. - @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). + + @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). */ bool DeleteAllItems(); @@ -235,18 +234,22 @@ public: bool DeleteColumn(int col); /** - Deletes the specified item. This function sends the - @c wxEVT_COMMAND_LIST_DELETE_ITEM event for the item being deleted. - See also: DeleteAllItems() + Deletes the specified item. + This function sends the @c wxEVT_COMMAND_LIST_DELETE_ITEM event for the + item being deleted. + + @see DeleteAllItems() */ bool DeleteItem(long item); /** - Starts editing the label of the given item. This function generates a - EVT_LIST_BEGIN_LABEL_EDIT event which can be vetoed so that no - text control will appear for in-place editing. + Starts editing the label of the given item. + + This function generates a @c EVT_LIST_BEGIN_LABEL_EDIT event which can be + vetoed so that no text control will appear for in-place editing. + If the user changed the label (i.e. s/he does not press ESC or leave - the text control without changes, a EVT_LIST_END_LABEL_EDIT event + 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); @@ -257,16 +260,20 @@ public: bool EnsureVisible(long item); /** - Find an item nearest this position in the specified direction, - starting from @a start or the beginning if @a start is -1. + Find an item whose label matches this string, starting from start or the + beginning if start is @c -1. The string comparison is case insensitive. + + If @a partial is @true then this method will look for items which begin with @a str. */ long FindItem(long start, const wxString& str, bool partial = false); + /** - Find an item nearest this position in the specified direction, - starting from @a start or the beginning if @a start is -1. + 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); + /** Find an item nearest this position in the specified direction, starting from @a start or the beginning if @a start is -1. @@ -274,8 +281,8 @@ public: long FindItem(long start, const wxPoint& pt, int direction); /** - Gets information about this column. See SetItem() for more - information. + Gets information about this column. + See SetItem() for more information. */ bool GetColumn(int col, wxListItem& item) const; @@ -300,30 +307,29 @@ public: int GetColumnWidth(int col) const; /** - Returns the array containing the orders of all columns. On error, an empty - array is returned. + Returns the array containing the orders of all columns. + On error, an empty array is returned. */ wxArrayInt GetColumnsOrder() const; /** - Gets the number of items that can fit vertically in the - visible area of the list control (list or report view) - or the total number of items in the list control (icon - or small icon view). + Gets the number of items that can fit vertically in the visible area of + the list control (list or report view) or the total number of items in + the list control (icon or small icon view). */ int GetCountPerPage() const; /** - Returns the edit control being currently used to edit a label. Returns @NULL - if no label is being edited. + Returns the edit control being currently used to edit a label. + Returns @NULL if no label is being edited. + @note It is currently only implemented for wxMSW and the generic version, - not for the native Mac OS X version. + not for the native Mac OS X version. */ wxTextCtrl* GetEditControl() const; /** Returns the specified image list. @a which may be one of: - - wxIMAGE_LIST_NORMAL: The normal (large icon) image list. - wxIMAGE_LIST_SMALL: The small icon image list. - wxIMAGE_LIST_STATE: The user-defined state image list (unimplemented). @@ -331,17 +337,16 @@ public: wxImageList* GetImageList(int which) const; /** - Gets information about the item. See SetItem() for more - information. + Gets information about the item. See SetItem() for more information. You must call @e info.SetId() to the ID of item you're interested in before calling this method. */ bool GetItem(wxListItem& info) const; /** - Returns the colour for this item. If the item has no specific colour, returns - an invalid colour (and not the default background control of the control - itself). + Returns the colour for this item. + If the item has no specific colour, returns an invalid colour + (and not the default background control of the control itself). @see GetItemTextColour() */ @@ -370,21 +375,22 @@ public: /** Returns the rectangle representing the item's size and position, in physical coordinates. + @a code is one of wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON, wxLIST_RECT_LABEL. */ bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const; /** - Retrieves the spacing between icons in pixels: horizontal spacing is returned - as @c x component of the wxSize object and the vertical - spacing as its @c y component. + Retrieves the spacing between icons in pixels: horizontal spacing is + returned as @c x component of the wxSize object and the vertical spacing + as its @c y component. */ wxSize GetItemSpacing() const; /** Gets the item state. For a list of state flags, see SetItem(). - The @b stateMask indicates which state flags are of interest. + The @a stateMask indicates which state flags are of interest. */ int GetItemState(long item, long stateMask) const; @@ -394,67 +400,55 @@ public: wxString GetItemText(long item) const; /** - Returns the colour for this item. If the item has no specific colour, returns - an invalid colour (and not the default foreground control of the control itself - as this wouldn't allow distinguishing between items having the same colour as - the current control foreground and items with default colour which, hence, have - always the same colour as the control). + Returns the colour for this item. + + If the item has no specific colour, returns an invalid colour (and not the + default foreground control of the control itself as this wouldn't allow + distinguishing between items having the same colour as the current control + foreground and items with default colour which, hence, have always the + same colour as the control). */ wxColour GetItemTextColour(long item) const; /** Searches for an item with the given geometry or state, starting from - @a item but excluding the @a item itself. If @a item is -1, - the first item that matches the specified flags will be returned. - Returns the first item with given state following @a item or -1 if - no such item found. - This function may be used to find all selected items in the control like this: - - @a geometry can be one of: - - wxLIST_NEXT_ABOVE + @a item but excluding the @a item itself. - Searches for an item above the specified item. - - wxLIST_NEXT_ALL - - Searches for subsequent item by index. - - wxLIST_NEXT_BELOW - - Searches for an item below the specified item. - - wxLIST_NEXT_LEFT - - Searches for an item to the left of the specified item. + If @a item is -1, the first item that matches the specified flags will be returned. + Returns the first item with given state following @a item or -1 if no such item found. + This function may be used to find all selected items in the control like this: - wxLIST_NEXT_RIGHT + @code + long item = -1; + for ( ;; ) + { + item = listctrl->GetNextItem(item, + wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); + if ( item == -1 ) + break; + + // this item is selected - do whatever is needed with it + wxLogMessage("Item %ld is selected.", item); + } + @endcode - Searches for an item to the right of the specified item. + @a geometry can be one of: + - wxLIST_NEXT_ABOVE: Searches for an item above the specified item. + - wxLIST_NEXT_ALL: Searches for subsequent item by index. + - wxLIST_NEXT_BELOW: Searches for an item below the specified item. + - wxLIST_NEXT_LEFT: Searches for an item to the left of the specified item. + - wxLIST_NEXT_RIGHT: Searches for an item to the right of the specified item. @note this parameter is only supported by wxMSW currently and ignored on - other platforms. - @a state can be a bitlist of the following: - - wxLIST_STATE_DONTCARE + other platforms. - Don't care what the state is. - - wxLIST_STATE_DROPHILITED - - The item indicates it is a drop target. - - wxLIST_STATE_FOCUSED - - The item has the focus. - - wxLIST_STATE_SELECTED - - The item is selected. - - wxLIST_STATE_CUT - - The item is selected as part of a cut and paste operation. + @a state can be a bitlist of the following: + - wxLIST_STATE_DONTCARE: Don't care what the state is. + - wxLIST_STATE_DROPHILITED: The item indicates it is a drop target. + - wxLIST_STATE_FOCUSED: The item has the focus. + - wxLIST_STATE_SELECTED: The item is selected. + - wxLIST_STATE_CUT: The item is selected as part of a cut and paste operation. */ long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const; @@ -467,13 +461,15 @@ public: /** Returns the rectangle representing the size and position, in physical coordinates, of the given subitem, i.e. the part of the row @a item in the - column @e subItem. - This method is only meaningfull when the wxListCtrl is in the report mode. If - @a subItem parameter is equal to the special value + column @a subItem. + + This method is only meaningfull when the wxListCtrl is in the report mode. + If @a subItem parameter is equal to the special value @c wxLIST_GETSUBITEMRECT_WHOLEITEM the return value is the same as for GetItemRect(). - @a code can be one of @c wxLIST_RECT_BOUNDS, - @c wxLIST_RECT_ICON or @c wxLIST_RECT_LABEL. + + @a code can be one of @c wxLIST_RECT_BOUNDS, @c wxLIST_RECT_ICON or + @c wxLIST_RECT_LABEL. @since 2.7.0 */ @@ -486,8 +482,7 @@ public: wxColour GetTextColour() const; /** - Gets the index of the topmost visible item when in - list or report view. + Gets the index of the topmost visible item when in list or report view. */ long GetTopItem() const; @@ -495,73 +490,46 @@ public: Returns the rectangle taken by all items in the control. In other words, if the controls client size were equal to the size of this rectangle, no scrollbars would be needed and no free space would be left. + Note that this function only works in the icon and small icon views, not in list or report views (this is a limitation of the native Win32 control). */ wxRect GetViewRect() const; /** - Determines which item (if any) is at the specified point, - giving details in @e flags. Returns index of the item or @c wxNOT_FOUND - if no item is at the specified point. - @a flags will be a combination of the following flags: - - wxLIST_HITTEST_ABOVE - - Above the client area. - - wxLIST_HITTEST_BELOW - - Below the client area. - - wxLIST_HITTEST_NOWHERE - - In the client area but below the last item. - - wxLIST_HITTEST_ONITEMICON - - On the bitmap associated with an item. - - wxLIST_HITTEST_ONITEMLABEL - - On the label (string) associated with an item. - - wxLIST_HITTEST_ONITEMRIGHT - - In the area to the right of an item. - - wxLIST_HITTEST_ONITEMSTATEICON - - On the state icon for a tree view item that is in a user-defined state. - - wxLIST_HITTEST_TOLEFT + Determines which item (if any) is at the specified point, giving details + in @a flags. Returns index of the item or @c wxNOT_FOUND if no item is at + the specified point. - To the right of the client area. - - wxLIST_HITTEST_TORIGHT - - To the left of the client area. - - wxLIST_HITTEST_ONITEM - - Combination of wxLIST_HITTEST_ONITEMICON, wxLIST_HITTEST_ONITEMLABEL, - wxLIST_HITTEST_ONITEMSTATEICON. + @a flags will be a combination of the following flags: + - wxLIST_HITTEST_ABOVE: Above the client area. + - wxLIST_HITTEST_BELOW: Below the client area. + - wxLIST_HITTEST_NOWHERE: In the client area but below the last item. + - wxLIST_HITTEST_ONITEMICON: On the bitmap associated with an item. + - wxLIST_HITTEST_ONITEMLABEL: On the label (string) associated with an item. + - wxLIST_HITTEST_ONITEMRIGHT: In the area to the right of an item. + - wxLIST_HITTEST_ONITEMSTATEICON: On the state icon for a tree view item + that is in a user-defined state. + - wxLIST_HITTEST_TOLEFT: To the right of the client area. + - wxLIST_HITTEST_TORIGHT: To the left of the client area. + - wxLIST_HITTEST_ONITEM: Combination of @c wxLIST_HITTEST_ONITEMICON, + @c wxLIST_HITTEST_ONITEMLABEL, @c wxLIST_HITTEST_ONITEMSTATEICON. If @a ptrSubItem is not @NULL and the wxListCtrl is in the report mode the subitem (or column) number will also be provided. This feature is only available in version 2.7.0 or higher and is currently only implemented under wxMSW and requires at least comctl32.dll of verion 4.70 on - the host system or the value stored in @a ptrSubItem will be always -1. To - compile this feature into wxWidgets library you need to have access to + the host system or the value stored in @a ptrSubItem will be always -1. + 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) const; /** For report view mode (only), inserts a column. For more details, see SetItem(). */ long InsertColumn(long col, wxListItem& info); + /** For report view mode (only), inserts a column. For more details, see SetItem(). */ @@ -570,7 +538,8 @@ public: int width = -1); /** - Insert a wxListItem. + Inserts an item, returning the index of the new item if successful, -1 otherwise. + @param info wxListItem object */ @@ -578,45 +547,48 @@ public: /** Insert an string item. + @param index Index of the new item, supplied by the application @param label String label */ 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 may be overloaded in the derived class for a control with - @c wxLC_VIRTUAL style. It should return the attribute for the - 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. + @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() + @see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText() */ virtual wxListItemAttr* OnGetItemAttr(long item) const; @@ -624,26 +596,27 @@ public: 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 + + The base class version always calls OnGetItemImage() for the first column, else it returns -1. - @see OnGetItemText(), OnGetItemImage(), - OnGetItemAttr() + @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 + (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 + + 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() + @see OnGetItemText(), OnGetItemColumnImage(), OnGetItemAttr() */ virtual int OnGetItemImage(long item) const; @@ -652,25 +625,26 @@ public: @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() + @see SetItemCount(), OnGetItemImage(), OnGetItemColumnImage(), OnGetItemAttr() */ virtual wxString OnGetItemText(long item, long column) const; /** - Redraws the given @e item. This is only useful for the virtual list controls - as without calling this function the displayed value of the item doesn't change - even when the underlying data does change. + Redraws the given @e item. + + This is only useful for the virtual list controls as without calling this + function the displayed value of the item doesn't change even when the + underlying data does change. @see RefreshItems() */ void RefreshItem(long item); /** - Redraws the items between @a itemFrom and @e itemTo. The starting item - must be less than or equal to the ending one. - Just as RefreshItem() this is only useful for - virtual list controls. + Redraws the items between @a itemFrom and @e itemTo. + The starting item must be less than or equal to the ending one. + + Just as RefreshItem() this is only useful for virtual list controls. */ void RefreshItems(long itemFrom, long itemTo); @@ -679,47 +653,57 @@ public: @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. + @note This method is currently only implemented in the Windows version. */ bool ScrollList(int dx, int dy); /** - Sets the background colour (GetBackgroundColour already implicit in - wxWindow class). + Sets the background colour. + + Note that the wxWindow::GetBackgroundColour() function of wxWindow base + class can be used to retrieve the current background colour. */ void SetBackgroundColour(const wxColour& col); /** - Sets information about this column. See SetItem() for more - information. + Sets information about this column. + See SetItem() for more information. */ bool SetColumn(int col, wxListItem& item); /** Sets the column width. - @a width can be a width in pixels or wxLIST_AUTOSIZE (-1) or - wxLIST_AUTOSIZE_USEHEADER (-2). - wxLIST_AUTOSIZE will resize the column to the length of its longest item. - wxLIST_AUTOSIZE_USEHEADER - will resize the column to the length of the header (Win32) or 80 pixels (other - platforms). + + @a width can be a width in pixels or @c wxLIST_AUTOSIZE (-1) or + @c wxLIST_AUTOSIZE_USEHEADER (-2). + + @c wxLIST_AUTOSIZE will resize the column to the length of its longest item. + + @c wxLIST_AUTOSIZE_USEHEADER will resize the column to the length of the + header (Win32) or 80 pixels (other platforms). + In small or normal icon view, @a col must be -1, and the column width is set for all columns. */ bool SetColumnWidth(int col, int width); /** - Sets the order of all columns at once. The @a orders array must have the - same number elements as the number of columns and contain each position exactly - once. + Sets the order of all columns at once. + + The @a orders array must have the same number elements as the number of + columns and contain each position exactly once. + This function is valid in report view only. */ bool SetColumnOrder(const wxArrayInt& orders) const; /** - Sets the image list associated with the control. @a which is one of - wxIMAGE_LIST_NORMAL, wxIMAGE_LIST_SMALL, wxIMAGE_LIST_STATE (the last is - unimplemented). + Sets the image list associated with the control. + + @a which is one of @c wxIMAGE_LIST_NORMAL, @c wxIMAGE_LIST_SMALL, + @c wxIMAGE_LIST_STATE (the last is unimplemented). + This method does not take ownership of the image list, you have to delete it yourself. @@ -729,61 +713,28 @@ public: /** Sets the data of an item. - - wxListItem is a class with the following members - - - long m_mask: Indicates which fields are valid. See below. - - long m_itemId: Zero based item position. - - int m_col: Zero based column index. - - long m_state: The state of the item: See below for valid state flags. - - long m_stateMask: A mask indicating which state flags are valid. See below. - - wxStrign m_text: the label (or header for columns) - - int m_image: The zero based index into an image list - - long m_data: Application defined data - - int m_format: For columns only: Either of wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT, wxLIST_FORMAT_CENTRE - - int m_width: For columns only: the width of the column - - The @b m_mask member contains a bitlist specifying which of the other fields - are valid. The flags are: - - wxLIST_MASK_STATE: The m_state field is valid. - - wxLIST_MASK_TEXT: The m_text field is valid. - - wxLIST_MASK_IMAGE: The m_image field is valid. - - wxLIST_MASK_DATA: The m_data field is valid. - - wxLIST_MASK_WIDTH: The m_width field is valid. - - wxLIST_MASK_FORMAT: The m_format field is valid. - - The @b m_stateMask and @b m_state members take flags from the following: - - - wxLIST_STATE_DONTCARE: Don't care what the state is. Win32 only. - - wxLIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only. - - wxLIST_STATE_FOCUSED: The item has the focus. - - wxLIST_STATE_SELECTED: The item is selected. - - wxLIST_STATE_CUT: The item is in the cut state. Win32 only. - - The wxListItem object can also contain item-specific colour and font - information: for this you need to call one of SetTextColour(), - SetBackgroundColour() or SetFont() functions on it passing it the colour/font - to use. If the colour/font is not specified, the default list control - colour/font is used. + + Using the wxListItem's mask and state mask, you can change only selected + attributes of a wxListCtrl item. */ bool SetItem(wxListItem& info); - + /** - Sets a string field at a particular column. + Sets an item string field at a particular column. */ - long SetItem(long index, int col, const wxString& label, - int imageId = -1); + long SetItem(long index, int column, const wxString& label, int imageId = -1); /** - Sets the background colour for this item. This function only works - in report view. The colour can be retrieved using GetItemBackgroundColour(). + Sets the background colour for this item. + This function only works in report view mode. + The colour can be retrieved using GetItemBackgroundColour(). */ void SetItemBackgroundColour(long item, const wxColour& col); /** - Sets the image associated with the item. In report view, you can - specify the column. The image is an index into the image list - associated with the list control. + Sets the image associated with the item. + In report view, you can specify the column. + The image is an index into the image list associated with the list control. */ bool SetItemColumnImage(long item, long column, int image); @@ -803,9 +754,10 @@ public: void SetItemCount(long count); /** - Associates application-defined data with this item. - Notice that this function cannot be used to associate pointers with the control - items, use SetItemPtrData() instead. + Associates application-defined data with this item. + + Notice that this function cannot be used to associate pointers with the control + items, use SetItemPtrData() instead. */ bool SetItemData(long item, long data); @@ -815,15 +767,18 @@ public: void SetItemFont(long item, const wxFont& font); /** - Sets the unselected and selected images associated with the item. The - images are indices into the image list associated with the list control. + 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); - + /** - Sets the unselected and selected images associated with the item. The - images are indices into the image list associated with the list control. - This form is deprecated: @a selImage is not used. + Sets the unselected and selected images associated with the item. + The images are indices into the image list associated with the list control. + + @deprecated + This form is deprecated: @a selImage is not used; use the other + SetItemImage() overload. */ bool SetItemImage(long item, int image, int selImage); @@ -833,10 +788,11 @@ public: bool SetItemPosition(long item, const wxPoint& pos); /** - Associates application-defined data with this item. The @a data parameter may - be either an integer or a pointer cast to the @c wxUIntPtr type which is - guaranteed to be large enough to be able to contain all integer types and - pointers. + Associates application-defined data with this item. + + The @a data parameter may be either an integer or a pointer cast to the + @c wxUIntPtr type which is guaranteed to be large enough to be able to + contain all integer types and pointers. @since 2.8.4 */ @@ -854,9 +810,9 @@ public: void SetItemText(long item, const wxString& text); /** - Sets the colour for this item. This function only works in report view. - The colour can be retrieved using - GetItemTextColour(). + Sets the colour for this item. + This function only works in report view. + The colour can be retrieved using GetItemTextColour(). */ void SetItemTextColour(long item, const wxColour& col); @@ -879,18 +835,24 @@ public: Call this function to sort the items in the list control. Sorting is done using the specified @a fnSortCallBack function. This function must have the following prototype: + @code + int wxCALLBACK wxListCompareFunction(long item1, long item2, long sortData) + @endcode It is called each time when the two items must be compared and should return 0 if the items are equal, negative value if the first item is less than the second one and positive value if the first one is greater than the second one (the same convention as used by @c qsort(3)). - @param item1 - client data associated with the first item (NOT the index). - @param item2 - client data associated with the second item (NOT the index). - @param data - the value passed to SortItems() itself. + The parameter @e item1 is the client data associated with the first item (NOT the index). + The parameter @e item2 is the client data associated with the second item (NOT the index). + The parameter @e data is the value passed to SortItems() itself. + + Notice that the control may only be sorted on client data associated with + the items, so you must use SetItemData if you want to be able to sort the + items in the control. + + Please see the @ref page_samples_listctrl for an example of using this function. */ bool SortItems(wxListCtrlCompare fnSortCallBack, long data); }; @@ -902,6 +864,51 @@ public: A list event holds information about events associated with wxListCtrl objects. + @beginEventTable{wxListEvent} + @event{EVT_LIST_BEGIN_DRAG(id, func)} + Begin dragging with the left mouse button. + @event{EVT_LIST_BEGIN_RDRAG(id, func)} + Begin dragging with the right mouse button. + @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(). + @event{EVT_LIST_DELETE_ITEM(id, func)} + Delete an item. + @event{EVT_LIST_DELETE_ALL_ITEMS(id, func)} + Delete all items. + @event{EVT_LIST_ITEM_SELECTED(id, func)} + The item has been selected. + @event{EVT_LIST_ITEM_DESELECTED(id, func)} + The item has been deselected. + @event{EVT_LIST_ITEM_ACTIVATED(id, func)} + The item has been activated (ENTER or double click). + @event{EVT_LIST_ITEM_FOCUSED(id, func)} + The currently focused item has changed. + @event{EVT_LIST_ITEM_MIDDLE_CLICK(id, func)} + The middle mouse button has been clicked on an item. + @event{EVT_LIST_ITEM_RIGHT_CLICK(id, func)} + The right mouse button has been clicked on an item. + @event{EVT_LIST_KEY_DOWN(id, func)} + A key has been pressed. + @event{EVT_LIST_INSERT_ITEM(id, func)} + An item has been inserted. + @event{EVT_LIST_COL_CLICK(id, func)} + A column (m_col) has been left-clicked. + @event{EVT_LIST_COL_RIGHT_CLICK(id, func)} + A column (m_col) (which can be -1 if the click occurred outside any column) + has been right-clicked. + @event{EVT_LIST_COL_BEGIN_DRAG(id, func)} + The user started resizing a column - can be vetoed. + @event{EVT_LIST_COL_DRAGGING(id, func)} + The divider between columns is being dragged. + @event{EVT_LIST_COL_END_DRAG(id, func)} + A column has been resized by the user. + @event{EVT_LIST_CACHE_HINT(id, func)} + Prepare cache for a virtual list control + @endEventTable + + @library{wxbase} @category{events} @@ -928,10 +935,11 @@ public: long GetCacheTo() const; /** - The column position: it is only used with @c COL events. For the column - dragging events, it is the column to the left of the divider being dragged, for - the column click events it may be -1 if the user clicked in the list control - header outside any column. + The column position: it is only used with @c COL events. + + For the column dragging events, it is the column to the left of the divider + being dragged, for the column click events it may be -1 if the user clicked + in the list control header outside any column. */ int GetColumn() const; @@ -981,12 +989,11 @@ public: const wxString GetText() const; /** - This method only makes sense for @c EVT_LIST_END_LABEL_EDIT message - and returns @true if it the label editing has been cancelled by the user - (GetLabel() returns an empty string in this case - but it doesn't allow the application to distinguish between really cancelling - the edit and - the admittedly rare case when the user wants to rename it to an empty string). + This method only makes sense for @c EVT_LIST_END_LABEL_EDIT message and + returns @true if it the label editing has been cancelled by the user + (GetLabel() returns an empty string in this case but it doesn't allow the + application to distinguish between really cancelling the edit and the + admittedly rare case when the user wants to rename it to an empty string). */ bool IsEditCancelled() const; }; @@ -996,14 +1003,12 @@ public: /** @class wxListItemAttr - Represents the attributes (color, font, ...) of a - wxListCtrl wxListItem. + Represents the attributes (color, font, ...) of a wxListCtrl's wxListItem. @library{wxbase} - @category{FIXME} + @category{ctrl} - @see @ref overview_listctrl "wxListCtrl Overview", wxListCtrl, - wxListItem + @see @ref overview_listctrl, wxListCtrl, wxListItem */ class wxListItemAttr { @@ -1012,6 +1017,7 @@ public: Default Constructor. */ wxListItemAttr(); + /** Construct a wxListItemAttr with the specified foreground and background colors and font. @@ -1023,17 +1029,17 @@ public: /** Returns the currently set background color. */ - const wxColour GetBackgroundColour() const; + const wxColour& GetBackgroundColour() const; /** Returns the currently set font. */ - const wxFont GetFont() const; + const wxFont& GetFont() const; /** Returns the currently set text color. */ - const wxColour GetTextColour() const; + const wxColour& GetTextColour() const; /** Returns @true if the currently set background color is valid. @@ -1072,14 +1078,14 @@ public: @class wxListView This class currently simply presents a simpler to use interface for the - wxListCtrl -- it can be thought of as a @e faade - for that complicated class. Using it is preferable to using - wxListCtrl directly whenever possible because in the - future some ports might implement wxListView but not the full set of wxListCtrl - features. + wxListCtrl -- it can be thought of as a @e façade for that complicated class. + + Using it is preferable to using wxListCtrl directly whenever possible because + in the future some ports might implement wxListView but not the full set of + wxListCtrl features. - Other than different interface, this class is identical to wxListCtrl. In - particular, it uses the same events, same window styles and so on. + Other than different interface, this class is identical to wxListCtrl. + In particular, it uses the same events, same window styles and so on. @library{wxcore} @category{ctrl} @@ -1101,14 +1107,14 @@ public: void ClearColumnImage(int col); /** - Sets focus to the item with the given @e index. + Sets focus to the item with the given @a index. */ void Focus(long index); /** Returns the first selected item in a (presumably) multiple selection control. - Together with GetNextSelected() it can be - used to iterate over all selected items in the control. + Together with GetNextSelected() it can be used to iterate over all selected + items in the control. @return The first selected item, if any, -1 otherwise. */ @@ -1122,11 +1128,10 @@ public: long GetFocusedItem() const; /** - Used together with GetFirstSelected() to - iterate over all selected items in the control. + Used together with GetFirstSelected() to iterate over all selected items + in the control. - @return Returns the next selected item or -1 if there are no more of - them. + @return Returns the next selected item or -1 if there are no more of them. */ long GetNextSelected(long item) const; @@ -1151,8 +1156,9 @@ public: void Select(long n, bool on = true); /** - Sets the column image for the specified column. To use the column images, the - control must have a valid image list with at least one image. + Sets the column image for the specified column. + To use the column images, the control must have a valid image list with + at least one image. @param col the column to set image for @@ -1163,14 +1169,58 @@ public: }; +/** + Column format (MSW only except wxLIST_FORMAT_LEFT). +*/ +enum wxListColumnFormat +{ + wxLIST_FORMAT_LEFT, + wxLIST_FORMAT_RIGHT, + wxLIST_FORMAT_CENTRE, + wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE +}; /** @class wxListItem This class stores information about a wxListCtrl item or column. + wxListItem is a class which contains informations about: + - Zero based item position; see SetId() and GetId(). + - Zero based column index; see SetColumn() and GetColumn(). + - The label (or header for columns); see SetText() and GetText(). + - The zero based index into an image list; see GetImage() and SetImage(). + - Application defined data; see SetData() and GetData(). + - For columns only: the width of the column; see SetWidth() and GetWidth(). + - For columns only: the format of the column; one of @c wxLIST_FORMAT_LEFT, + @c wxLIST_FORMAT_RIGHT, @c wxLIST_FORMAT_CENTRE. See SetAlign() and GetAlign(). + - The state of the item; see SetState() and GetState(). + This is a bitlist of the following flags: + - @c wxLIST_STATE_FOCUSED: The item has the focus. + - @c wxLIST_STATE_SELECTED: The item is selected. + - @c wxLIST_STATE_DONTCARE: Don't care what the state is. Win32 only. + - @c wxLIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only. + - @c wxLIST_STATE_CUT: The item is in the cut state. Win32 only. + - A mask indicating which state flags are valid; this is a bitlist of the + flags reported above for the item state. See SetStateMask() and GetStateMask(). + - A mask indicating which fields of this class are valid; see SetMask() and GetMask(). + This is a bitlist of the following flags: + - @c wxLIST_MASK_STATE: The state field is valid. + - @c wxLIST_MASK_TEXT: The label field is valid. + - @c wxLIST_MASK_IMAGE: The image field is valid. + - @c wxLIST_MASK_DATA: The application-defined data field is valid. + - @c wxLIST_MASK_WIDTH: The column width field is valid. + - @c wxLIST_MASK_FORMAT: The column format field is valid. + + The wxListItem object can also contain item-specific colour and font + information: for this you need to call one of SetTextColour(), SetBackgroundColour() + or SetFont() functions on it passing it the colour/font to use. + If the colour/font is not specified, the default list control colour/font is used. + @library{wxbase} - @category{FIXME} + @category{ctrl} + + @see wxListCtrl */ class wxListItem : public wxObject { @@ -1186,8 +1236,8 @@ public: void Clear(); /** - Returns the alignment for this item. Can be one of - wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT or wxLIST_FORMAT_CENTRE. + Returns the alignment for this item. + Can be one of @c wxLIST_FORMAT_LEFT, @c wxLIST_FORMAT_RIGHT or @c wxLIST_FORMAT_CENTRE. */ wxListColumnFormat GetAlign() const; @@ -1202,8 +1252,8 @@ public: int GetColumn() const; /** - Returns client data associated with the control. Please note that - client data is associated with the item and not with subitems. + Returns client data associated with the control. + Please note that client data is associated with the item and not with subitems. */ long GetData() const; @@ -1218,71 +1268,40 @@ public: long GetId() const; /** - Returns the zero-based index of the image - associated with the item into the image list. + Returns the zero-based index of the image associated with the item into + the image list. */ int GetImage() const; /** - Returns a bit mask indicating which fields of the structure are valid; - can be any combination of the following values: - - wxLIST_MASK_STATE - - @b GetState is valid. - - wxLIST_MASK_TEXT + Returns a bit mask indicating which fields of the structure are valid. - @b GetText is valid. - - wxLIST_MASK_IMAGE - - @b GetImage is valid. - - wxLIST_MASK_DATA - - @b GetData is valid. - - wxLIST_MASK_WIDTH - - @b GetWidth is valid. - - wxLIST_MASK_FORMAT - - @b GetFormat is valid. + Can be any combination of the following values: + - wxLIST_MASK_STATE: @b GetState is valid. + - wxLIST_MASK_TEXT: @b GetText is valid. + - wxLIST_MASK_IMAGE: @b GetImage is valid. + - wxLIST_MASK_DATA: @b GetData is valid. + - wxLIST_MASK_WIDTH: @b GetWidth is valid. + - wxLIST_MASK_FORMAT: @b GetFormat is valid. */ long GetMask() const; /** - Returns a bit field representing the state of the item. Can be any - combination of: - - wxLIST_STATE_DONTCARE - - Don't care what the state is. Win32 only. + Returns a bit field representing the state of the item. - wxLIST_STATE_DROPHILITED - - The item is highlighted to receive a drop event. Win32 only. - - wxLIST_STATE_FOCUSED - - The item has the focus. - - wxLIST_STATE_SELECTED - - The item is selected. - - wxLIST_STATE_CUT - - The item is in the cut state. Win32 only. + Can be any combination of: + - wxLIST_STATE_DONTCARE: Don't care what the state is. Win32 only. + - wxLIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only. + - wxLIST_STATE_FOCUSED: The item has the focus. + - wxLIST_STATE_SELECTED: The item is selected. + - wxLIST_STATE_CUT: The item is in the cut state. Win32 only. */ long GetState() const; /** Returns the label/header text. */ - const wxString GetText() const; + const wxString& GetText() const; /** Returns the text colour. @@ -1295,8 +1314,7 @@ public: int GetWidth() const; /** - Sets the alignment for the item. See also - GetAlign() + Sets the alignment for the item. See also GetAlign() */ void SetAlign(wxListColumnFormat align); @@ -1312,8 +1330,8 @@ public: //@{ /** - Sets client data for the item. Please note that - client data is associated with the item and not with subitems. + Sets client data for the item. + Please note that client data is associated with the item and not with subitems. */ void SetData(long data); void SetData(void* data); @@ -1342,10 +1360,9 @@ public: /** Sets the item state flags (note that the valid state flags are influenced - by the value of the state mask, see - wxListItem::SetStateMask). - See GetState() for valid flag - values. + by the value of the state mask, see wxListItem::SetStateMask). + + See GetState() for valid flag values. */ void SetState(long state); diff --git a/interface/wx/xlocale.h b/interface/wx/xlocale.h index bf26cb8712..5beed63c32 100644 --- a/interface/wx/xlocale.h +++ b/interface/wx/xlocale.h @@ -11,6 +11,7 @@ @class wxXLocale This class represents a locale object used by so-called xlocale API. + Unlike wxLocale it doesn't provide any non-trivial operations but simply provides a portable wrapper for POSIX @c locale_t type. @@ -52,12 +53,10 @@ @section xlocale_func Locale-dependent functions Currently the following @c _l-functions are available: - - Character classification functions: @c wxIsxxx_l(), e.g. - @c wxIsalpha_l(), @c wxIslower_l() and all the others. - Character transformation functions: @c wxTolower_l() and - @c wxToupper_l() - + - Character classification functions: + @c wxIsxxx_l(), e.g. @c wxIsalpha_l(), @c wxIslower_l() and all the others. + - Character transformation functions: + @c wxTolower_l() and @c wxToupper_l() We hope to provide many more functions (covering numbers, time and formatted IO) in the near future. @@ -69,75 +68,34 @@ class wxXLocale { public: - //@{ /** - Creates the locale object corresponding to the specified locale string. The - locale string is system-dependent, use constructor taking wxLanguage for better - portability. + Creates an uninitialized locale object, IsOk() method will return @false. */ wxLocale(); - wxLocale(wxLanguage lang); - wxLocale(const char* loc); - //@} /** - This class is fully implemented only under the platforms where xlocale POSIX - API or equivalent is available. Currently the xlocale API is available under - most of the recent Unix systems (including Linux, various BSD and Mac OS X) and - Microsoft Visual C++ standard library provides a similar API starting from - version 8 (Visual Studio 2005). - If neither POSIX API nor Microsoft proprietary equivalent are available, this - class is still available but works in degraded mode: the only supported locale - is the C one and attempts to create wxXLocale object for any other locale will - fail. You can use the preprocessor macro @c wxHAS_XLOCALE_SUPPORT to - test if full xlocale API is available or only skeleton C locale support is - present. - Notice that wxXLocale is new in wxWidgets 2.9.0 and is not compiled in if - @c wxUSE_XLOCALE was set to 0 during the library compilation. + Creates the locale object corresponding to the specified language. */ - + wxLocale(wxLanguage lang); /** - Returns the global object representing the "C" locale. For an even shorter - access to this object a global @c wxCLocale variable (implemented as a - macro) is provided and can be used instead of calling this method. + Creates the locale object corresponding to the specified locale string. + The locale string is system-dependent, use constructor taking wxLanguage + for better portability. */ - static wxXLocale GetCLocale(); + wxLocale(const char* loc); /** - This class represents a locale object used by so-called xlocale API. Unlike - wxLocale it doesn't provide any non-trivial operations but - simply provides a portable wrapper for POSIX @c locale_t type. It exists - solely to be provided as an argument to various @c wxFoo_l() functions - which are the extensions of the standard locale-dependent functions (hence the - name xlocale). These functions do exactly the same thing as the corresponding - standard @c foo() except that instead of using the global program locale - they use the provided wxXLocale object. For example, if the user runs the - program in French locale, the standard @c printf() function will output - floating point numbers using decimal comma instead of decimal period. If the - program needs to format a floating-point number in a standard format it can - use @c wxPrintf_l(wxXLocale::GetCLocale(), "%g", number) to do it. - Conversely, if a program wanted to output the number in French locale, even if - the current locale is different, it could use wxXLocale(wxLANGUAGE_FRENCH). + Returns the global object representing the "C" locale. + For an even shorter access to this object a global @c wxCLocale variable + (implemented as a macro) is provided and can be used instead of calling + this method. */ - + static wxXLocale& GetCLocale(); /** Returns @true if this object is initialized, i.e. represents a valid locale - or - @false otherwise. + or @false otherwise. */ bool IsOk() const; - - /** - Currently the following @c _l-functions are available: - Character classification functions: @c wxIsxxx_l(), e.g. - @c wxIsalpha_l(), @c wxIslower_l() and all the others. - Character transformation functions: @c wxTolower_l() and - @c wxToupper_l() - We hope to provide many more functions (covering numbers, time and formatted - IO) in the near future. - - @see wxLocale - */ };