Home   Help Search Login Register  

Author Topic: Dialog appearing on top of an existing dialog  (Read 1473 times)

0 Members and 1 Guest are viewing this topic.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Dialog appearing on top of an existing dialog
« on: 03 Sep 2007, 12:15:13 »
I'm trying to open a modal dialog to get user input, but I'm having problems since it must be opened over another dialog. That is, I want the original dialog to remain visible while the new dialog is displayed modally. Since it needs to be modal, I can't just use a component within the original dialog which appears when I want input.

I've tried two methods, but both of them end up with the original (1000) dialog disappearing, to be entirely replaced by the second dialog (2000). The original dialog reappears only when the new one is closed:
Code: [Select]
createDialog 1000;
...later...
createDialog 2000;

Code: [Select]
createDialog 1000;
...later...
(findDialog 1000) createDisplay 2000;

Any ideas? I know that this is possible in ArmA since the marker dialog appears over the standard map dialog when you double-click on the map. Of course, that doesn't mean that we can mimic that functionality, but I'm hopeful.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Dialog appearing on top of an existing dialog
« Reply #1 on: 08 Sep 2007, 10:25:41 »
Sorry to bump this (at least I'm not abusing everyone at OFPEC for not answering within 24 hours ;P), but I I'm rather hoping that someone will have some wisdom to share on this matter, even if it is just "noone has ever tried it" (hard to believe) or "it is impossible in user scripting". Alternatively, could anyone suggest a workaround for getting input like this? Thanks if you can shed any light on this.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Dialog appearing on top of an existing dialog
« Reply #2 on: 08 Sep 2007, 10:39:29 »
Didnt mess with that particular problem, but when I needed something similar I used a single dialog where groups of controls might go visible/enabled or not depending on the situation. The visual effect might be similar to what you are looking for.

Offline paddy

  • Contributing Member
  • **
  • Llama whipping good
Re: Dialog appearing on top of an existing dialog
« Reply #3 on: 08 Sep 2007, 19:03:02 »
I dont think you can have more than one dialog open and visible at once.  :no:

How about recreating the original dialog window in this second dialog and using variables to transfer across the button/listbox setting etc. and screen position? (you can have multiple windows per dialog right?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Dialog appearing on top of an existing dialog
« Reply #4 on: 08 Sep 2007, 19:15:47 »
I think Mandoble's idea is the only feasible one (thanks!) and the only way to go. Fiddly to disable/enable everything each time the "top" dialog is needed, but it seems the simplest workaround way.

@paddy: I did consider making the top dialog contain everything that was in the bottom dialog, which would appear as though the bottom dialog was still open when the top one was. Problem is that there is a lot of data and state-info in the bottom dialog to copy (including a map position) and managing this would certainly be more complex than Mandoble's method. As far as "having multiple windows open in a dialog", I don't think you can; that was what I was trying to do in the second code snippet in my OP, where I tried to create a sub-display on my existing dialog, rather than open a fresh dialog (at least that is what I'd assumed it would do from the documentation).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)