Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Buttons taking the focus (https://forums.graalonline.com/forums/showthread.php?t=78082)

coreys 12-26-2007 10:55 PM

Buttons taking the focus
 
I can't seem to figure out how to make GuiButtonCtrl's not take the focus. Whenever you login or when the script is updated on my main gui the buttons take the focus, forcing you to spam your keyboard with tab and arrow keys to be able to talk again. I've tried everything I could think of. I've set the profiles to have cankeyfocus=false, I've tried makeFirstResponder(), both true and false, and I've tried closequery=true.

Any suggestions?

And, on a rather unrelated note, is there a way to use the players gui style for gui controls?

Inverness 12-26-2007 11:46 PM

Try GraalControl.makefirstresponder(true);

coreys 12-27-2007 12:40 AM

Quote:

Originally Posted by Inverness (Post 1366025)
Try GraalControl.makefirstresponder(true);

I did :(

cbk1994 12-27-2007 12:49 AM

PHP Code:

if ( x.isFirstResponder() )
{
  
GraalControl.makeFirstRespondertrue );


Something like this in a timeout? Poor optimization, but may work in a system script where there is already a timeout.

coreys 12-27-2007 01:24 AM

Ah, I did something similar to that and it worked, thanks.

But, yeah, I don't suppose it's possible to read the players current gui style and use it in GUI Controls, is it?

Inverness 12-27-2007 02:57 AM

GuiControlObject.style = $pref::video::defaultguistyle;

If its not done automatically, which it should be unless style == ""

zokemon 12-27-2007 04:58 AM

The button profiles need to have the following (either with useownprofile = true or having profile = a profile with these):
PHP Code:

profile.tab false;
profile.cankeyfocus false

I actually just modify GuiButtonProfile with those as I believe it to be one of the most annoying features on Graal and should be off by default...

napo_p2p 12-27-2007 05:00 AM

I found that when the Graal taskbar is hidden, then there are much less problems with gui controls taking focus. Not sure if that is an issue with the client or not.

Admins 01-02-2008 12:57 PM

Normally you just set

PHP Code:

useownprofile true;
profile.modal false

The button cannot be clicked then though. You can also set some other attributes:
PHP Code:

profile.focusonshow false;
profile.tab false;
profile.cankeyfocus false

You can also unset the focus when your button receives the focus:
PHP Code:

function onFirstResponderChanges(obj) {
  if (
obj==MyButton && obj.isFirstResponder())
    
GraalControl.makeFirstResponder(true);



Chompy 01-02-2008 03:33 PM

Quote:

Originally Posted by Stefan (Post 1367596)
Normally you just set

PHP Code:

useownprofile true;
profile.modal false

The button cannot be clicked then though. You can also set some other attributes:
PHP Code:

profile.focusonshow false;
profile.tab false;
profile.cankeyfocus false

You can also unset the focus when your button receives the focus:
PHP Code:

function onFirstResponderChanges(obj) {
  if (
obj==MyButton && obj.isFirstResponder())
    
GraalControl.makeFirstResponder(true);



Very nice Stefan :p That Fixed some stuff on my server :D! <3


All times are GMT +2. The time now is 01:26 AM.

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