PC SOFT

WINDEV的在线文档

  • Overview
  • Opening a window
  • Overlaying windows
  • Minimizing a window
  • Current window
  • Closing a child window or a sibling window
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问
Non-modal management of a window

Overview
The window that opens another window is called parent window ; the windows opened by the parent window are called child windows. All the child windows opened by the same parent window are sibling windows.

This opening mode allows you to manage the multi-windowing.

In non-modal opening of a child window:

  • the child window can be in edit at the same time as the parent window that opened it.
  • once a child window is closed, another child window becomes the current window; if there is no child window, the parent window becomes the current window
  • if the parent window is closed, its child windows are closed. If a child window refuses to be closed, the parent window and the child windows following this window will not be closed.
  • if the child window is minimized, the other windows are not minimized. The icon of the window is the one of the window (or the one of the project if the window has no icon).
  • if the parent window is minimized, all the child windows become temporarily invisible.
Non-modal opening of a sibling window:
  • all the sibling windows can be in edit at the same time.
  • once a child window is closed, another child window becomes the current window.
  • if the sibling window is minimized, the other windows are not minimized. The icon of the window is the one of the window (or the one of the project if the window has no icon).

Opening a window
Opening a parent window

A parent window is opened by 打开.

Opening a child window

A child window is opened from a MDI parent window. These child windows can have the following types:
  • "MDI child"
  • "Free"
The opening mode of the window depends on the type of the window.

1. "MDI child" window

MDI打开 is used to perform a non-modal opening of a "MDI child" window from a "MDI parent" window.

During the call to MDI打开, the following processes are run:

1. Running the "Declaration code of the global variables" of the window.

2. Running the initialization code of the control (the order is undefined).

3. Displaying the window (this window is still the child window of the MDI parent window).
Note: The MDI child windows are always opened in the parent window (they cannot be displayed outside the parent window). MDI菜单窗口 is used to organize the display of the MDI child windows in the MDI parent window (cascading display or tiled display).

重新输入 is used to force input in the child window.

2. "Free" window opened as child window

打开子窗口 is used to perform a non-modal opening of the "Free" windows from a "MDI parent" window.

During the call to 打开子窗口, the following processes are run:

1. Running the "Declaration code of the global variables" of the child window,

2. Running the initialization code of the control (the order is undefined),

3. Running the processes that follow the call to 打开子窗口 of the parent window,

4. Displaying the child window (the parent window remains the current window).
Note: The non-MDI child windows can be displayed outside the parent window, they can be displayed anywhere on the screen.

重新输入 is used to force input in the child window.

Opening a sibling window

A sibling window is opened from a child window. These child windows can have the following types:
  • "MDI child"
  • "Free"
The opening mode of the window depends on the type of the window.

1. "MDI child" window

MDI打开 is used to perform a non-modal opening of a "MDI child" window from a "MDI parent" window or from a "MDI child" window. The different child windows are sibling windows.

2. "Free" window opened as sibling window

打开同级窗口 is used to perform a non-modal opening of the "Free" windows from a child window.

During the call to 打开同级窗口, the following processes are run:

1. Running the "Declaration code of the global variables" of the sibling window,

2. Running the initialization codes of the controls (the order is undefined),

3. Running the processes following the call to 打开同级窗口 of the calling window,

4. Displaying the sibling window.
Note: The MDI sibling windows are always opened in the parent window (they cannot be displayed outside the parent window). MDI菜单窗口 is used to organize the display of the MDI child windows in the MDI parent window (cascading display or tiled display).

重新输入 is used to force the input in the sibling window.

Important: A window can be opened by 打开同级窗口 only if the window that requested the opening was opened by 打开子窗口 or 打开同级窗口.

Opening with alias

The same window (child or sibling window) can be opened several times. This window is its own sibling window. Each opened window is identified by an alias. The alias is passed in parameter to 打开同级窗口, 打开子窗口 or MDI打开. If no alias is specified when opening a window that is already opened, WinDev automatically assigns an alias to the window.

Note: The alias can be modified by 窗口改变别名.

The alias is used to identify the windows with the functions that accept a window name in parameter (当前标题, 下一个标题, 重新输入...) or to handle a control of a given window.

The alias is returned by 窗口当前所在 or 窗口上一个.

// Open CUSTFORM with CUSTOMER1 alias
打开同级窗口"CUSTOMER1=CUSTFORM"

// Change of window with input in the CUSTNAME control
重新输入"CUSTOMER1.CUSTNAME"

// Handle a control with alias
WindowName字符串型
WindowName窗口上一个()
如果WindowName.CustName"",那么
// Customer name not entered
错误"No customer name was entered"
重新输入WindowName+".CUSTNAME"
结束

Overlaying windows
After its opening, a child window is displayed "on the top" of the parent window and a sibling window is displayed on top of the last but one sibling window.

To specify that the opened window is displayed:

Minimizing a window
MDI parent window:

"Free" window opened by 打开子窗口 or OpenSister:

If the window is minimized, the other windows are not minimized. The icon used is the one of the window (or the one of the project if the window has no associated icon).

MDI parent window:

If the window is minimized, all the child windows are minimized. The icon used is the one of the window (or the one of the project if the window has no associated icon).

MDI child window:

When it is minimized, the window is minimized in the parent window, the icon appears in the title bar.

MDI菜单窗口 is used to minimize all the MDI child windows and to restore them.

Reminders:

A window can be minimized:

A window can be restored:

Current window
Once a window is opened, the current window is not modified.
  • 窗口当前所在 returns the name of the window (or the name of the alias) where the input is currently performed.
  • 窗口上一个 returns the name of the window (or the name of alias) that was previously in edit.
To change the window currently in edit:
  • the user clicks another window
  • by programming, 重新输入 forces the input on the window whose name is passed in parameter (the window must contain at least one control in edit)
MDI启用 returns the name of the MDI child window that is displayed in the foreground.

Closing a child window or a sibling window
The child windows and the sibling windows are closed by 关闭.

Once a child window is closed, one of its sibling windows becomes active. If no sibling window exists, the parent window becomes active.

Once a sibling window is closed, another sibling window becomes the current window.

If the parent window is closed, its child windows are closed. If a child window refuses to be closed, the closing is interrupted: the parent window and the sibling windows that follow the child window are not closed ; the child windows that are already closed remain closed.

To prevent a non-MDI child window from closing, the following line must be added into the closing code of the child window:

// ControlName is a control of the child window
重新输入ControlName

To prevent a MDI child window from closing, you must create a button associated with [ALT]+[F4] and enter the code of the button:

重新输入()

MDI菜单窗口 is used to close all the opened MDI child windows.