BIS fnc initListNBoxSorting: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: GUI(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
(Added documentation) |
||
Line 4: | Line 4: | ||
| arma3 |Game name= | | arma3 |Game name= | ||
|1. | |1.56|Game version= | ||
|gr1= GUI |GROUP1= | |gr1= GUI |GROUP1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| < | | Automcatically creates buttons and sets them up so they can be used to sort a [[CT_LISTNBOX]]. The buttons will automatically be resized to the column width of given <tt>controlFilter</tt>. | ||
{{Informative| | |||
* '''controlFilter''' | |||
< | ** x, y, w and h define where the buttons for sorting are created | ||
** It should be placed above the <tt>controlFilter</tt> | |||
** The amount of columns and their size should be identical with the onces of <tt>controlFilter</tt>. | |||
** The text set in the columns is displayed as text for the buttons (The buttons are transparent actually). Icons which indicate how the list is currently sorted are also adjusted when the button is pressed. | |||
** If a column of <tt>controlContent</tt> is supposed to be sorted by '''value''' instead of '''data''' (default), then something needs to be set in the data of corresponding <tt>controlFilter</tt> column | |||
** The control can also be part of a [[CT_CONTROLS_GROUP]], if that's the case, the buttons will be created as children of that group | |||
** To keep a uniform style between vanilla controls and custom ones it's advisable to create a background with [[CT_STATIC]] behind the <tt>controlFiilter</tt> with </tt>colorBackground[] {{=}} {0,0,0,1};</tt>}} | |||
[[Image:A3_BIS_fnc_initListNBoxSorting_example.jpg|400px|thumb|center|Example GUI using this function]] | |||
|Description= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [controlFilter, controlContent, columnIndexes, idc] call [[BIS_fnc_initListNBoxSorting]] |Syntax= | ||
|p1= | | |p1= controlFilter: [[Control]] - Dummy [[CT_LISTNBOX]] control used for setting up the filter. If parameter is [[controlNull]] function will show an error message.|PARAMETER1= | ||
| |Return value= | |p2= controlContent: [[Control]] - The [[CT_LISTNBOX]] which actually contains the content. If parameter is [[controlNull]] function will show an error message. |PARAMETER2= | ||
|p3= columnIndexes: [[Array]] - Array of [[Number|numbers]]. These are the indexes of the <tt>controlContent</tt> which should be filterable/sortable |PARAMETER3= | |||
|p4= idc: [[Number]] - (Optional, default 200) Will be used to assign idcs to the buttons which are automatically created. First button has <tt>idc</tt>, second button <tt>idc + 1</tt> and so on |PARAMETER4= | |||
| [[Boolean]] - [[True]] on success, otherwise [[false]] |Return value= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code></code> |Example 1= | |x1= <code>[_lnbFilter, _lnbContent, [0,1,2,3]] [[call]] [[BIS_fnc_initListNBoxSorting]];</code> |Example 1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |See also= | | [[BIS_fnc_initSliderValue]] |See also= | ||
}} | }} | ||
Revision as of 18:03, 28 November 2020
Description
- Description:
- Automcatically creates buttons and sets them up so they can be used to sort a CT_LISTNBOX. The buttons will automatically be resized to the column width of given controlFilter.
- Execution:
- call
- Groups:
- GUI
Syntax
- Syntax:
- [controlFilter, controlContent, columnIndexes, idc] call BIS_fnc_initListNBoxSorting
- Parameters:
- controlFilter: Control - Dummy CT_LISTNBOX control used for setting up the filter. If parameter is controlNull function will show an error message.
- controlContent: Control - The CT_LISTNBOX which actually contains the content. If parameter is controlNull function will show an error message.
- columnIndexes: Array - Array of numbers. These are the indexes of the controlContent which should be filterable/sortable
- idc: Number - (Optional, default 200) Will be used to assign idcs to the buttons which are automatically created. First button has idc, second button idc + 1 and so on
- Return Value:
- Boolean - True on success, otherwise false
Examples
- Example 1:
[_lnbFilter, _lnbContent, [0,1,2,3]] call BIS_fnc_initListNBoxSorting;
Additional Information
- See also:
- BIS_fnc_initSliderValue
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