Maptitude GISDK Help |
The following options are available for a dialog box:
Option |
Description |
Title: title_expression |
The title of the dialog box. This expression is evaluated after the Init macro of the dialog box is executed, if there is one, and must be a string. Changes in the value of this expression are reflected in the dialog box title. If this option is omitted, the name of the dialog box is used. |
Help: help_spec |
The topic in the help file to display if the user presses F1. help_spec can be a string expression. |
Location: loc_x, loc_y, loc_width, loc_height |
The expressions used to set the location of the dialog box. |
Resize: min_width, min_heigth |
Allows resizing the dialog box. min_width is the minimum allowed width,min_height is the minimum allowed width. |
There are two ways to indicate the position of a dialog box:
The optional hpos, vpos, width, and height values, described under Dialog Box Position
The Location option, described below
The Location option allows you to specify the horizontal position, vertical position, width, and height values as expressions. You may omit any of the position and size expressions, but you must precede any specified expressions by the appropriate number of commas. The expressions may be constants or variables.
If the expressions are variables, and if the user moves the dialog box, the values of these variables will be updated to reflect the new position. If these variables are stored (e.g., by declaring them as static variables in the Init macro), the dialog box will open at its new position the next time it is run. For more information on static variables, Variable Scope.
You can set the values of these variables in the Init macro. The following special values are available to represent the position keywords:
Position |
Keyword |
Value |
Horizontal |
Left |
-2 |
|
Right |
-3 |
|
Center |
null |
Vertical |
Top |
-2 |
|
Bottom |
-3 |
|
Center |
null |
This example shows how to declare these variables as static and set their values:
Dbox "Example" location: loc_x, loc_y
init do
static loc_x, loc_y
if loc_x = null then loc_x = -2 // left edge of screen
if loc_y = null then loc_y = -3 // bottom edge of screen
//other initialization
enditem
//other dialog box items
endDBox
This example shows how to allow resizing a dialog box:
Dbox "View File" (file, Title) ,,82.5,38.5 title: Title resize:15,5
init do
if GetFileInfo(file) = null then do
ShowMessage("File " + file + " was not found.")
Return()
end
on notfound do
ShowMessage("Unable to open " + file)
Return()
end
on error do
ShowMessage("Unable to open " + file)
Return()
end
fp = OpenFile(file, "r")
lines = null
While !FileAtEOF(fp) do
txt = ReadLine(fp)
lines = lines + txt + "\n"
end
CloseFile(fp)
endItem
edit text 1.5, 1, 80, 35 scrollbar variable: lines disabled resize: width,height
button "Close" 70,37, 11 default cancel resize: top,left do
Return()
endItem
endDbox
©2025 Caliper Corporation | www.caliper.com |