|
Opens the form as a dialog.
Syntax 1
OpenDialog(
basedFormName
[,systemParam]
[,openParam]
)
Parameters
basedFormName
|
|
Type:
|
character
|
|
Specify the name of the original form you want to display as a dialog. The dialog will be displayed based on this form.
|
systemParam
|
|
Type:
|
General purpose
|
|
System parameters. Each element is "parameter name:value". To specify multiple elements, specify them as an array like this: c("parameter name 1:value 1", "parameter name 2:value 2",...). Note that this parameter does not support map values.
Parameters
|
Default value
|
explanation
|
viewName
|
""
|
Specifies the text name of the dialog view.If omitted, the name specified in basedFormName will be used.ViewIt must not overlap with the name.Regarding view namesFor more details"About form names and view names"See .
|
formName
|
""
|
Specify the name of the form after the dialog is displayed in text.This is the new form name to reference from the script. If omitted, the name specified in basedFormName will be used. It must not overlap with the currently displayed form name.
|
title
|
""
|
Specifies the title of the dialog in text.
|
left
|
-1
|
Specify the left coordinate of the dialog with a number. Specifying -1 will display it in the center. The base position of the coordinates is specified with basePosX. (The default is 0, which is the left edge of the browser.)
|
top
|
-1
|
The top coordinate of the dialog. Specify -1 to display it in the center. The base position of the coordinates is specified by the basePosY argument. (The default is 0, which is the top of the browser.)
|
width
|
-1
|
The width of the dialog. If you specify -1, the width of the dialog will be the same as the form.
|
height
|
-1
|
The height of the dialog. If you specify -1, the height of the dialog will be the same as the form's height.
|
minWidth
|
0
|
The minimum limit (width) of the dialog when it is reduced in size. If set to 0, there is no limit.
|
minHeight
|
0
|
The minimum limit (height) of the dialog when it is reduced in size. If set to 0, there is no limit.
|
stretch
|
DEFAULT
|
Specifies the stretch mode when the dialog is displayed.
NONE
|
Don't stretch.
|
STRETCH_FULL
|
The image is stretched to fit the size of the dialog.
|
STRETCH_KEEPRATE
|
The image will be stretched to fit the size of the dialog (maintaining aspect ratio).
|
RESIZE_FULL
|
Adjust the form size to fit the dialog size.
|
RESIZE_KEEPRATE
|
Adjust the form size to fit the size of the dialog (maintaining aspect ratio).
|
FORM
|
Matches the setting of the form's Strech property.
|
DEFAULT
|
Matches the setting of the route's Strech property.
|
*If this argument is not specified or if an empty string is specified, the root Strech property will be used.
|
dialogType
|
0
|
The type of dialog.
0
|
Normal (with close button)
|
1
|
Simple (no close button)
|
2
|
No frame (no title bar)
|
3
|
Full (with maximize, minimize and close buttons)
|
4
|
No frame (title bar) and no border
|
If the dialog is displayed in a way that does not display the close button, you must call ::CloseDialog to close the dialog.
|
resizable
|
F
|
If unspecified, the size will not be resizable.
T
|
Allow resizing.
|
F
|
Do not allow resizing.
|
|
basePosX
|
default
|
Specify the reference position in the X direction.
default
|
Follow the DialogBasePosX root property.
|
browser
|
The left edge of the browser is 0.
|
parent
|
The left edge of the parent screen (including dialogs) is 0.
|
desktop
|
The left edge of the desktop is 0.
|
|
basePosY
|
default
|
Specify the reference position in the Y direction.
default
|
Follows the DialogBasePosY root property.
|
browser
|
The top of the browser is 0.
|
parent
|
The top of the parent screen (including dialogs) is 0.
|
desktop
|
The top of the desktop is 0.
|
|
alreadyOpened
|
error
|
Specifies the behavior if the dialog is already displayed.
error
|
If it is already open, an error is returned.
|
show
|
If it is already open or hidden, it will be made visible. If it is open with OpenModalDialog, it will be made visible modally.
|
|
showState
|
show
|
Specifies the visibility of the dialog.
show
|
Opens the dialog in its normal state.
|
hide
|
Opens the dialog in a hidden state.
|
|
modal
|
F
|
Specifies whether the dialog is modal.
T
|
Opens in a modal view.
|
F
|
Opens in a non-modal (normal) view.
|
|
visualTheme
|
""
|
Specifies the visual theme name in text.
|
Example: When there is only one element
::OpenDialog("Form01","viewName:Dialog01");
Example: In the case of multiple elements
::OpenDialog("Form01",c("viewName:Dialog01","formName:dlgForm01","stretch:STRETCH_FULL","dialogType:1","resizable:T"));
|
openParam
|
|
Type:
|
General purpose
|
|
Open parameter. Each element is "parameter name:value". To specify an array, use c("parameter name 1:value 1", "parameter name 2:value 2",...). It is also possible to pass a map value generated by the MAP route method.
The information passed in the open parameters can be retrieved from the called form's script using the GetOpenParam method.
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Explanation
Opens a form as a dialog. You can also open multiple dialogs on the same form.
The dialog's form name, display position, size, and other behavior are specified in the second argument, the dialog parameters.
The "view name" specified in the dialog parameter viewName has the following two roles:
1.CloseDialog Specify this name when closing the dialog.
2.When opening a dialog with OpenDialog, this name is used to determine whether a dialog with the same view name is already open. If a dialog with the specified view name already exists, the dialog will not be displayed.
basedFormName is usually the name of the base form (e.g. "Form01").
If the same form name exists across multiple folders, you can specify it as folder name.form name (e.g. "Folder01.Form01").
|
Example
For specific examples of displaying a dialog using OpenDialog, see "Example of creating a user dialog".
If you simply want to display a form in a dialog, you only need to specify the form name.
|
event OnMouseUp(button)
{
::OpenDialog("Form01");
}
|
After a dialog is opened, you can access it from the calling script by its form name.
If you omit the dialog parameter formName, the form name specified in the argument will be used, so you can access it as follows:
|
event OnMouseUp(button)
{
::OpenDialog("Form01");
::Form01.Label1.Text = "Hello";
}
|
Normally, you cannot open two of the same form at the same time. If you want to open one form as multiple dialogs at the same time, you need to specify different view names in the viewName dialog parameter.
If you write it as follows, two dialogs of the same form will be displayed.
|
event OnMouseUp(button)
{
::OpenDialog("Form01","viewName:Dialog01");
::OpenDialog("Form01","viewName:Dialog02");
}
|
Furthermore, if you omit the dialog parameter formName as shown above, the form name specified in the argument will be used, and there will be two forms with the same name (when referenced from a script, the form that is found first will be used).
So if you need to access the forms of each dialog from your script, specify the different form names in the dialog parameters.
|
event OnMouseUp(button)
{
::OpenDialog("Form01",c("viewName:Dialog1","formName:DlgForm01"));
::OpenDialog("Form01",c("viewName:Dialog2","formName:DlgForm02"));
::DlgForm01.Label1.Text = "Hello";
::DlgForm02.Label1.Text = "Hello";
}
|
|

|
Dialog-related methods are provided as common methods.
For example, it can be executed as a form method, like "this.OpenDialog (...)", or as a root method, like "::OpenDialog(...)".
Regardless of how you call it, the dialog will not be hidden behind the form, but the behavior will differ if multiple dialogs are displayed at the same time.
■ When executed as a form method
The displayed dialog will always be displayed in front of the object that called it (it will never be hidden behind the object that called it).
In other words, if you display another dialog from the form of a displayed dialog, such as "this.OpenDialog (...)", the latter dialog will be displayed in front of the earlier dialog, and will not be hidden behind the calling dialog, even if you click on it.
■ When executed as a route method
If multiple dialogs are displayed as a root method ("::OpenDialog(...)"), each dialog will be positioned at the same hierarchy, allowing the operator to freely move between multiple dialogs with the mouse.
|

|
When you open a dialog, you might want to prevent touching the rear screen until the dialog is closed.In such cases, you can deal with the problem by displaying the dialog modally (displayed in the foreground). In a modal display, the window is displayed in the foreground and cannot be operated or moved forward or backward. In addition to specifying T for the system parameter "modal" when calling this method, you can also display the dialog modally using the "OpenModalDialog" method.
If you want to change only the visibility state without closing the dialog (if you want to only show/hide), use the root ShowDialog method.
|
Syntax 2
OpenDialog(
viewName,
basedFormName,
[,formName]
[,title = ""]
[,left = -1]
[,top = -1]
[,width = -1]
[,height = -1]
[,stretch = "default"]
[,dialogType = 0]
[,resizable = FALSE]
[,basePosX = "default"]
[,basePosY = "default"]
[,openParam]
)
Parameters
viewName
|
|
Type:
|
character
|
|
The name of the view (any name). For details, see"About form names and view names"If omitted, the name specified in basedFormName will be the view name.
|
basedFormName
|
|
Type:
|
character
|
|
Specify the name of the original form you want to display as a dialog. The dialog will be displayed based on this form.
|
formName
|
|
Type:
|
character
|
|
Name of the form after display (any name). Specify a new form name to reference from the script. If omitted, the name specified in basedFormName will be the form name to reference from the script. This form name must not overlap with the main form or the form name of the open dialog.
|
title
|
|
Type:
|
character
|
|
The title of the dialog.
|
left
|
|
Type:
|
Number
|
|
The left coordinate of the dialog. Specifying -1 will display it in the center. The base position of the coordinates is specified by the basePosX argument. (The default is 0, which is the left edge of the browser.)
|
top
|
|
Type:
|
Number
|
|
The top coordinate of the dialog. Specify -1 to display it in the center. The base position of the coordinates is specified by the basePosY argument. (The default is 0, which is the top of the browser.)
|
width
|
|
Type:
|
Number
|
|
The width of the dialog. If you specify -1, the width of the dialog will be the same as the form.
|
height
|
|
Type:
|
Number
|
|
The height of the dialog. If you specify -1, the height of the dialog will be the same as the form's height.
|
stretch
|
|
Type:
|
character
|
|
The form size will be increased to fit the dialog size.
"NONE" - no stretching
"STRETCH_FULL" - Stretch to fit the size of the dialog.
"STRETCH_KEEPRATE" - Stretch the image to fit the size of the dialog (keep aspect ratio)
"RESIZE_FULL" - Adjust form size to fit dialog size
"RESIZE_KEEPRATE" - Adjust form size to fit dialog size (keep aspect ratio)
"FORM" - Match the setting of the form's Strech property
"DEFAULT" - Matches the setting of the route's Strech property
*If this argument is not specified or if an empty string is specified, the root Strech property will be used.
|
dialogType
|
|
Type:
|
Number
|
|
The type of dialog.
0 - Normal (with close button)
1-Simple (no close button)
2- No Frame (No Title Bar)
3- Full (with maximize, minimize and close buttons)
In the "1-Simple" case, you need to call ::CloseDialog to close the dialog.
|
resizable
|
|
Type:
|
Boolean
|
|
If unspecified, the size will not be resizable.
|
basePosX
|
|
Type:
|
character
|
|
The reference X-position.
"default" - follows the DialogBasePosX root property
"browser" - The left edge of the browser is 0.
"parent" - The left edge of the parent screen (including dialogs) is 0.
"desktop" - The left edge of the desktop is 0.
|
basePosY
|
|
Type:
|
character
|
|
The reference Y position.
"default" - follows the DialogBasePosY root property
"browser" - The top of the browser is 0.
"parent" - The top edge of the parent screen (including dialogs) is 0.
"desktop" - The top edge of the desktop is 0.
|
openParam
|
|
Type:
|
General purpose
|
|
Open parameter. Each element is "parameter name:value". To specify an array, use c("parameter name 1:value 1", "parameter name 2:value 2",...). It is also possible to pass a map value generated by the MAP route method.
The information passed in the open parameters can be retrieved from the called form's script using the GetOpenParam method.
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Explanation
Syntax 2 of the OpenDialog method is the old calling format prior to Ver6REV11.
Opens a form as a dialog. You can also open multiple dialogs on the same form.
The first argument, the view name, has two roles:
1.CloseDialog Specify this name when closing the dialog.
2.When opening a dialog with OpenDialog, this name is used to determine whether a dialog with the same view name is already open. If a dialog with the specified view name already exists, the dialog will not be displayed.
basedFormName is usually the name of the base form (e.g. "Form01").
If the same form name exists across multiple folders, you can specify it as folder name.form name (e.g. "Folder01.Form01").
|
Example
Below is an example of a simple form dialog.
|
event OnMouseUp(button)
{
::OpenDialog("Dialog01", "Form01");
}
|
Normally you cannot have two of the same form open at the same time. If you want to open one form as multiple dialogs at the same time, you need to specify different view names.
If you write it as follows, two dialogs of the same form will be displayed.
|
event OnMouseUp(button)
{
::OpenDialog("Dialog01", "Form01", "DlgForm01");
::OpenDialog("Dialog02", "Form01", "DlgForm02");
}
|
To access the dialog from the calling script after it has been opened, use the form name specified in the third argument as follows:
|
event OnMouseUp(button)
{
::OpenDialog("Dialog01", "Form01", "DlgForm01");
::DlgForm01.Title.Text = "Hello";
}
|
|
Supported
reference
OpenDialog
OpenModalDialog
CloseDialog
|