lnbSetPicture: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting_Commands_Take_On_Helicopters" to "[[Category:Scripting Commands Take On Helicopters")
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(37 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
|version2= 1.50


|arg= local |Multiplayer Arguments=
|game3= tkoh
|version3= 1.00


|eff= local |Multiplayer Effects=
|game4= arma3
____________________________________________________________________________________________
|version4= 0.50


|  
|gr1= GUI Control - ListNBox
*Sets the picture in the item with the given position of the 2D listbox.
*Name is the picture name.
*The picture is searched in the mission, directory, the dtaExt subdirectory of the campaign directory, and the dtaExt directory and the data bank (or directory). |DESCRIPTION=
____________________________________________________________________________________________


| [[lnbSetPicture]] [IDC, [Row, Column], PicturePathOrPictureName] |SYNTAX=
|descr= Sets the picture in the item with the given position of the 2D listbox.The picture is searched in the mission, directory, the dtaExt subdirectory of the campaign directory, and the dtaExt directory and the data bank (or directory).


| p1= [IDC, [Row, Column], PicturePathOrPictureName]: [[Array]]  |PARAMETER1=
|s1= [[lnbSetPicture]] [idc, [row, column], picturePathOrName]
| p2= IDC: [[Number]] |PARAMETER2=
| p3= Row: [[Number]]  |PARAMETER3=
| p4= Column: [[Number]]  |PARAMETER4=
| p5= PicturePathOrPictureName: [[String]]  |PARAMETER5=


| [[Nothing]] |RETURNVALUE=
|p1= idc: [[Number]]


____________________________________________________________________________________________
|p2= row: [[Number]]


| s2= _ctrl [[lnbSetPicture]] [ [Row([[Number]]), Column([[Number]])], PicturePathOrPictureName([[String]])] |SYNTAX2=
|p3= column: [[Number]]


|p21= _ctrl: [[Control]] |PARAMETER1=
|p4= picturePathOrName: [[String]]


| p22= [ [Row, Column], PicturePathOrPictureName]: [[Array]]  |PARAMETER2=
|r1= [[Nothing]]
| p23= Row: [[Number]]  |PARAMETER3=
| p24= Column: [[Number]]  |PARAMETER4=
| p25= PicturePathOrPictureName: [[String]]  |PARAMETER5=


| r2= [[Nothing]] |RETURNVALUE=
|s2= ctrl [[lnbSetPicture]] [<nowiki/>[row, column], picturePathOrName]


____________________________________________________________________________________________
|p21= ctrl: [[Control]]


|x1= <code>[[lnbSetPicture]] [1, [0, 0], "Picture"];</code>|EXAMPLE1=
|p22= row: [[Number]]


|x2= <code>_ctrl [[lnbSetPicture]] [ [0, 0], "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa"];</code>|EXAMPLE2=
|p23= column: [[Number]]
____________________________________________________________________________________________


| [[lnbAddArray]], [[lnbAddColumn]], [[lnbAddRow]], [[lnbClear]], [[lnbColor]], [[lnbCurSelRow]], [[lnbData]], [[lnbDeleteColumn]], [[lnbDeleteRow]], [[lnbGetColumnsPosition]], [[lnbPicture]], [[lnbSetColor]], [[lnbSetColumnsPos]], [[lnbSetCurSelRow]], [[lnbSetData]], [[lnbSetText]], [[lnbSetValue]], [[lnbSize]], [[lnbText]], [[lnbValue]] |SEEALSO=
|p24= picturePathOrName: [[String]]


| |MPBEHAVIOUR=  
|r2= [[Nothing]]
____________________________________________________________________________________________
 
|x1= <sqf>lnbSetPicture [1, [0, 0], "Picture"];</sqf>
 
|x2= <sqf>_ctrl lnbSetPicture [[0, 0], "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa"];</sqf>
 
|seealso= [[lnbPicture]] [[lnbSetPictureRight]] [[lnbPictureRight]]
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on Sep 9 2014</dd>
<dt></dt>
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt>
<dd class="notedate">Posted on 2021-04-06 - 07:35 (UTC)</dd>
<dd class="note">(A3 1.28)As for invisible data processing, [[lnbAddArray]], [[lnbAddColumn]], [[lnbData]], [[lnbGetColumnsPosition]], [[lnbSetColumnsPos]], [[lnbSetData]], [[lnbSetText]], [[lnbSetValue]], [[lnbText]] and [[lnbValue]] store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax:
<dt class="note">[[User:R3vo|R3vo]]</dt>
<code>
<dd class="note">
//Set same value to one position of a [[Control]]
{{Feature|informative|Adding pictures to lists is very slow. In order to prevent the filling of the list to be slowed down, add the pictures in the '''scheduled''' environment. One drawback of that method is, that sorting the entries is not easily possible.
_ctrl [[lnbSetData]] [ [0,0],"#1"];
<sqf>
[[lnbSetColumnsPos]] [102, [0,1], 1];
private _path = _ctrlTV tvAdd [[], "Some Entry"];
_ctrl [[lnbSetText]] [ [0,1], "#1"];
[_ctrlTV, _path] spawn {
_ctrl [[lnbSetValue]] [ [0,0],1];
(_this select 0) tvSetPictureRight [[_this select 1], "someImage.paa"];
//Accessing the value disregard affecting one another.
_ctrl [[lnbData]] [0,0]; //"#1"
[[lnbGetColumnsPosition]] _ctrl //[1];
_ctrl [[lnbText]] [0,0];//"#1"
_ctrl [[lnbValue]] [0,0];//1
</code>
For a direct visible control over CT_LISTNBOX:
<code>
0 = [_CT_LISTNBOX] [[spawn]] { 
  [[private]] ["_CT_LISTNBOX","_color","_current","_pic"];
  [[disableSerialization]];
  _CT_LISTNBOX = _this [[select]] 0;
  {
_CT_LISTNBOX [[lnbAddRow]] [ [[getText]] (_x >> "displayNameShort"),[[getText]] (_x >> "displayName")];
_CT_LISTNBOX [[lnbSetPicture]] [ [_foreachIndex,0],[[getText]] (_x >> "texture")];
  } [[forEach]] ("[[isClass]] _x" [[configClasses]] ([[configFile]] >> "CfgRanks"));
  _CT_LISTNBOX [[lnbSetCurSelRow]] 0;
  [[Image:WuChaoRen_000.png]]
  _current = [[lnbCurSelRow]] _CT_LISTNBOX;
  _color = _CT_LISTNBOX [[lnbColor]] [_current,0];
  _CT_LISTNBOX [[lnbSetColor]] [ [_current,1], [(_color [[select]] 0)/2,0,0,1] ];
  [[Image:WuChaoRen_001.png]]
  _CT_LISTNBOX [[lnbDeleteColumn]] 0;
  [[Image:WuChaoRen_002.png]]
  _CT_LISTNBOX [[lnbDeleteRow]] 1;
  [[Image:WuChaoRen_003.png]]
  [[sleep]] 1;
  [[lnbClear]] _CT_LISTNBOX;//Clear all items but control still remains just invisible.
};
};
</code>
</sqf>
A combined use of both invisible and visible data processing commands alive the [[Control]].
}}
</dd>


<!-- Note Section END -->
</dl>
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]

Latest revision as of 00:24, 2 February 2024

Hover & click on the images for description

Description

Description:
Sets the picture in the item with the given position of the 2D listbox.The picture is searched in the mission, directory, the dtaExt subdirectory of the campaign directory, and the dtaExt directory and the data bank (or directory).
Groups:
GUI Control - ListNBox

Syntax

Syntax:
lnbSetPicture [idc, [row, column], picturePathOrName]
Parameters:
idc: Number
row: Number
column: Number
picturePathOrName: String
Return Value:
Nothing

Alternative Syntax

Syntax:
ctrl lnbSetPicture [[row, column], picturePathOrName]
Parameters:
ctrl: Control
row: Number
column: Number
picturePathOrName: String
Return Value:
Nothing

Examples

Example 1:
lnbSetPicture [1, [0, 0], "Picture"];
Example 2:
_ctrl lnbSetPicture [[0, 0], "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa"];

Additional Information

See also:
lnbPicture lnbSetPictureRight lnbPictureRight

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 on 2021-04-06 - 07:35 (UTC)
R3vo
Adding pictures to lists is very slow. In order to prevent the filling of the list to be slowed down, add the pictures in the scheduled environment. One drawback of that method is, that sorting the entries is not easily possible.
private _path = _ctrlTV tvAdd [[], "Some Entry"]; [_ctrlTV, _path] spawn { (_this select 0) tvSetPictureRight [[_this select 1], "someImage.paa"]; };