Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Giving focus back to GraalControl (https://forums.graalonline.com/forums/showthread.php?t=63792)

Rick 01-29-2006 09:35 AM

Giving focus back to GraalControl
 
I'm working on a "full screen" HUD overlay using Gui controls.

I have a problem that I can't seem to figure out and I'd like other ideas if anyone has any.

The script:
PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
this.createOverhead();
}

function 
createOverhead()
{
  new 
GuiControl(Overhead_Screen)
  {
    
profile               "GuiControlProfile";
    
horizSizing           "width";
    
vertSizing            "height";
    
position              "0 0";
    
extent                "640 480";
    
active                true;
    
    new 
GuiControl(Overhead_Background)
    {
      
profile             "GuiControlProfile";

      
useownprofile       true;
      
profile.opaque      true;
      
profile.fillColor   "0 0 0 128";
      
profile.borderColor "0 0 0 255";
      
profile.border      1;

      
position            "0 320";
      
extent              "640 160";

      
horizSizing         "width";
      
vertSizing          "top";

      new 
GuiButtonCtrl(Overhead_MoveUp)
      {
        
profile           "GuiButtonProfile";
        
position          "600 20";
        
extent            "40 40";

        
horizSizing       "left";
        
vertSizing        "top";

        
active            true;
      };

      new 
GuiTextEditCtrl(Overhead_Test)
      {
        
profile           "GuiTextEditProfile";
        
position          "0 0";
        
extent            "100 20";
      };
    };
  };

  
Overhead_Screen.resize(00screenwidthscreenheight);
  
GraalControl.makeFirstResponder(true);


I am using Overview_Screen basically as a "wrapper" to provide a resolution independant display. When the screen is resized it automatically resizes...

Now, the problem: the .makeFirstResponder(true); works nice and all, but once you focus the TextEdit control you cannot get focus back to the Graal control.

Does anyone know how I can basically make the GuiControl Overview_Screen pass all events to GraalControl?

I guess it's not much of a problem if I keep no focus grabbing GuiControls on the screen and have them in opened windows, but I'd like a proper solution than avoiding it.

Yen 01-29-2006 08:50 PM

Did you try pushToFront()?

Rick 01-29-2006 09:01 PM

Quote:

Originally Posted by Yen
Did you try pushToFront()?

No, I'll try it, although I don't think that will solve the problem.

Skyld 01-29-2006 09:25 PM

Quote:

Originally Posted by Rick
No, I'll try it, although I don't think that will solve the problem.

Is your window part of the GUI container, or is this all inside the GraalControl?
PHP Code:

GUIContainer.addControl(Overhead_Screen); 



All times are GMT +2. The time now is 09:24 AM.

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