PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Parameters passed to the child window to open
  • Opening mode of window
  • Position of parent window
  • Opening the same window several times
  • Limitations
  • Closing a window
  • Title of window to open
  • Opening a component window
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
Opens a non-modal child window. OpenChild is also used to:
  • define the display position of child window,
  • pass parameters to the child window.
During the call to OpenChild, the following processes are run:
  • running the "declaration code of global variables" of child window,
  • running the initialization codes of controls (the order is undefined),
  • running the processes following the call to OpenChild of parent window.
  • displaying the child window.
Note: By default, the child window keeps focus once it is opened.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
// Open the child window named "WIN_EditWindow"
// without positioning and without passing parameters
OpenChild(WIN_EditWindow)
// Open the child window named "WIN_EditWindow".
// The value of "EDT_EditCustomer" control is passed in parameter to the process
// for declaring the global variables of "WIN_EditWindow".
OpenChild(WIN_EditWindow, EDT_EditCustomer)
// -- Process for declaring the global variables of the "WIN_EditWindow" window
// Retrieve the parameters
PROCÉDURE WIN_EditWindow(Customer)
HReadSeek(Customer, CustomerName, Customer)
IF HFound() = True THEN
FileToScreen()
ELSE
Error("No customer matches")
END
Syntax

Opening a child window Hide the details

OpenChild(<Window Name> [, <Parameter1> [, <Parameter2> [, ... ]]])
<Window Name>: Character string (with or without quotes)
  • Name of child window to open.
  • Name and full path of child window (".WDW" file) to open.
    AndroidUniversal Windows 10 AppJava You cannot specify the full name of file to open (".WDW" file).
WINDEV To avoid giving focus to the opened window, use the following notation: <Window Name> + NoFocus. The process for taking focus will not be run in the child window. Caution: in this case, the window name must be enclosed in quotes.
<Parameter1>: Type of value sent to the window (optional)
First parameter that will be passed to the "Global declarations" process of window to open. This parameter is passed by value and it is considered as being a variable global to the window.
This parameter cannot correspond to an array variable (the arrays can only be passed by address).
<Parameter2>: Type of value sent to the window (optional)
Second parameter that will be passed to the "Global declarations" process of window to open. This parameter is passed by value and it is considered as being a variable global to the window.
This parameter cannot correspond to an array variable (the arrays can only be passed by address).

Opening a child window while defining its position and its display level Hide the details

OpenChild(<Window Name>[+<Level>] [, <Parameter1> [, <Parameter2> [, ... ]]])
<Window Name>: Character string
  • Name of child window to open.
  • Name and full path of child window (".WDW" file) to open.
    AndroidUniversal Windows 10 AppJava You cannot specify the full name of file to open (".WDW" file).
By default, the window is displayed according to the position defined in the editor. You have the ability to define the display position of the window. The window name is completed by the display coordinates of window when it is opened. This parameter has the following format:
"[<Alias>] = <Window Name> [, <Y>, <X>]"

where:
  • <Alias>: alias of the window if the same window is opened several times.
  • <Window Name>: name of the child window to open.
    WINDEV To avoid giving focus to the opened window, use the following notation: <Window Name> + NoFocus. The process for taking focus will not be run in the child window. Caution: in this case, the window name must be enclosed in quotes.
  • <Y>: vertical display coordinate (in pixels) of window (in relation to the top left corner of screen or parent window).
  • <X>: horizontal display coordinates (in pixels) of window (in relation to the top left corner of screen or parent window).
Universal Windows 10 App The <X> and <Y> parameters are not available.
Note: The coordinates are ignored if the window is defined as centered in the editor. We recommend that you use WinSize to modify the display position of a window.
<Level>: Optional constant
Specifies the display level of window:
AboveWindow opened above all its sibling windows.
AboveAllWindow opened above all the other windows (including the windows of other applications).
AndroidUniversal Windows 10 AppJava Constant not available.
If one of the constant is used, the name of the window must necessarily be enclosed in quotes.
Note: If two windows are opened with the same constant (Above or AboveAll), the second window will be opened above the first one.
We recommend that you use WinStatus to modify the display level of a window.
Universal Windows 10 App Parameter not available.
<Parameter1>: Type of value sent to the window (optional)
First parameter that will be passed to the "Global declarations" process of window to open. This parameter is passed by value and it is considered as being a variable global to the window.
This parameter cannot correspond to an array variable (the arrays can only be passed by address).
<Parameter2>: Type of value sent to the window (optional)
Second parameter that will be passed to the "Global declarations" process of window to open. This parameter is passed by value and it is considered as being a variable global to the window.
This parameter cannot correspond to an array variable (the arrays can only be passed by address).
Remarks

Parameters passed to the child window to open

The parameters are retrieved in the "Global declarations" process of window. To do so, specify the following line at the beginning of process:
PROCEDURE <Window Name> (<Parameter1> [, <Parameter2> [, ...]])
These parameters are passed by value and not by address.

Opening mode of window

The window is opened in non-modal mode:
  • the child window becomes the current window.
  • once the child window is opened, the processes following the call to OpenChild in the parent window are run.
  • the user will have the ability to click one of the parent windows of opened window.
    AndroidiPhone/iPadApple Watch The controls found in the parent windows cannot be accessed by the user as long as a child window is opened.
WINDEV Note: OpenChild gives focus to the child window. The code for taking focus is run in the child window and the code for losing focus is run in the parent window. In order for the parent window to keep focus, use the NoFocus constant in the <Window Name> parameter.
To manage the MDI, use MDIOpen.

Position of parent window

The parent window always remains below the child window, even if the parent window is in edit.
If this situation is not suitable, the child window must be opened by OpenSister (providing that the parent window is a non-modal window).
WINDEVReports and QueriesWindows MobileUser code (UMC)

Opening the same window several times

  • If the same window is opened several time, we recommend that you use an alias. This alias is used to differentiate between each window.
  • The position of the calling window (relative to the screen or to the parent window) is chosen when the window is described in the editor. If the same window is opened several times (with an alias), the display positions must be modified at each opening (otherwise the windows will be stacked).
  • The number of windows that can be opened simultaneously depends on the available memory.

Limitations

  • OpenChild must not be called in the initialization code of project.
    WINDEV To display a "splash screen" window at the start of the application, use the "Splash screen" option when creating the executable.
  • Universal Windows 10 App OpenChild must not be called in the closing code of a child window.

Closing a window

A window opened by OpenChild can be closed by Close (without parameter) from any process:
  • of the window,
  • of a window control.
If a parent window is closed, its child windows are also closed.

Title of window to open

By default, the window title is the one defined in the editor.
To modify the window title, use NextTitle or CurrentTitle.

Opening a component window

To open a component window, all you have to do is use the name of the component window (the component being included in the project). For example:
OpenChild(ComponentWindow)
If a conflict occurs with a project element, the element name must be prefixed by the component name. For example:
OpenChild(MyComponent.Window)
To use the name of the window in a variable, the name of the component must be specified. For example:
sWindow is string ="MyComponent.MyWindow"
OpenChild(sWindow)
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment