PC SOFT

WINDEV的在线文档

  • Parameters passed to the child window to open
  • Opening mode of the window
  • Position of the parent window
  • Opening the same window several times
  • Limitations
  • Closing a window
  • Title of the window to open
  • Opening a component window
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Opens a non-modal child window. 打开子窗口 is also used to:
  • define the display position of the child window,
  • pass parameters to the child window.
During the call to 打开子窗口, the following processes are run:
  • running the "declaration code of global variables" of the child window,
  • running the initialization codes of controls (the order is undefined),
  • running the processes following the call to 打开子窗口 of the parent window,
  • displaying the child window.
Note: By default, the child window keeps focus once it is opened.

16版本和更高版本
WinDevLinux This function is now available for the WinDev applications in Linux.
16新版本
WinDevLinux This function is now available for the WinDev applications in Linux.
WinDevLinux This function is now available for the WinDev applications in Linux.
18版本和更高版本
WinDevWindows Store apps This function is now available in Windows Store apps mode.
18新版本
WinDevWindows Store apps This function is now available in Windows Store apps mode.
WinDevWindows Store apps This function is now available in Windows Store apps mode.
例子
// Open the child window named "WIN_EditWindow"
// without positioning and without passing parameters
打开子窗口WIN_EditWindow

// Open the child window named "WIN_EditWindow".
// The value of the "EDT_EditCustomer" control is passed in parameter to the process
// declaring the global variables of "WIN_EditWindow".
打开子窗口WIN_EditWindowEDT_EditCustomer

// -- Process for declaring the global variables of the "WIN_EditWindow" window
// Retrieve the parameters
过程WIN_EditWindowCustomer
H读查找CustomerCustomerNameCustomer
如果H找到()=,那么
数据库表填充到屏幕()
否则
错误"No customer corresponds"
结束

语法

Opening a child window 隐藏详细信息

 打开子窗口(<Window Name> [, <Parameter1> [, <Parameter2> [, ... ]]])
<Window Name>: Character string (with or without quotes)
  • Name of the child window to open.
  • Name and full path of the child window (".WDW" file) to open.
WinDev To avoid giving focus to the opened window, use the following notation: <Window Name> + 无焦点. The process for taking focus will not be run in the child window. Caution: in this case, the name of the window must be enclosed in quotes.
<Parameter1>: Type of the value sent to the window (optional)
First parameter that must be passed to the "Declaration of global variables" process 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 (the arrays can only be passed by address).
<Parameter2>: Type of the value sent to the window (optional)
Second parameter that must be passed to the "Declaration of global variables" process 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 (the arrays can only be passed by address).

Opening a child window while defining its position and its display level 隐藏详细信息

 打开子窗口(<Window Name>[+<Level>] [, <Parameter1> [, <Parameter2> [, ... ]]])
<Window Name>: Character string
  • Name of the child window to open.
  • Name and full path of the 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 name of the window is completed by the display coordinates of the 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> + 无焦点. The process for taking focus will not be run in the child window. Caution: in this case, the name of the window must be enclosed in quotes.
  • <Y>: vertical display coordinate (in pixels) of the window (in relation to the top left corner of the screen or parent window).
  • <X>: horizontal display coordinates (in pixels) of the window (in relation to the top left corner of the screen or parent window).
Windows Store apps 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 窗口尺寸 to modify the display position of a window.
<Level>: Optional constant
Specifies the display level of the window:
在上面Window opened above all its sibling windows.
在全部上面Window opened above all the other windows (including the windows of the 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 (在上面 or 在全部上面), the second window will be opened above the first one.
We recommend that you use 窗口状态 to modify the display level of a window.

Windows Store apps Parameter not available.
<Parameter1>: Type of the value sent to the window (optional)
First parameter that must be passed to the "Declaration of global variables" process 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 (the arrays can only be passed by address).
<Parameter2>: Type of the value sent to the window (optional)
Second parameter that must be passed to the "Declaration of global variables" process 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 (the arrays can only be passed by address).

注意

Parameters passed to the child window to open

The parameters are retrieved in the "Declaration process of global variables" of the window. To do so, specify the following line at the beginning of the process:

PROCEDURE <Window name> (<Parameter1> [, <Parameter2> [, ...]])

These parameters are passed by value and not by address.

Opening mode of the 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 打开子窗口 in the parent window are run.
  • the user will have the ability to click one of the parent windows of the opened window.
WinDev Note: 打开子窗口 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 无焦点 constant in the <Window Name> parameter.
To manage the MDI, use MDI打开.

Position of the parent window

The parent window always remains below the child window, even if the parent window is in edit.

If this situation does not suit you, the child window must be opened by 打开同级窗口 (providing that the parent window is a non-modal window).

WinDev用户代码(MCU)

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

  • 打开子窗口 must not be called in the initialization code of a project.
    WinDev To display a "splash screen" window at the start of the application, use the "Splash screen" option when creating the executable.
  • Windows Store apps 打开子窗口 must not be called in the closing code of a child window.

Closing a window

A window opened by 打开子窗口 can be closed by 关闭 (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 the window to open

By default, the title of the window is the one defined in the editor.

To modify the title of the window, use 下一个标题 or 当前标题.

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:

打开子窗口ComponentWindow

If a conflict occurs with a project element, the name of the element must be prefixed by the name of the component. For example:

打开子窗口MyComponent.Window

To use the name of the window in a variable, the name of the component must be specified. For example:

sWindow字符串型"MyComponent.MyWindow"
打开子窗口sWindow

组件
WinDev wd200obj.dll
Linux wd200obj.so