Thread Tools Display Modes
05/02/14, 11:21 AM   #1
Nabren
Join Date: Feb 2014
Posts: 7
EditBox control

I seem to be having problems getting an EditBox control to show up when defined in XML. Has anyone successfully done this? Everything else in the control is visible and usable.

EDIT:

Here is how I am trying to define it atm:

Code:
<EditBox name="$(parent)Text" editEnabled="true" font="ZoFontWindowSubtitle" color="CFDCBD" textType="TEXT_TYPE_ALL" multiLine="false" newLineEnabled="false" maxInputCharacters="20000">
    <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Info" />
    <Dimensions x="400" y="90" />
</EditBox>

Last edited by Nabren : 05/02/14 at 12:05 PM.
  Reply With Quote
05/02/14, 12:44 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Are you sure your edibox isn't there? Perhaps you just need a background for it.
  Reply With Quote
05/02/14, 12:57 PM   #3
Nabren
Join Date: Feb 2014
Posts: 7
I made a background in the parent control. I can't click on it and type anything and any controls that are positioned below the EditBox aren't anchoring right.

EDIT: Okay, looks like I might have been anchoring it wrong. It looks like it is there now (things position around it correctly) but I can't seem to click inside to get a cursor and start typing. Any ideas?

Last edited by Nabren : 05/02/14 at 01:08 PM.
  Reply With Quote
05/02/14, 01:28 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Did you enable the mouse for your control?
  Reply With Quote
05/04/14, 08:38 PM   #5
Nabren
Join Date: Feb 2014
Posts: 7
Originally Posted by Seerah View Post
Did you enable the mouse for your control?
Yes. For more clarity, here is a simplified version of the whole control and even this I can't enter text in:

Code:
<TopLevelControl name="EditBoxSample" mouseEnabled="true">
    <Dimensions x="400" y="140" />
    <Anchor point="CENTER" />
    <Controls>
        <Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" mouseEnabled="false" />
        <Label name="$(parent)Info" font="ZoFontWindowSubtitle" color="CFDCBD" wrapMode="ELLIPSIS" text="Enter text below:" mouseEnabled="false">
            <Dimensions x="400" y="30" />
            <Anchor />
        </Label>
        <EditBox name="$(parent)Text" mouseEnabled="true" keyboardEnabled="true" editEnabled="true" font="ZoFontWindowSubtitle" color="CFDCBD" 
                 textType="TEXT_TYPE_ALL" multiLine="false" newLineEnabled="false" maxInputCharacters="20000" text="Enter text here">
            <Dimensions x="400" y="90" />
            <Anchor point="TOPLEFT" relativeTo="$(parent)Info" relativePoint="BOTTOMLEFT" />
            <Controls>
                <Backdrop name="$(parent)TextBG" centerColor="000000" edgeColor="AAAAAA">
                    <AnchorFill />
                    <Edge edgeSize="2" />
                </Backdrop>
            </Controls>
        </EditBox>
    </Controls>
</TopLevelControl>
For some reason I can't click inside to get a beam or type anything. Although, a weird bug is that sometimes my keyboard will completely stop working inside ESO, almost like a text box does have focus, but looking anywhere on the screen I don't see what I am typing actually showing up anywhere, this isn't always repeatable.
  Reply With Quote
05/11/14, 11:03 AM   #6
Nabren
Join Date: Feb 2014
Posts: 7
Has anyone successfully defined an EditBox control in XML? About to just give up and try in lua, but would really prefer the XML approach unless its bugged/impossible.

On that note, if anyone gets bored and can try the XML above and let me know if you see the same thing as me that would be awesome as well!
  Reply With Quote
05/11/14, 12:05 PM   #7
Aicam
Join Date: Apr 2014
Posts: 16
You need to tell the edit box when it should get focus. The following should be the normal behaviour of an edit box.
Code:
<OnMouseDown>
    self:TakeFocus()
</OnMouseDown>
<OnEnter>
    self:LoseFocus()
</OnEnter>
<OnEscape>
    self:LoseFocus()
</OnEscape>
I don't think the text attribute works and most of the others should be the default values.
  Reply With Quote
05/11/14, 04:42 PM   #8
Nabren
Join Date: Feb 2014
Posts: 7
Originally Posted by Aicam View Post
You need to tell the edit box when it should get focus. The following should be the normal behaviour of an edit box.
Code:
<OnMouseDown>
    self:TakeFocus()
</OnMouseDown>
<OnEnter>
    self:LoseFocus()
</OnEnter>
<OnEscape>
    self:LoseFocus()
</OnEscape>
I don't think the text attribute works and most of the others should be the default values.
That was it! Thank you. The focus still seems to get stuck, even after pressing escape or enter, the focus is properly lost on the EditBox control, but doesn't seem to be properly restored to the game. After the edit box gains focus, no matter how it loses focus, I have to end task because the keyboard fails to work. I can't even press escape to open the main game menu or get a mouse cursor to reload UI at that point.

Am I supposed to set the focus back to a different object so the character can continue to move, etc? Seems weird that an add-on can break the game that badly.

Regardless, this has definitely set me on the right path, I appreciate it!
  Reply With Quote
05/12/14, 03:52 AM   #9
Aicam
Join Date: Apr 2014
Posts: 16
inheriting from ZO_DefaultTextEdit might help with strange behaviour, if not some your attributes are the most likely culprit of that issue. i can't test it right now.
  Reply With Quote
07/12/21, 12:22 PM   #10
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
because I found it in my search after "Editbox"

This seams to work pretty good:

Code:
<Backdrop name="$(parent)ThresholdAmountBG" tier="HIGH" inherits="ZO_SingleLineEditBackdrop_Keyboard">
                    <Dimensions x="100" />
                    <Anchor point="TOPLEFT" relativeTo="$(parent)ItemLink" relativePoint="BOTTOMLEFT" offsetY="10" />
                    <Controls>
                        <EditBox name="$(parent)ThresholdAmount" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" />
                    </Controls>
                </Backdrop>
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » EditBox control

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off