lbSortBy: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Fix) |
||
Line 18: | Line 18: | ||
|p1= controlOrIDC: [[Control]] or [[Number]] - the ListBox control or its IDC | |p1= controlOrIDC: [[Control]] or [[Number]] - the ListBox control or its IDC | ||
|p2 | |p2= sortByType: [[String]] - (Optional, default "TEXT") one of: | ||
* {{hl|"TEXT"}} | * {{hl|"TEXT"}} | ||
* {{hl|"VALUE"}} | * {{hl|"VALUE"}} | ||
* {{hl|"DATA"}} | * {{hl|"DATA"}} | ||
| | |p3= reversedOrder: [[Boolean]] - (Optional, default [[false]]) [[true]] for sorting in reversed order | ||
| | |p4= caseSensitive: [[Boolean]] - (Optional, default [[false]]) [[true]] for using case-sensitive comparison | ||
| | |p5= useTextRight: [[Boolean]] - (Optional, default [[false]]) [[true]] to sort by [[lbSetTextRight | text right]] | ||
| | |p6= unicodeOff: [[Boolean]] - (Optional, default [[false]]) [[true]] to switch off UNICODE conversion for faster sorting | ||
|r1= [[Nothing]] | |r1= [[Nothing]] |
Latest revision as of 18:24, 5 May 2022
Description
- Description:
- Sorts given ListBox by either lbText, lbValue or lbData in normal or reversed order, using case-sensitive or case-insensitive comparison. This command supports UNICODE characters. When sorting by "VALUE", the rows with the same lbValue will additionally be sorted by lbText in the order specified by `reversedOrder` flag, text specified by `useTextRight` flag and case-sensitivity specified by `caseSensitive` flag.
- Groups:
- GUI Control - ListBox
Syntax
- Syntax:
- controlOrIDC lbSortBy [sortByType, reversedOrder, caseSensitive, useTextRight, unicodeOff]
- Parameters:
- controlOrIDC: Control or Number - the ListBox control or its IDC
- sortByType: String - (Optional, default "TEXT") one of:
- "TEXT"
- "VALUE"
- "DATA"
- reversedOrder: Boolean - (Optional, default false) true for sorting in reversed order
- caseSensitive: Boolean - (Optional, default false) true for using case-sensitive comparison
- useTextRight: Boolean - (Optional, default false) true to sort by text right
- unicodeOff: Boolean - (Optional, default false) true to switch off UNICODE conversion for faster sorting
- Return Value:
- Nothing
Examples
- Example 1:
- with uiNamespace do { private _lb = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscListBox", -1]; _lb ctrlSetPosition [0,0,1,1]; _lb ctrlCommit 0; lbClear _lb; { _lb lbAdd (_x select 0); _lb lbSetValue [_forEachIndex, _x select 1]; } forEach [["В",1], ["Я",0], ["Б",1], ["Ю",0], ["А",1]]; _lb lbSortBy ["VALUE", false, false]; };
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note