ctrlClassName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 104207 by killzone_kid on 2017-08-14T14:27:44Z)
m (Some wiki formatting)
 
(55 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 1.26


|1.26|= Game version
|gr1= GUI Control
____________________________________________________________________________________________


| Returns the class name of a [[Control]] as it is defined in config. If you need config class of a game created [[Display]], it is stored on display itself:
|descr= Returns the class name of a [[Control]] as it is defined in config. If you need config class of a game created [[Display]], it is stored on display itself:
<code>_className <nowiki>=</nowiki> [[findDisplay]] 12 [[getVariable]] ["BIS_fnc_initDisplay_configClass", ""]; // "RscDiary"</code> |= Description
<sqf>_className = findDisplay 12 getVariable ["BIS_fnc_initDisplay_configClass", ""]; // "RscDiary"</sqf>
____________________________________________________________________________________________


| '''ctrlClassName''' control |= Syntax
|s1= [[ctrlClassName]] control


|p1= control : [[Control]] |= PARAMETER1
|p1= control : [[Control]]


| [[String]] - class name|= RETURNVALUE
|r1= [[String]] - class name


|x1= List class names of all controls present on display 46:
<sqf>
_return = [];
{
_return pushBack format ["IDC: %1, className: %2", ctrlIDC _x, ctrlClassName _x];
} forEach (allControls findDisplay 46);


|x1= List class names of all controls present on display 46:<code>_ctrls = "";
copyToClipboard (_return joinString endl);
[[for]] "_i" [[from]] -1 [[to]] 10000 [[do]] {
</sqf>
[[with]] [[uiNamespace]] [[do]] {
_ctrl = [[findDisplay]] 46 [[displayCtrl]] _i;
[[if]] (![[isNull]] _ctrl) [[then]] {
_ctrls = _ctrls + [[format]] ["IDC: %1, Class Name: %2\n", _i, [[ctrlClassName]] _ctrl];
};
};
};
[[hint]] _ctrls;</code>|= EXAMPLE1
____________________________________________________________________________________________


| [[ctrlIDC]], [[ctrlIDD]], [[ctrlType]], [[ctrlCreate]], [[ctrlDelete]], [[ctrlModel]], [[ctrlSetModel]], [[ctrlPosition]], [[ctrlSetPosition]], [[ctrlModelScale]], [[ctrlSetModelScale]], [[ctrlModelDirAndUp]], [[ctrlSetModelDirAndUp]] |= SEEALSO
|seealso= [[ctrlIDC]] [[ctrlIDD]] [[ctrlType]] [[ctrlCreate]] [[ctrlDelete]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlPosition]] [[ctrlSetPosition]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]

Latest revision as of 13:30, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns the class name of a Control as it is defined in config. If you need config class of a game created Display, it is stored on display itself:
_className = findDisplay 12 getVariable ["BIS_fnc_initDisplay_configClass", ""]; // "RscDiary"
Groups:
GUI Control

Syntax

Syntax:
ctrlClassName control
Parameters:
control : Control
Return Value:
String - class name

Examples

Example 1:
List class names of all controls present on display 46:
_return = []; { _return pushBack format ["IDC: %1, className: %2", ctrlIDC _x, ctrlClassName _x]; } forEach (allControls findDisplay 46); copyToClipboard (_return joinString endl);

Additional Information

See also:
ctrlIDC ctrlIDD ctrlType ctrlCreate ctrlDelete ctrlModel ctrlSetModel ctrlPosition ctrlSetPosition ctrlModelScale ctrlSetModelScale ctrlModelDirAndUp ctrlSetModelDirAndUp

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