PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Parameters passed to the child window to open
  • Opening mode of window
  • Position of parent window
  • 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:
  • the "Global declarations" code of the child window is run,
  • the initialization codes of controls are run (the order is undefined),
  • the processes following the call to OpenChild of the parent window are run.
  • the child window is displayed.
Note: By default, the child window keeps focus once it is opened.
Versions 16 and later
Linux This function is now available for WINDEV applications in Linux.
New in version 16
Linux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WINDEV applications in Linux.
Versions 24 and later
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageDisplay.
New in version 24
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageDisplay.
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageDisplay.
// 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 the "EDT_EditCustomer" control is passed in parameter to the event
// "Global declarations" of "WIN_EditWindow".
OpenChild(WIN_EditWindow, EDT_EditCustomer)
// -- "Global declarations" event of "WIN_EditWindow"
// Retrieve the parameters
PROCEDURE 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> [, <Parameter 1> [... [, <Parameter N>]]])
<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.
<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. 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 (arrays can only be passed by reference).
<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. 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 (arrays can only be passed by reference).

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

OpenChild(<Window name [ + <Level>]> [, <Parameter 1> [... [, <Parameter N>]]])
<Window name [ + <Level>]>: Character string + Integer constant
Used to specify:
  • the window to open (<Window name>). This parameter can correspond to:
    • Name of child window to open.
    • Name and full path of child window (".WDW" file) to open.
    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.
    • <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).
    Notes:
    • 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.
  • the window display level (<Level>):
    AboveWindow opened above all its sibling windows.
    AboveAllWindow opened above all the other windows (including the windows of other applications).

    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.
<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. 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 (arrays can only be passed by reference).
<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. 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 (arrays can only be passed by reference).
Remarks

Parameters passed to the child window to open

The parameters are retrieved in the "Global declarations" window event. Simply write the following line of code at the start:
PROCEDURE <Window name> (<Parameter1> [, <Parameter2> [, ...]])
These parameters are passed by value and not by reference.

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.

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).

Limitations

  • OpenChild must not be called in the initialization code of project.

Closing a window

A window opened with OpenChild can be closed with Close (without parameters) from any event:
  • 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)
Component : wd240obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment