ctrlDelete: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(warning about deleting controls in a UIEH)
 
(47 intermediate revisions by 5 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
____________________________________________________________________________________________


| Deletes given control.
|descr= Deletes given control. The control has to be created either by script with [[ctrlCreate]] or to have {{hl|deletable}} property in config set to 1. Use [[ctrlShow]] [[false]] and [[ctrlEnable]] [[false]] to disable controls that cannot be deleted. Returns [[Boolean]] indicating  whether the deletion was successful.
<br>Returns whether the deletion was successful. |= Description
{{Feature|warning|Using [[ctrlDelete]] in a [[User_Interface_Event_Handlers|UI eventhandler]] called by the to be deleted control will crash the game! This also happens when a controls group is deleted that contains the "calling" control.}}
____________________________________________________________________________________________


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


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


| [[Boolean]]|RETURNVALUE=
|r1= [[Boolean]]


|x1= <sqf>ctrlDelete ((findDisplay 20000) displayCtrl 20001);</sqf>


|x1= <code>[[ctrlDelete]] (([[findDisplay]] 20000) [[displayCtrl]] 20001);</code>|EXAMPLE1=
|seealso= [[ctrlCreate]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlPosition]] [[ctrlSetPosition]] [[ctrlClassName]] [[displayCtrl]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
 
____________________________________________________________________________________________
 
| [[ctrlCreate]], [[ctrlModel]], [[ctrlSetModel]], [[ctrlPosition]], [[ctrlSetPosition]], [[ctrlClassName]], [[displayCtrl]], [[ctrlModelScale]], [[ctrlSetModelScale]], [[ctrlModelDirAndUp]], [[ctrlSetModelDirAndUp]] |SEEALSO=
 
|  |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}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on April 18, 2015 - 11:08 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
[[ctrlDelete]] can only delete controls created with [[ctrlCreate]]. Use [[ctrlShow]] [[false]] and [[ctrlEnable]] [[false]] to disable existing controls.
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on June 15, 2018 - 20:27 (UTC)</dd>
<dt class="note">[[User:7erra|7erra]]</dt>
<dd class="note">
ctrlDelete can indeed delete already existing controls. Though deletable = 1; has to be defined in the controls class
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 20:30, 5 February 2023

Hover & click on the images for description

Description

Description:
Deletes given control. The control has to be created either by script with ctrlCreate or to have deletable property in config set to 1. Use ctrlShow false and ctrlEnable false to disable controls that cannot be deleted. Returns Boolean indicating whether the deletion was successful.
Using ctrlDelete in a UI eventhandler called by the to be deleted control will crash the game! This also happens when a controls group is deleted that contains the "calling" control.
Groups:
GUI Control

Syntax

Syntax:
ctrlDelete control
Parameters:
control: Control
Return Value:
Boolean

Examples

Example 1:
ctrlDelete ((findDisplay 20000) displayCtrl 20001);

Additional Information

See also:
ctrlCreate ctrlModel ctrlSetModel ctrlPosition ctrlSetPosition ctrlClassName displayCtrl 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