PDA

View Full Version : GUI *blocking*


xXziroXx
06-19-2006, 08:06 PM
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, 08:57 PM
GraalControl.makefirstresponder() after you create the window works, I think.

xXziroXx
06-19-2006, 09:14 PM
Didnt work.. Tried putting it IN "new control blah", tried putting it after - also tried in a timeout.

Yen
06-19-2006, 10: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, 01:12 AM
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);

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, 05:38 PM
Got it to work:


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, 06:44 PM
Got it to work:


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, 06:58 PM
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, 07:57 AM
You can also do:

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

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


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 :)