display3denCopy – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Eden Editor" to "Eden Editor")
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:A3 display3denCopy.png|thumb|display3denCopy with some example text|500px]]
[[File:A3 display3denCopy.png|thumb|display3denCopy with some example text|500px]]
In [[Eden Editor]], display3denCopy can be accessed to offer the user a way to inspect and copy long texts.  
In [[:Category:Eden Editor|Eden Editor]], display3denCopy can be accessed to offer the user a way to inspect and copy long texts.  
 


== Open the Display ==
== Open the Display ==
The display can be opened in [[Eden Editor]] by executing {{ic|[[findDisplay]] 313 [[createDisplay]] "display3denCopy";}}. While the display is mainly meant to be used inside the Editor it can also be used outside of it. To do so, just replace {{ic|313}} with the IDD of your parent display.


=== Adding Custom Text ===
The display can be opened in [[:Category:Eden Editor|Eden Editor]] by executing <sqf inline>findDisplay 313 createDisplay "display3denCopy";</sqf>. While the display is mainly meant to be used inside the Editor it can also be used outside of it. To do so, just replace {{hl|313}} with the IDD of your parent display.
In order to display some text inside the edit box, one has to define the data. This is done via an [[uiNamespace]] variable like so:
[[uiNamespace]] [[setVariable]] ["display3DENCopy_data", ["Text displayed as header", "Text the user can copy and inspect"]];


==== Adjusting the Control Height ====
Note that the display can also be used outside of [[:Category:Eden Editor|Eden Editor]].
Unfortunately, the display, or rather the code is bugged. You will noticed that for longer texts it will not properly adjust the control's height and therefore scrolling vertically will not work properly ([https://feedback.bistudio.com/T141001 Feedback Tracker Ticket]).
<sqf>(call BIS_fnc_displayMission) createDisplay "display3denCopy";</sqf>


However, this can be fixed like so:
=== Adding Custom Text ===
<code>//Set variable used by display3denCopy and create the display
uinamespace [[setVariable]] ["display3DENCopy_data", [_header, _someLongText]];
[[private]] _display [[a = b|=]] [[findDisplay]] 313 [[createDisplay]] "display3denCopy";


//Get the relevant controls
In order to display some text inside the edit box, one has to define the data. This is done via an [[uiNamespace]] variable like so:
[[private]] _ctrlGroup [[a = b|=]] _display [[displayCtrl]] 201;
<sqf>uiNamespace setVariable ["display3DENCopy_data", ["Text displayed as header", "Text the user can copy and inspect"]];</sqf>
[[private]] _ctrlEdit [[a = b|=]] _display [[displayCtrl]] 202;
[[private]] _ctrlEditFake [[a = b|=]] _display [[displayCtrl]] 203;


//Adjust the height of the edit control properly
_ctrlEdit [[ctrlSetPositionH]] ([[ctrlTextHeight]] _ctrlEdit [[max]] ([[ctrlPosition]] _ctrlGroup [[a hash b|#]] 3));
_ctrlEditFake [[ctrlSetPositionH]] ([[ctrlTextHeight]] _ctrlEditFake [[max]] ([[ctrlPosition]] _ctrlGroup [[a hash b|#]] 3));
_ctrlEdit [[ctrlCommit]] 0;
_ctrlEditFake [[ctrlCommit]] 0;</code>
   
   
[[Category:GUI Topics]]
[[Category:GUI Topics]]
[[Category: Eden Editor: Modding]]
[[Category: Eden Editor: Modding]]

Latest revision as of 14:26, 9 July 2023

display3denCopy with some example text

In Eden Editor, display3denCopy can be accessed to offer the user a way to inspect and copy long texts.


Open the Display

The display can be opened in Eden Editor by executing findDisplay 313 createDisplay "display3denCopy";. While the display is mainly meant to be used inside the Editor it can also be used outside of it. To do so, just replace 313 with the IDD of your parent display.

Note that the display can also be used outside of Eden Editor.

Adding Custom Text

In order to display some text inside the edit box, one has to define the data. This is done via an uiNamespace variable like so:

uiNamespace setVariable ["display3DENCopy_data", ["Text displayed as header", "Text the user can copy and inspect"]];