PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Opening the popup window
  • Characteristics of the popup window
  • Limitations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Opens a popup window whose result will be retrieved via a WLanguage procedure ("callback").
Example
// Open a popup window without passing parameters
OpenPopupAsynchronous(WIN_SelectColor, popBelow + popAlignedRight + popAccordingToControl,
"BTN_ActionColor", CloseColorSelect)
INTERNAL PROCEDURE CloseColorSelect(SelectedColor)
IMG_PRODUCT.Color = SelectedColor
END
// Open a popup window with parameters
OpenPopupAsynchronous(WIN_SelectColor, popBelow + popAlignedRight + popAccordingToControl,
"BTN_ActionColor", CloseColorSelect, DarkRed)
INTERNAL PROCEDURE CloseColorSelect(SelectedColor)
IF SelectedColor <> -1 THEN
IMG_PRODUCT.Color = SelectedColor
END
END
Syntax
OpenPopupAsynchronous(<Window> [, <Parameters> [, <Opening mode> [, <Reference control>]]] [, <WLanguage procedure>])
<Window>: Window name
Name of the window to be opened.
<Parameters>: Character string
List of parameters to be passed to the window. This list of parameters has the following format:
(<Parameter 1>, ..., <Parameter N>)

where:
  • <Parameter 1>: First parameter that will be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
    This parameter cannot correspond to an array variable (arrays can only be passed by reference).
  • <Parameter N>: Nth parameter that must be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
    This parameter cannot be a variable of type array (arrays can only be passed by reference).
If the window expects no parameters, this parameter must be set to "()".
<Opening mode>: Combination of constants
Specify the position and the opening mode of the popup window. These constants are:
popAboveThe popup window will be opened above the calling control.
popAccordingToControlOpens the popup window according to the position of a control other than the calling control. In this case:
  • the control name must be specified (<Control name>).
  • the control name will be automatically retrieved by MyPopupControl.
popAlignedLeftThe left border of the popup window will be aligned with the left control border. The popup window stretches to the right.
popAlignedRightThe right border of the popup window will be aligned with the right border of the control. The popup window stretches to the left.
popBelowThe popup window will be opened below the calling control.
popCenteredHorizontallyThe popup window is centered horizontally with the calling control.
popCenteredWindowThe popup window is centered relative to the parent window.
popDefault
(Default value)
By default, the popAlignedLeft + popBelow constants are used.
popDisableAutoRepositioningDisables automatic repositioning if the popup window is likely to be truncated.
Android Not available.
<Reference control>: Optional control name
Name of the control under which the popup window must be opened. This parameter must be specified only if the popAccordingToControl constant was used.
<WLanguage procedure>: Name of optional or lambda procedure
Name of the WLangage procedure ("callback") called after the window is closed. For more details on this procedure, see Parameters of the procedure used by OpenPopupAsynchronous.
This WLanguage procedure can correspond to:
  • a name of a global procedure,
  • a name of an internal procedure,
  • a lambda procedure.
Remarks

Opening the popup window

  • OpenPopupAsynchronous opens the window in modal and asynchronous mode:
    • code execution continues without waiting for the popup window to be closed,
    • the WLanguage procedure will be called when the popup window is closed.
    • if the user clicks on another window, the popup window will be closed.

Characteristics of the popup window

  • The popup window is automatically closed if it loses focus, or when Close is called.
  • The style of the popup windows is applied to the window opened by OpenPopupAsynchronous. If a title bar was defined in the editor, this title bar is reduced and the window cannot be maximized or minimized.
  • The popup window is opened below the control that calls OpenPopupAsynchronous. If there is not enough space to open the window, the window will be opened either above the control, or below the control to the left.

Limitations

  • OpenPopupAsynchronous must be executed from the code of a control.
  • The control that calls OpenPopupAsynchronous must be visible.
  • A non-modal window cannot be opened from a popup window. Open must be used to open a window. Opening a modal window from a popup window does not automatically close the popup window. In this case, you must process the return value of Open and you must use Close to close the popup window.
  • A popup window cannot be opened from another popup window.
Component: wd270obj.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment