Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GUI *blocking* (https://forums.graalonline.com/forums/showthread.php?t=66758)

xXziroXx 06-19-2006 07:06 PM

GUI *blocking*
 
How can you make it so GUIs doesnt *block* - meaning that if a GUI is showed you have to click outside of it to be able to move etc.

ApothiX 06-19-2006 07:57 PM

GraalControl.makefirstresponder() after you create the window works, I think.

xXziroXx 06-19-2006 08:14 PM

Didnt work.. Tried putting it IN "new control blah", tried putting it after - also tried in a timeout.

Yen 06-19-2006 09:35 PM

GraalControl.BringToFront();

I don't remember off hand if you there's a 'focused' variable in the GUI controls.. Otherwise, just make it so that if the GUI window is clicked it brings GraalControl to the front.

ApothiX 06-20-2006 12:12 AM

Quote:

Originally Posted by xXziroXx
Didnt work.. Tried putting it IN "new control blah", tried putting it after - also tried in a timeout.

I think there's more to the syntax, I was just giving you the function name.
Try: GraalControl.makefirstresponder(true);
or if that doesn't work, NameOfYourWindow.makefirstresponder(false);

Quote:

Originally Posted by Yen
I don't remember off hand if you there's a 'focused' variable in the GUI controls.. Otherwise, just make it so that if the GUI window is clicked it brings GraalControl to the front.

ControlName.isfirstresponder(); will tell you if it's focused or not.

xXziroXx 06-20-2006 04:38 PM

Got it to work:

PHP Code:

new GuiWindowCtrl("guiname") {
  
// stuff
}
guiname.makefirstresponder(false); 

And Yen, you are wrong with bringtofront()! bringtofront brings a GUI on top of all other GUIs, and vice versa with pushtoback().

ApothiX 06-20-2006 05:44 PM

Quote:

Originally Posted by xXziroXx
Got it to work:

PHP Code:

new GuiWindowCtrl("guiname") {
  
// stuff
}
guiname.makefirstresponder(false); 

And Yen, you are wrong with bringtofront()! bringtofront brings a GUI on top of all other GUIs, and vice versa with pushtoback().

Hence the reason he suggested to use bringtofront() with the GraalControl.

Yen 06-20-2006 05:58 PM

Quote:

Originally Posted by xXziroXx
And Yen, you are wrong with bringtofront()! bringtofront brings a GUI on top of all other GUIs, and vice versa with pushtoback().

O_o
I use 'pushtoback()' to take focus off my GUIs when I create them..

Warcaptain 06-23-2006 06:57 AM

You can also do:
PHP Code:

function OBJ.onMouseDown()  GraalControl.showtop(); 

or also (to make it universal) could put this in the GUI creation:

PHP Code:

obj = new GuiWindowCtrl("obj");
with (obj){
  
//stuff
  
thiso.catchevent(this,"onMouseDown","onFocusOut");
}
function 
onFocusOut(){
  
GraalControl.showtop();


But if you are resizing the GraalControl for some reason, showtop will mess it up sometimes.. so be careful :)


All times are GMT +2. The time now is 11:05 AM.

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