<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16945" name=GENERATOR>
<STYLE>
<!--
font-face
        {font-family:"Cambria Math";}
font-face
        {font-family:Calibri;}
font-face
        {font-family:Tahoma;}
font-face
        {font-family:Verdana;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {
        color:purple;
        text-decoration:underline;}
p
        {
        margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {
        font-family:"Calibri","sans-serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {
        font-size:10.0pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV id=idOWAReplyText11949 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>onKillFocus. Great idea - thanks.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B> Fri 08/01/2010 16:05<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Inserting Special Characters<BR></FONT><BR></DIV>
<DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Shouldn’t that be onChange, rather than onChange<B><I>d</I></B>? Maybe getting the TF onKillFocus would be a better choice?</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Paul</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian Tenney<BR><B>Sent:</B> Friday, January 08, 2010 7:53 AM<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Inserting Special Characters</SPAN></P></DIV></DIV>
<P class=MsoNormal> </P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Exactly my thinking:</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">INTERFACE.prototype.trackTextFields = function(){</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> this.onSetFocus = function(){</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> delete this.currentTF.onChanged;</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> this.currentTF = Selection.getFocus();</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> debug("got " + this.currentTF);</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> this.currentTF.onChanged = function(tf){</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> debug("CHANGED");</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> }</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> }</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> Selection.addListener(this);</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">}</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">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.</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<P class=MsoNormal><SPAN lang=EN-GB style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN> </P>
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Dave Burnett<BR><B>Sent:</B> Friday, January 08, 2010 3:51 PM<BR><B>To:</B> Xerte list<BR><B>Subject:</B> RE: [Xerte] Inserting Special Characters</SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><SPAN lang=EN-GB></SPAN> </P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: 0in"><SPAN lang=EN-GB style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Maybe a global func that holds the tf id of the last tf with focus?<BR><BR><pseudo><BR>if object with focus=TF {<BR>last_active = TF ID<BR>}<BR></pseudo><BR><BR><BR>> Date: Fri, 8 Jan 2010 15:27:12 +0000<BR>> From: Julian.Tenney@nottingham.ac.uk<BR>> To: xerte@lists.nottingham.ac.uk<BR>> Subject: [Xerte] Inserting Special Characters<BR>> <BR>> I want to have anumber of buttons insert special characters into a<BR>> textfield. How can I get the textfield that is currently selected when I<BR>> click a button?<BR>> <BR>> If I debug (Selection.getFocus()) after clicking the button, I get - of<BR>> course - the button, as I just selected it by clicking it. How can I<BR>> know the textField that has / did have the caret in it, and the position<BR>> of the caret?<BR>> <BR>> Previously I've done this by having the textfield update some variables<BR>> onChange, but this isn't an option in this case.<BR>> <BR>> J<BR>> _______________________________________________<BR>> Xerte mailing list<BR>> Xerte@lists.nottingham.ac.uk<BR>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte</SPAN></P>
<DIV style="MARGIN-LEFT: 0.5in">
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN lang=EN-GB style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">
<HR align=center width="100%" SIZE=2>
</SPAN></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><SPAN lang=EN-GB style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Hotmail: Trusted email with Microsoft’s powerful SPAM protection. <A href="http://clk.atdmt.com/GBL/go/196390706/direct/01/" target=_new>Sign up now.</A></SPAN></P></DIV></DIV></DIV></BODY></HTML>