Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-29-2006, 09:35 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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.
Reply With Quote
  #2  
Old 01-29-2006, 08:50 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Did you try pushToFront()?
Reply With Quote
  #3  
Old 01-29-2006, 09:01 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Quote:
Originally Posted by Yen
Did you try pushToFront()?
No, I'll try it, although I don't think that will solve the problem.
Reply With Quote
  #4  
Old 01-29-2006, 09:25 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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); 
__________________
Skyld

Last edited by Skyld; 01-30-2006 at 01:33 AM..
Reply With Quote
Reply


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 01:25 PM.


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