PC SOFT

WINDEV的在线文档

  • Characteristics of the popup window
  • Parameters passed to the window to open
  • Which opening mode to choose?
  • Limits
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

打开弹出式窗口并指定位置 (函数)

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 a button for example).

例子
// Open the window for color selection
MyColor整数型
MyColor打开弹出式窗口并指定位置WIN_ColorSelectionWin弹出式窗口.底部+弹出式窗口.右边+弹出式窗口.根据控件,...
BTN_ActionColorCurrentColor
// If a color was selected
// (MyColor <= 0 if the window is canceled)
如果MyColor大于0,那么
// Keep the new selected color
CurrentColorMyColor
// Change the color of the button rectangle
BTN_Color..标签=图示矩形007216CurrentColor0
结束

语法
 <Result> = 打开弹出式窗口并指定位置(<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 the window to open.
<Opening Mode>: Combination of constants
Specify the position and the opening mode of the popup window. These constants are as follows:

弹出式窗口.底部The popup window will be opened below the calling control
弹出式窗口.右边The left border of the popup window will be aligned with the left border of the control. The popup window stretches to the right.
弹出式窗口.左边The right border of the popup window will be aligned with the right border of the control. The popup window stretches to the left.
弹出式窗口.顶部The popup window will be opened above the calling control
弹出式窗口.固定位置Disables the automatic positioning if the popup window may not be entirely visible on the screen
弹出式窗口.根据控件Opens the popup window according to the position of a control other than the calling control. In this case:
  • the name of the control must be specified (<Control Name>).
  • the name of the control will be automatically retrieved by 我的弹出控件.
<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 弹出式窗口.根据控件 constant was used.
<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. These parameters are passed by address and they are considered as being global variables of the window.
<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. These parameters are passed by address and they are considered as being global variables of the window.

注意

Characteristics of the popup window

  • The window is automatically closed when it loses focus or during the call to 关闭. 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 打开弹出式窗口并指定位置. 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 runs 打开弹出式窗口并指定位置. 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 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> [, ...]])

See Window with parameters for more details.

Which opening mode to choose?

Notes:

  • if you are only using the 弹出式窗口.底部 constant, the popup window will be opened at 弹出式窗口.右边 + 弹出式窗口.底部 position.
  • if you are only using the 弹出式窗口.顶部 constant, the popup window will be opened at 弹出式窗口.右边 + 弹出式窗口.顶部 position.

Limits

  • 打开弹出式窗口并指定位置 must be run from the code of a control.
  • The control from which 打开弹出式窗口并指定位置 is run must be visible.
  • A window that is not a modal window cannot be opened from a popup window. 打开 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 打开 and you must use 关闭 to close the popup window.
  • A popup window cannot be opened from a popup window.

组件
WinDev wd200obj.dll