PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
OpenPopupPosition (Function)
In French: OuvrePopupPosition
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
// Open the window for color selection
MyColor is int
MyColor = OpenPopupPosition(WIN_ColorSelectionWin, poBottom + poRight + poAccordingToControl, ...
BTN_ActionColor, CurrentColor)
// If a color was selected
// (MyColor <= 0 if the window is canceled)
IF MyColor > 0 THEN
// Keep the new selected color
CurrentColor = MyColor
// Change the color of the button rectangle
BTN_Color..Caption = gRectangle(0, 0, 72, 16, CurrentColor, 0)
END
Syntax
<Result> = OpenPopupPosition(<Window Name>, <Opening Mode> [, <Control Name>] [, <Parameter1> [, <Parameter2> [, ...]]])
<Result>: Type corresponding to the retrieved value (optional)
Value returned by the popup window when it is closed. This value is returned:
<Window Name>: Character string (with or without quotes)
Name of window to open.
<Opening Mode>: Combination of constants
Specify the position and the opening mode of the popup window. These constants are as follows:
poBottomThe popup window will be opened below the calling control
poRightThe left border of the popup window will be aligned with the left control border. The popup window stretches to the right.
poLeftThe right border of the popup window will be aligned with the right border of the control. The popup window stretches to the left.
poTopThe popup window will be opened above the calling control
poFixedPositionDisables the automatic positioning if the popup window may not be entirely visible on the screen
poAccordingToControlOpens 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.
<Control Name>: Optional character string
Name of the control under which the popup window must be opened. This parameter must be specified only if the poAccordingToControl constant was used.
<Parameter1>: Type of value sent to the window (optional)
First parameter that will be passed to the "Declaration of global variables" process of window to open. These parameters are passed by address and they are considered as being global variables of the window.
<Parameter2>: Type of value sent to the window (optional)
Second parameter that will be passed to the "Declaration of global variables" process of window to open. These parameters are passed by address and they are considered as being global variables of the window.
Remarks

Characteristics of the popup window

  • The window is automatically closed when it loses focus or during the call to Close. The current value is returned to the control that opened the popup window by one of the following methods:
  • The style of the popup windows is applied to the window opened by OpenPopupPosition. 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 is running 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 "Declaration of global variables" process of window. To do so, specify the following line at the beginning of process:
PROCEDURE <Window Name> (<Parameter1> [, <Parameter2> [, ...]])
See Window with parameters for more details.

Which opening mode to choose?

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

Limits

  • OpenPopupPosition must be run from the code of a control.
  • The control from which OpenPopupPosition is run must be visible.
  • A window that is not a 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 a popup window.
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment