ArmA does support multiple displays, but only the controls of the last item will get drawn.
ION_DialogShowModal (=DSM) is a work-around for this problems.
The controls of the display have to get merged into one display. Then DSM will make sure that only the controls of opened subdialogs (=set of controls) will get drawn and only the last opened subdialog will be active.
How to use DSM:
- Merge all controls into one display.
- Give all controls a different IDC.
- include the 'ION_DialogShowModal.h' in the controls and in the dialog section.
- Initialize DSM:
call compile preprocessFileLineNumbers "ION_DialogShowModal.sqf";
100 call ION_DSM2_RegisterDisplay;
[100, "YesNo", [[], [200, 201, 202, 203, 204, 205, 206], []]] call ION_DSM_RegisterDialog;
where the first parameter is the display it belongs too, the second parameter is the identifier for the subdialog, the third parameter is an array of arrays of background, foreground IDCs and the idcs which should allow drag.
[100, "Dialog", [], ["nowait"]] call ION_DSM2_ShowModal;
where the first parameter is the display, the second the subdialog and the third parameter which get passed to the onShow code.
- To close the current open subdialog:
true call ION_DSM2_ModalResult
where true/false is the result of the opened subdialog. If not required use false.
The DSM will throw exceptions if something goes wrong.
To ensure that nothing goes wrong, please use only the functions from DSM and not createDialog or closeDialog.
Does it work?
Please take a look at the (simple and uncreative) example which is included in the attachment.
Updated to 2.0 Beta:
Merged Draggable into RegisterDialog
Changed parameter for RegisterDisplay
ShowModal has "nowait" parameter for directly return after creating the dialog
Show now adds a dialog to the open dialogs. The previous active dialogs are still active too.
Added context menu
Updated to 1.2b:
Fix: After closing a subdialog, only previous enabled controls will get enabled
Added ION_DSM_GetActive
Updated in 1.1.1b:
Fix: ION_DSM_Show: Waits until the subdialog will get shown.
Updated in 1.1b:
Added ION_DSM_isActive,
ION_DSM_MakeDraggable,
ION_DSM_MoveDialog