PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Characteristics of the popup window
  • Parameters passed to the window to open
  • Which opening mode to choose?
  • Limits
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 by specifying its opening position and waits until it is closed.
This function must be used in the code of a control (click code of button for example).
Example
// Ouverture d'une fenêtre de sélection de couleur
MaCouleur is int
MaCouleur = OpenPopupPosition(FEN_CouleurFenSélecteur, popBelow + popAlignedRight + ...
popAccordingToControl, BTN_CouleurAction, CouleurCourante)
// Si une couleur a été sélectionnée
// (MaCouleur <= 0 si on annule la fenêtre)
IF MaCouleur > 0 THEN
// On conserve la nouvelle couleur sélectionnée
CouleurCourante = MaCouleur
// Changement de couleur du rectangle du champ Bouton
BTN_Couleur.Libellé = gRectangle(0, 0, 72, 16, CouleurCourante, 0)
END
Syntax
<Result> = OpenPopupPosition(<Popup window> , <Opening mode> [, <Reference control>] [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Type corresponding to the retrieved value (optional)
Value returned by the popup window when it is closed. This value is returned:
  • or by the RETURN keyword in the window closing code,
  • or by the ferme function,
  • by the ReturnedValue property used before closing the window.
<Popup window>: Window name
Name of window to open.
<Opening mode>: Combination of constants
Specify the position and the opening mode of the popup window. These constants are:
popAlignedRightThe right border of the popup window will be aligned with the right border of the control. The popup window stretches to the left.
(Corresponds to the constant poLeft in previous versions).
popAlignedLeftThe left border of the popup window will be aligned with the left control border. The popup window stretches to the right.
(Corresponds to the constant poRight in previous versions).
popAboveThe popup window will be opened above the calling control.
(Corresponds to the constant poTop in previous versions).
popCenteredWindowThe popup window is centered relative to the parent window.
popCenteredHorizontallyThe popup window is centered horizontally with the calling control.
popDefault
(Default value)
By default, the popAlignedLeft + popBelow constants are used.
popDisableAutoRepositioningDisables automatic repositioning if the popup window is likely to be truncated.
(Corresponds to the constant poFixedPosition in previous versions).
popBelowThe popup window will be opened below the calling control.
(Corresponds to the constant poBottom in previous versions).
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.
(Corresponds to the constant poAccordingToControl in previous versions).
<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 poAccordingToControl constant was used.
<Parameter 1>: Type of value sent to the window (optional)
First parameter that will be passed to the "Global declarations" event of the window to open. These parameters are passed by reference and are considered as global variables to the window.
<Parameter N>: Type of value sent to the window (optional)
Nth parameter that must be passed to the "Global declarations" event of the window to open. These parameters are passed by reference and are considered as global variables to the window.
Remarks

Characteristics of the popup window

  • The window is automatically closed when it loses focus or during the call to ferme. The current value is returned to the control that opened the popup window by one of the following methods:
    • or by the RETURN keyword in the window closing code,
    • or by the ferme function,
    • by the ReturnedValue property used before closing the window.
  • The window opened by the OpenPopupPosition function adopts the popup style. 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 OpenPopupPosition. 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.

Parameters passed to the window to open

The parameters are retrieved in the event "Global declarations" of the window. Simply write the following line of code at the start:
PROCEDURE <Nom de la fenêtre> (<Paramètre1> [, <Paramètre2> [, ...]])
For more details, see Window with parameters.

Which opening mode to choose?

Remarks:
  • if you use only the poBottom constant, the popup window will be opened at position poRight + poBottom.
  • if you use only the poBottom constant, the popup window will be opened at position poRight + poTop.

Limits

  • OpenPopupPosition must be executed from the code of a control.
  • The control that calls OpenPopupPosition must be visible.
  • Non-modal windows cannot be opened from a popup window. Open up 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 up and you must use ferme to close the popup window.
  • A popup window cannot be opened from a popup window.
Business / UI classification: UI Code
Component: wd270obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment