View Single Post
  #7  
Old 07-27-2011, 04:15 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Hezzy002 View Post
PHP Code:
temp.lastFocus GraalControl;
for (
GraalControl.controls) {
  if (
c.isFirstResponder()) {
    
temp.lastFocus c;
    break;
  }
}

//Create GUIControl

temp.lastFocus.makeFirstResponder(true); 
I figured that would be a better way. Is that more reliable (i.e. works with chatbar and other GUIControls), or can more than one object return true from isFirstResponder()?
That would only check the first children of GraalControl, so, for example, a button inside a window would not be checked.

If it's absolutely necessary, I'd do something like this.

PHP Code:
function onFirstResponderChanges(temp.obj) {
  if (
temp.obj.dontStealFocus) {
    
this.lastResponder.makeFirstResponder(true);
  } else {
    
this.lastResponder temp.obj;
  }

Then you could just set dontStealFocus on any GUI control and it wouldn't steal focus.
__________________
Reply With Quote