PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Opening a window
  • Opening a parent window
  • Opening a child window
  • Opening a sibling window
  • Opening with alias
  • Overlaying windows
  • Minimizing a window
  • "Free" window opened by OpenChild or OpenSister
  • MDI parent window
  • MDI child window
  • Reminder
  • Current window
  • Closing a child window or a sibling 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
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 sibling 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 Open.

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
MDIOpen is used to perform a non-modal opening of a "MDI child" window from a "MDI parent" window.
During the call to MDIOpen, the following processes are run:
  1. Running the "Global declarations" process of window.
  2. Running the initialization processes of controls (the order is undefined).
  3. Displaying the window (this window is always a 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). MDIWindowMenu is used to organize the display of the MDI child windows in the MDI parent window (cascading display or tiled display).
ReturnToCapture is used to force the input in the child window.
2. "Free" window opened as child window
OpenChild is used to perform a non-modal opening of the "Free" windows from a "MDI parent" window.
During the call to OpenChild, the following processes are run:
  1. Running the "Declaration of global variables" process of the child window,
  2. Running the initialization processes of controls (the order is undefined),
  3. Running the processes following the call to OpenChild of the parent window,
  4. Display 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.
ReturnToCapture is used to force the 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
MDIOpen 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
OpenSister is used to perform a non-modal opening of the "Free" windows from a child window.
During the call to OpenSister, the following processes are run:
  1. Running the "Declaration of global variables" process of the sibling window,
  2. Running the initialization processes of controls (the order is undefined),
  3. Running the processes following the call to OpenSister 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). MDIWindowMenu is used to organize the display of the MDI child windows in the MDI parent window (cascading display or tiled display).
ReturnToCapture is used to force the input in the sibling window.
Important: A window can be opened by OpenSister only if the window that requested the opening was opened by OpenChild or by OpenSister.

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 OpenSister, OpenChild or MDIOpen. 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 WinChangeAlias.
The alias is used to identify the windows with the functions that accept a window name in parameter (CurrentTitle, NextTitle, ReturnToCapture, ...) or to handle a control of a given window.
The alias is returned by CurrentWin or PreviousWin.
// Open CUSTFORM with CUSTOMER1 alias
OpenSister("CUSTOMER1=CUSTFORM")

// Change of window with input in CUSTNAME control
ReturnToCapture("CUSTOMER1.CUSTNAME")

// Handle a control with alias
WindowName is string
WindowName = PreviousWin()
IF WindowName.CustName = "" THEN
// Customer name not entered
Error("No customer name was entered")
ReturnToCapture(WindowName + ".CUSTNAME")
END
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:
  • above all windows (even the inactive ones), including windows from other current Windows applications, you must use the AboveAll constant (OpenChild, OpenSister or WinStatus).
  • above its sibling windows (even the inactive ones), you must use the Above constant (OpenChild, OpenSister or WinStatus).
Minimizing a window

"Free" window opened by OpenChild 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.
MDIWindowMenu is used to minimize all the MDI child windows and to restore them.

Reminder

A window can be minimized:
A window can be restored:
Current window
Once a window is opened, the current window is not modified.
  • CurrentWin returns the name of the window (or the name of the alias) currently in edit.
  • PreviousWin 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, ReturnToCapture forces the edit on the window whose name is passed in parameter (the window must contain at least one control in edit)
MDIActive 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 Close.
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 being closed, the following line must be added into the closing code of the child window:
// ControlName is a control of the child window
ReturnToCapture(ControlName)
To prevent a MDI child window from being closed, you must create a button associated with [ALT]+[F4] and enter the code of the button:
ReturnToCapture()
MDIWindowMenu is used to close all the opened MDI child windows.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment