Definition: |
include pGUI.e
IupConfigDialogClosed(Ihandle config, Ihandle dialog, string name) |
Description: |
Store the position and size of a dialog, so when the application is run again the dialog can be shown at the last position and size.
config: Identifier of the configuration database (see IupConfig) dialog: the dialog to manage the size and position name: a group name for this dialog 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". Use the function IupConfigDialogClosed to save the last dialog position and size when the dialog is about to be closed, usually inside the dialog CLOSE_CB callback. If the dialog was closed maximized it will be shown maximized. The dialog size is set only if RESIZE=Yes. (since 3.16) 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. Note that, unlike the raw C function, the Phix wrapper (pGUI.e) deliberately avoids obliterating X/Y/Width/Height when the window is maximised (windows only). The "official" value, "Maximized", is always zero, but pGUI.e shadows it with "MaxiSized" to achieve the desired effect, at least on Windows. (internally it uses the windows-only "MAXIMIZED" attribute, since unfortunately testing "PLACEMENT"="MAXIMIZED" appears not to work.) Also, as something of a personal choice, I often completely avoid calling IupConfigDialogClosed() on maximised child windows - if I accidentally maximise say the find (Ctrl F) window in Edix just before closing it on Friday night, then on Monday morning I just want a normal window to appear. There is no specific support for that though, you have to remember to do it manually (as above, what I do there is also windows-only). Internally variables are stored as attributes using a " |
Example: |
IupConfigDialogClosed(config, mainwin, "MainWindow"); |
See Also: | IupConfig, IupConfigDialogShow, IupSetAttribute, IupConfigLoad, IupGetAttribute |