[Xerte] Inserting Special Characters
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Mon Jan 11 09:32:41 GMT 2010
Great idea. But it doesn't fire until AFTER the textfield loses focus,
so it's no good.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Saturday, January 09, 2010 9:59 PM
To: Xerte discussion list
Subject: RE: [Xerte] Inserting Special Characters
onKillFocus. Great idea - thanks.
________________________________
From: xerte-bounces at lists.nottingham.ac.uk on behalf of Paul Swanson
Sent: Fri 08/01/2010 16:05
To: Xerte discussion list
Subject: RE: [Xerte] Inserting Special Characters
Shouldn't that be onChange, rather than onChanged? Maybe getting the TF
onKillFocus would be a better choice?
Paul
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Friday, January 08, 2010 7:53 AM
To: Xerte discussion list
Subject: RE: [Xerte] Inserting Special Characters
Exactly my thinking:
INTERFACE.prototype.trackTextFields = function(){
this.onSetFocus = function(){
delete this.currentTF.onChanged;
this.currentTF = Selection.getFocus();
debug("got " + this.currentTF);
this.currentTF.onChanged = function(tf){
debug("CHANGED");
}
}
Selection.addListener(this);
}
So I enable it by calling rootIcon.trackTextFields; I see the debug as
the focus changes, but I am not seeing the change handler fire - WTF? I
need to know the current TF AND the position of the caret, so that when
I click my special char insert button, I know where to put it.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Friday, January 08, 2010 3:51 PM
To: Xerte list
Subject: RE: [Xerte] Inserting Special Characters
Maybe a global func that holds the tf id of the last tf with focus?
<pseudo>
if object with focus=TF {
last_active = TF ID
}
</pseudo>
> Date: Fri, 8 Jan 2010 15:27:12 +0000
> From: Julian.Tenney at nottingham.ac.uk
> To: xerte at lists.nottingham.ac.uk
> Subject: [Xerte] Inserting Special Characters
>
> I want to have anumber of buttons insert special characters into a
> textfield. How can I get the textfield that is currently selected when
I
> click a button?
>
> If I debug (Selection.getFocus()) after clicking the button, I get -
of
> course - the button, as I just selected it by clicking it. How can I
> know the textField that has / did have the caret in it, and the
position
> of the caret?
>
> Previously I've done this by having the textfield update some
variables
> onChange, but this isn't an option in this case.
>
> J
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
________________________________
Hotmail: Trusted email with Microsoft's powerful SPAM protection. Sign
up now. <http://clk.atdmt.com/GBL/go/196390706/direct/01/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100111/655fda74/attachment.html
More information about the Xerte
mailing list