Game Development Community

GUI TextEdit Ctrl question

by Stefan Beffy Moises · in Torque Game Engine · 05/26/2002 (1:22 am) · 8 replies

I'm looking for a multiple line text edit control, like a textarea in HTML, where you can input a quite long text, use return to go to the next line etc., but all the available GUI text objects seem to be only one-line or not editable at all...
is there something similar available or do I have to write my own?

#1
05/26/2002 (3:15 am)
GuiMLTextEditCtrl
#2
05/26/2002 (6:43 am)
I thought I tried that... but it seems I've only tried the GuiMLText Profile for a GuiTextEdit control ...

Anyhow, the GuiMLTextEditCtrl would be great, if I could resize it!! This little sucka always keeps a height of 480, no matter what I'm doing - even changing it manually in the script... it always resizes itself to 480... did anybody try this ctrl and has it working correctly??
Thanks!
#3
05/26/2002 (11:21 pm)
Problem solved... if anybody's interested: this control is always resizing to it's parent GUI size... so you need another control (probably a scroll control) containing it, e.g.
new GuiScrollCtrl(ML_DIALOGUE_SCROLL) {
      profile = "GuiScrollProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "188 344";
      extent = "427 113";
      minExtent = "8 8";
      visible = "1";
      helpTag = "0";
      willFirstRespond = "1";
      hScrollBar = "alwaysOn";
      vScrollBar = "alwaysOn";
      constantThumbHeight = "0";
      childMargin = "0 0";

      new GuiMLTextEditCtrl(ML_DIALOGUE_TEXT) {
         profile = "GuiTextEditProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "2 2";
         extent = "403 113";
         minExtent = "8 8";
         visible = "1";
         helpTag = "0";
         lineSpacing = "2";
         allowColorChars = "0";
         maxChars = "-1";
      };
   };
Cheers!
#4
05/28/2002 (8:35 pm)
Were you pushing it directly onto the Canvas? Anything contained by the canvas does get resized to fit the canvas... (which may in turn cause its children to be resized, etc.).
#5
05/28/2002 (10:30 pm)
Yep, that's what I did ... stupid me... ;-)
#6
03/22/2008 (3:25 pm)
Thank you for posting this! I was having a similar problem!
#7
12/18/2008 (3:29 pm)
Folks interested in the GuiMLTextEditCtrl might be interested in this as-yet-unapproved resource, which makes several significant improvements to it.
#8
12/29/2008 (9:24 pm)
Orion, you rock. Any improvement to GuiMLTextEditCtrl makes me happy.