gShow
| Definition: |
include xpGUI.e
gShow(gdx id, integer x=XPG_CURRENT, y=XPG_CURRENT) |
| Description: |
Displays a dialog, optionally in a given position on the screen.
id: a result from gDialog() [use gPopupMenu for menus] x, y: top left corner in pixels, or one of the predefined constants listed below. Equivalent to gSetAttribute(id,"VISIBLE",true) when used on individual elements and sub-containers. |
| pwa/p2js: | Supported. |
| Comments: |
Optionally the following definitions can also be used for x (instead of a specific pixel co-ordinate):
Invokes gMap() automatically, when needed. See the PLACEMENT attribute for other position and show options. When XPG_CURRENT is used at the first time the dialog is shown then it is replaced by XPG_CENTERPARENT. When XPG_CENTERPARENT is used but no parent is defined then it is treated the same as XPG_CENTER. When either x or y is XPG_MOUSEPOS they must both be. The window is positioned such that the top left corner is at the mouse pointer co-ordinates, unless that would exceed the right hand side of the screen in which case it is positioned with the right edge touching the mouse pointer, and/or if it would drop below the bottom of the screen the dialog is positioned above the mouse pointer, in other words one of the four corners of the window will be on the mouse pointer. Should the window exceed half the height or width of the screen, then from certain positions the top left corner of the window may end up off-screen, in which case either use a smaller window or constrain where the mouse can be when this can happen towards the edges and away from the centre of the screen - so for instance you could still have a ridiculously huge popup when clicking on the properties of a monopoly board. For anything fancier you could always just calculate the co-ordinates yourself, it’s not exactly hard. The main screen size does not include additional monitors. This function can be executed more than once for the same dialog. This will make the dialog be placed above all other dialogs in the application, changing its Z-order, and update its position and/or size on screen. IMPORTANT: Calling gShow() for a visible dialog previously shown with bModal:=true does nothing. |
| Example: |
gShow(dlg) |
| See Also: |
gHide,
gMap |