lbAdd: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <!-- (DIS)?CONTINUE Notes -->" to "") |
m (formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| ofp | |game1= ofp | ||
| | |version1= 1.75 | ||
|game2= ofpe | |||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.51 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|arg= local | |arg= local | ||
Line 11: | Line 35: | ||
|gr1= GUI Control - ListBox | |gr1= GUI Control - ListBox | ||
| Adds an item with the given text to the | |descr= Adds an item with the given text to the [[CT_LISTBOX]] or [[CT_COMBO]]. | ||
|s1= [[lbAdd]] [idc, text] | |||
| [[ | |p1= idc: [[Number]] - Control IDC | ||
|p2= text: [[String]] - Visible text | |||
|p2 | |||
| [[Number]] - row | |r1= [[Number]] - Index (row) of newly added item | ||
|s2= control [[lbAdd]] text | |s2= control [[lbAdd]] text | ||
|p21= control: [[Control]] | |p21= control: [[Control]] | ||
|p22= text: [[String]] | |p22= text: [[String]] | ||
|r2= [[Number]] - row | |r2= [[Number]] - Index (row) of newly added item | ||
|x1= <code>_index = [[lbAdd]] [101, "First item"];</code> | |x1= <code>_index = [[lbAdd]] [101, "First item"];</code> | ||
|x2= <code>_index = _control [[lbAdd]] "First item";</code> | |x2= <code>_index = _control [[lbAdd]] "First item";</code> | ||
|seealso= | |seealso= [[lbDelete]] [[lbText]] | ||
}} | }} | ||
Line 41: | Line 65: | ||
<dd class="note">More information on the [[CT_LISTBOX]] command family can be found [[CT_LISTBOX#Scripting_Example|here]]. | <dd class="note">More information on the [[CT_LISTBOX]] command family can be found [[CT_LISTBOX#Scripting_Example|here]]. | ||
</dl> | </dl> | ||
<dl class="command_description"> | <dl class="command_description"> | ||
Line 55: | Line 73: | ||
This command can be very very frustrating to use because it does not output any errors if unable to function.<br> | 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> | Often, the 2nd provided syntax needs to be used like this:<br> | ||
<code>_giveYourControlAname = | <code>_giveYourControlAname = [[findDisplay]] 7 [[displayCtrl]] 9; | ||
_addThisToListBox = "Option"; | _addThisToListBox = "Option"; | ||
_giveYourControlAname lbAdd _addThisToListBox;</code> | _giveYourControlAname [[lbAdd]] _addThisToListBox;</code> | ||
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> | 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. | The code above will add an option named "Option" to the ListBox or ComboBox. | ||
</dd> | </dd> | ||
</dl> | </dl> |
Revision as of 18:02, 12 April 2021
Description
- Description:
- Adds an item with the given text to the CT_LISTBOX or CT_COMBO.
- 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
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 April 12, 2015 - 11:01 (UTC)
- IT07
-
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:
_giveYourControlAname = findDisplay 7 displayCtrl 9; _addThisToListBox = "Option"; _giveYourControlAname lbAdd _addThisToListBox;
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.
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