Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.