Game Development Community

PushDialog Problem

by Vincent BILLET · in Torque Game Engine · 01/13/2006 (9:26 am) · 6 replies

I set many buttons into PlayGui. Each of these buttons calls a canvas.pushDialog(AnyWindow).

When I click on the first button, The window appear, but I Can't click no more on any other buttons in my playGUI untill I Close this window.

AnyChance to have a solution to this problem?

#1
01/13/2006 (9:42 am)
I would also like to hear an explanation fo this.

as i understand it, a gui takes over the entire screen, even tho it may be transparent.

that is, gui's are modal.

the workaround i'm currently using is to put all the pop-up windows into the PlayGui,
and call setVisible() instead of pushDialog().

.. but i have a feeling that's maybe not the 'right' way.

anyone else ?
#2
01/13/2006 (10:06 am)
As far as I can tell, from my limited knowledge, the answer to your question is no. A dialog box is meant to appear on top of a canvas; and has to be dealt with before you can do anything else.

An obvious solution, though inelegant, would be to make a separate canvas for each button; and use Canvase.setContent over and over again. The buttons section on all the canvases would be identical; only the content would change. The user would never know.

I tried finding some info on GuiTabBookCntl and GuiTabPageCntl, but was unable to find any documentation. Perhaps these gui controls will provide the functionality that you seek.

Given the usability of having a single canvas have a section that displays different content (depending on which button is pushed), I would be eager to know how this might be accomplished.
#3
01/13/2006 (12:05 pm)
Think of pushDialog() just as you would a stack--when you push a new dialog, it's "on top", and basically overrides everything beneath it.

For the functionality you guys are talking about, have a pane that contains all of the gui controls at a specific level (that you want to be able to press regardless of the state of other guis in that level), and then push that pane instead of pushing buttons individually.

Very similar to what Orion mentions as his "workaround", except that you can have multiple panes, and push/pop them as appropriate for your desired input levels.
#4
01/13/2006 (1:29 pm)
Yes the idea, is for example to allow the player to view the PC stats, the Inventory, The minimap. All of these windows might be setVisible or not.

So to do this you must include all windows in playGUI.

The solution is good for me.
#5
01/16/2006 (3:15 pm)
There two two ways you can add element's to your GUI without cutting out all others... one is using the .add() function... This will actually add a GUI to another, in fact if you use .add() and hit F10 to go to the GUI editor you'll see your added GUI in the tree view.

An example is to create a new gui called miniMapGui... then using
PlayGui.add(miniMapGui);

the plus is since its part of the GUI now and not just one above it, you can utilize all aspects of that GUI.

Another way to get around thi sis to set model = false in a profile... an easy way to do this is to create a GUI profile that's a copy of the default one and just set modal = false, like this.

if(!isObject(DefaultNonModalProfile)) new GuiControlProfile (DefaultNonModalProfile : GuiDefaultProfile)
{
   modal = false;
};
#6
01/16/2006 (3:24 pm)
Setting the gui to non-modal sounds ideal, thanks matthew.