ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / MDI functions
  • Parameters passed to the window to open
  • Window opening mode
  • Number of opened windows
  • Closing a window
  • Minimized window
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Opens and enables an MDI child window.
MDIOpen is also used to:
  • define the alias of the window,
  • define the title of the window to open,
  • pass parameters to the window.
The following events are run when MDIOpen is called:
  • Running the "Global declarations" event of the window.
  • Running the initialization events of the controls (the order is undefined).
The window is then displayed (this window is always a child window of the MDI parent window). This window cannot be moved outside the MDI area of the MDI parent window.
Remark: MDIOpen only opens the windows defined as "MDI child windows" in the window editor. A MDI child window can be opened only if the MDI parent window exists and if it is opened.
Example
// Open the "WIN_CustomerInput" window
// The title of the window is "New customer"
// Value1 and Value2 are passed to the "Global declarations" event of the "WIN_CustomerInput" window 
ResAlias = MDIOpen(WIN_CustomerInput, "New customer alias", "New customer", Value1, Value2)
Syntax
<Result> = MDIOpen(<Window> [, <Alias name> [, <Window title> [, <Parameter 1> [... [, <Parameter N>]]]]])
<Result>: Character string
Alias generated for the window to open. The same window can be opened several times. This alias is used to identify the opened window. This alias can be modified by WinChangeAlias.
<Window>: Window name
  • Name of the window to be opened.
  • Name and full path of the window (".WDW" file) to open.
<Alias name>: Character string
Alias of the window. An alias is automatically generated ("A0001" for example) if this parameter is not specified or if it corresponds to an empty string ("").
<Window title>: Character string
Title of the window to be opened. If this parameter is not specified or if it corresponds to an empty string (""), the window title is the one defined in the editor.
<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 global variable of the window.
This parameter cannot contain any array variables (the 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 global variable of the window.
This parameter cannot contain any array variables (the arrays can only be passed by reference).
Remarks

Parameters passed to the window to open

The parameters are retrieved in the "Global declarations" event of the window. The first line of code of this event must correspond to the following line:
PROCEDURE <Window name> (<Parameter 1> [,<Parameter 2> [, ...]])
These parameters are passed by value and not by reference.
For more details, see Window with parameters.

Window opening mode

The window is opened in non-modal mode:
  • The MDI parent window remains the current window.
  • Once the MDI child window is opened, the processes following the call to MDIOpen are executed.
  • The user will be able to click in the parent window of the opened window.

Number of opened windows

The number of windows that can be opened simultaneously depends on the available memory.

Closing a window

A window opened with MDIOpen can be closed with Close (without parameters) from any event associated with the window or a control in the window.
If an MDI parent window is closed, its MDI child windows are also closed.

Minimized window

If the MDI child window is minimized, only this window is minimized.
The displayed icon is:
  • the one of the minimized window if the current window has an icon,
  • the one of the current project if the current window has no icon.
Related Examples:
WD Multi-Windowing Training (WINDEV): WD Multi-Windowing
[ + ] This example presents the basic concepts for managing the multi-windowing and the dynamic tabs with WINDEV.

This example includes a simple interface for managing the customer forms:
- multi-windowing with MDI interface,
- multi tabs with a dynamic tab control.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
exemplo mdi
https://windevdesenvolvimento.blogspot.com/2021/05/dicas-3345-windev-webdev-mobile-como.html
https://youtu.be/VeBSVmXatSE

IF WinStatus(WIN_Pdf)=NotFound THEN
OpenChild(WIN_Pdf)
ELSE
Restore(WIN_Pdf)
END

amarildo
03 Jun. 2021

Last update: 09/12/2023

Send a report | Local help