ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   EditBox control (https://www.esoui.com/forums/showthread.php?t=1329)

Nabren 05/02/14 11:21 AM

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>


Seerah 05/02/14 12:44 PM

Are you sure your edibox isn't there? Perhaps you just need a background for it.

Nabren 05/02/14 12:57 PM

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?

Seerah 05/02/14 01:28 PM

Did you enable the mouse for your control?

Nabren 05/04/14 08:38 PM

Quote:

Originally Posted by Seerah (Post 6735)
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.

Nabren 05/11/14 11:03 AM

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!

Aicam 05/11/14 12:05 PM

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.

Nabren 05/11/14 04:42 PM

Quote:

Originally Posted by Aicam (Post 7495)
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!

Aicam 05/12/14 03:52 AM

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.

rp12439_3 07/12/21 12:22 PM

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>



All times are GMT -6. The time now is 05:00 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI