lbAdd: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>") |
||
(92 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | |||
|game1= ofp | |||
|version1= 1.75 | |||
|game2= ofpe | |||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.50 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|arg= local | |||
|eff= local | |||
|gr1= GUI Control - ListBox | |||
|descr= Adds an item with the given text to the [[CT_LISTBOX]] or [[CT_COMBO]] or [[CT_TOOLBOX]]. | |||
_index = | {{Feature|informative| If using {{hl|RscToolBox}} as template with [[ctrlCreate]], clear it first with [[lbClear]]}} | ||
|s1= [[lbAdd]] [idc, text] | |||
|p1= idc: [[Number]] - control IDC | |||
|p2= text: [[String]] - visible text | |||
|r1= [[Number]] - index (row) of newly added item | |||
|s2= control [[lbAdd]] text | |||
|p21= control: [[Control]] | |||
|p22= text: [[String]] | |||
|r2= [[Number]] - index (row) of newly added item | |||
|x1= <sqf>_index = lbAdd [101, "First item"];</sqf> | |||
|x2= <sqf>_index = _control lbAdd "First item";</sqf> | |||
|seealso= [[lbDelete]] [[lbText]] | |||
}} | |||
<dl class="command_description"> | |||
<dt></dt> | |||
<dd class="notedate">Posted: Sep 10 2014</dd> | |||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt> | |||
<dd class="note">More information on the [[CT_LISTBOX]] command family can be found [[CT_LISTBOX#Scripting_Example|here]]. | |||
<dt></dt> | |||
<dd class="notedate">Posted on 2015-04-12 - 11:01 (UTC)</dd> | |||
<dt class="note">[[User:Nelis75733126|Nelis75733126]]</dt> | |||
<dd class="note"> | |||
This command can be very very frustrating to use because it does not output any errors if unable to function.<br> | |||
Often, the 2nd provided syntax needs to be used like this:<br> | |||
<sqf> | |||
_giveYourControlAname = findDisplay 7 displayCtrl 9; | |||
_addThisToListBox = "Option"; | |||
_giveYourControlAname lbAdd _addThisToListBox; | |||
</sqf> | |||
Where "7" is the "idd" of the dialog you made in your ".hpp" file and where "9" is the "idc" of the RscListBox or RscComboBox.<br> | |||
The code above will add an option named "Option" to the ListBox or ComboBox. | |||
</dd> | |||
</dl> |
Latest revision as of 11:34, 3 September 2024
Description
- Description:
- Adds an item with the given text to the CT_LISTBOX or CT_COMBO or CT_TOOLBOX.
- Groups:
- GUI Control - ListBox
Syntax
- Syntax:
- lbAdd [idc, text]
- Parameters:
- idc: Number - control IDC
- text: String - visible text
- Return Value:
- Number - index (row) of newly added item
Alternative Syntax
- Syntax:
- control lbAdd text
- Parameters:
- control: Control
- text: String
- Return Value:
- Number - index (row) of newly added item
Examples
- Example 1:
- Example 2:
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
- Posted: Sep 10 2014
- ffur2007slx2_5
- More information on the CT_LISTBOX command family can be found here.
- Posted on 2015-04-12 - 11:01 (UTC)
- Nelis75733126
-
This command can be very very frustrating to use because it does not output any errors if unable to function.
Often, the 2nd provided syntax needs to be used like this:
Where "7" is the "idd" of the dialog you made in your ".hpp" file and where "9" is the "idc" of the RscListBox or RscComboBox._giveYourControlAname = findDisplay 7 displayCtrl 9; _addThisToListBox = "Option"; _giveYourControlAname lbAdd _addThisToListBox;
The code above will add an option named "Option" to the ListBox or ComboBox.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.75
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: GUI Control - ListBox
- Scripting Commands: Local Effect