[Xerte] Re: desktop - text entry cursor being shy

Paul Swanson Paul.Swanson at harlandfs.com
Tue Feb 26 19:35:41 GMT 2013

I notice that when you first get to the page, you've got:

teicon.txt.text = "";

But on the return you have:

teicon.txt.text = prevtext;

Should it be setFocus(teicon.txt); ?

Paul Swanson
Internal Business Systems Analyst
Internal Business Intelligence
Harland Financial Solutions
(800) 274-7280 Ext. 2462
Paul.Swanson at harlandfs.com

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Tuesday, February 26, 2013 10:22 AM
To: Xerte list
Subject: [Xerte] desktop - text entry cursor being shy

I am setting up a text entry on a text icon:

teicon.txt.autoSize = 0;
teicon.txt._height = 26;
teicon.txt._width = 263;
//teicon.txt.border = 1;
teicon.txt.type = "input";
teicon.txt.selectable = 1;
teicon.txt.multiline = 0;
myTF = new TextFormat();
//myTF.font = "Arial";
myTF.font = "Arial Bold";
myTF.size = 16;
teicon.txt.text = "";

When this executes, the cursor appears as expected at index 0 and the user starts typing.

A "show answers" routine may pull the focus from that while text is being input (the cursor is in the box).

So I store the existing text and clear the box

prevtext = teicon.txt.text;
teicon.txt.text = "";

Then the user comes back from the subroutine, I set it back up:

teicon.txt.text = prevtext;
//Selection.setFocus(teicon); //tried this as well

Which fills the text entry back up, and even accepts keys if I start typing.
But no cursor.
I need to click the mouse back in the box to get a cursor there again.

Setting the focus puts the cursor there initially, but not the second time around.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20130226/53826442/attachment-0001.html>

More information about the Xerte mailing list