From: Richard K. <ric...@us...> - 2005-07-21 02:38:06
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19599 Modified Files: NSTextField.as Log Message: delay select text if textfield does not exist Index: NSTextField.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTextField.as,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NSTextField.as 20 Jul 2005 18:12:14 -0000 1.12 --- NSTextField.as 21 Jul 2005 02:37:24 -0000 1.13 *************** *** 67,73 **** --- 67,75 ---- private var m_delegate:Object; private var m_notificationCenter:NSNotificationCenter; + private var m_needsToSelectText:Boolean; public function NSTextField() { m_editor = null; + m_needsToSelectText = false; } *************** *** 177,184 **** if (isSelectable() && superview() != null) { if (m_editor == null) { - //ASFieldEditor.resignFirstResponder(); var x = NSTextFieldCell(m_cell).beginEditingWithDelegate(this); m_editor = x; if (m_editor == null) { return; } --- 179,186 ---- if (isSelectable() && superview() != null) { if (m_editor == null) { var x = NSTextFieldCell(m_cell).beginEditingWithDelegate(this); m_editor = x; if (m_editor == null) { + m_needsToSelectText = true; return; } *************** *** 188,191 **** --- 190,201 ---- } + public function drawRect(rect:NSRect) { + super.drawRect(rect); + if (m_needsToSelectText) { + m_needsToSelectText = false; + selectText(this); + } + } + // Working with the responder chain |