OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Ext3rmin4tor on 03 Jun 2010, 13:09:15

Title: Structured Text
Post by: Ext3rmin4tor on 03 Jun 2010, 13:09:15
I have two structured text inside a dialog:

Code: [Select]
class StructuredText
{
idc = -1;
type = CT_STRUCTURED_TEXT; // defined constant
style = ST_LEFT; // defined constant
size = 0.018;
colorBackground[] = { 1, 1, 1, 1 };
class Attributes
{
font = FontM;
color = "#000000";
align = "center";
valign = "middle";
shadow = false;
shadowColor = "#ff0000";
size = "1";
};
};


// this two classes inherit the first one and are inside the main dialog control class
class Hint : StructuredText
  {
idc = 300;
style = ST_CENTER;
x = 0.25;
y = 0.75;
w = 0.9;
h = 0.1;
text = "";
  };

  class Description : StructuredText
  {
idc = 301;
style = ST_CENTER;
x = 0.25;
y = 0.47;
w = 0.7;
h = 0.4;
text = "";

  };
(the code is not complete)

I want to set the text for both the control so i should use setStructuredText. The problem is that I usually use dialog control commands that use dialog idc to refer the dialog itself, but this one uses a new variable type introduce with ArmA called "Control".

How do I refer to my two structured text definitions in order to change their text with a Control variable type? Basically I want to change the text of those controls.
Title: Re: Structured Text
Post by: ModestNovice on 05 Jun 2010, 01:02:40
I'm not really sure what you are talking about. But I think to change text use this:
Code: [Select]
((findDisplay DLG_IDD) displayCtrl 300) ctrlSetStructuredText "This is my text.";

Obviously change DLG_IDD to the number you are using as the idd of your dialog.
Title: Re: Structured Text
Post by: Ext3rmin4tor on 05 Jun 2010, 12:38:48
Thanks, That's exactly what I needed
Title: Re: Structured Text
Post by: ModestNovice on 05 Jun 2010, 20:08:04
No problem, happy to help :).