IupConfigDialogShow

Definition: include pGUI.e

IupConfigDialogShow( Ihandle config, Ihandle dialog, string name, bool maximised=false)
Description: Call IupConfigDialogShow to show a dialog using the size and position from some previous call of IupConfigDialogClosed.

config: Identifier of the configuration database (see IupConfig)
dialog: the dialog to manage the size and position
name: a group name for this dialog
maximised: a default setting for the first time the dialog is used.

The group name should be arbitrarily selected by the programmer to be meaningful and unique across the application, just as you would if you were writing out a .ini file by hand. For example "MainWindow" should result in a config file that might contain, amongst other things, "[MainWindow]\nX=200\nY=200\nWidth=100\nHeight=120\n".

IupConfigDialogShow does no adjustments if the dialog is already visible, just calls IupShow.

If the dialog was closed maximized it will be shown maximized.
If your dialog is resizable and you want to avoid the last size usage because you changed the dialog layout, then reset the "Width" and "Height" variables before calling IupConfigDialogShow.
To use IupConfigDialogShow for a modal dialog, call it before calling IupPopup(dialog,IUP_CURRENT,IUP_CURRENT).

The position is saved in the variables "X" and "Y" of the given group name.
The size is saved in the variables "Width" and "Height" of the given group name.

Internally variables are stored as attributes using a "<GROUP>.<KEY>" combination, which is why the group name cannot have periods ".".

The use of a named parameter when setting maximised to true is recommended, to make the intent clear and the code easier to read.
Example:
IupConfigDialogShow(config, mainwin, "MainWindow")
See Also: IupConfig, IupConfigDialogClosed, IupConfigGetVariableInt, IupConfigSetVariableInt, IupSetAttribute, IupConfigLoad, IupGetAttribute