📄 dialog_programming.hlp
字号:
{pstd}
{it:xsize} and {it:ysize} may not be specified as {cmd:.} because they specify
the overall size of the dialog box. You can discover the size by
experimentation. If you specify a size that is too small, some elements will
flow off the dialog box. If you specify a size that is too large, there
will be large amounts of white space on the right and bottom of the dialog
box. Good initial guesses for {it:xsize} and {it:ysize} are 400 and 300.
{pstd}
{hi:POSITION} may be specified anywhere in the dialog code outside of
{hi:BEGIN} . . . {hi:END} blocks. It does not matter where it is specified
because the entire {cmd:.dlg} file is processed before the dialog box is
displayed.
{marker remarks3.5}
{title:3.5 LIST}
{title:Syntax}
{cmd:LIST} {it:newlistname}
{cmd:BEGIN}
{it:item}
{it:item}
. . .
{cmd:END}
{title:Description}
{pstd}
{hi:LIST} creates a named list for populating list and combo boxes.
{title:Example}
LIST choices
BEGIN
Statistics
Graphics
Data management
END
. . .
DIALOG . . .
BEGIN
. . .
LISTBOX . . . , . . . contents(choices) . . .
. . .
END
{marker remarks3.6}{...}
{title:3.6 DIALOG}
{title:Syntax}
{bind:{cmd:DIALOG} {it:newdialogname} {cmd:[,} {opt ti:tle}("{it:string}") {opt tab:title}("{it:string}"){cmd:]}}
BEGIN
{{it:control definition statements}|{cmd:INCLUDE}|{cmd:DEFINE}}
. . .
END
{title:Description}
{pstd}
{hi:DIALOG} defines a dialog. Every {cmd:.dlg} file should define at least one
dialog. Only control definition statements, {hi:INCLUDE}, and {hi:DEFINE}
are allowed between {hi:BEGIN} and {hi:END}.
{title:Options}
{phang}
{opt title}{cmd:("}{it:string}{cmd:")} defines the text to be displayed in the
dialog's title bar.
{phang}
{opt tabtitle}{cmd:("}{it:string}{cmd:")} defines the text to be displayed on
the dialog's tab. Dialogs are tabbed if more than one dialog is defined.
When a user clicks on the tab, the dialog becomes visible and active. If only
one dialog is specified, the contents of {opt tabtitle()} are irrelevant.
{title:Member functions}
{p2colset 5 27 29 2}{...}
{p2col :{cmd:settabtitle} {it:string}}sets tab title to {it:string}{p_end}
{p2col :{cmd:settitle} {it:string}}sets overall dialog box title to {it:string}{p_end}
{p2colreset}{...}
{pstd}
{cmd:settitle} may be called as a member function of any
dialog tab, but it is more appropriate to call it as a member
function of the dialog box. This is accomplished by calling it
in the local scope of the dialog.
{pstd}
Example:
{p 8 4 2}
{cmd: settitle "sort - Sort data"}
{marker remarks3.6.1}{...}
{title:3.6.1 CHECKBOX on/off input control}
{title:Syntax}
{p 8 12 2}
{hi:CHECKBOX} {it:newcontrolname} {it:x} {it:y} {it:xsize} {it:ysize}
{cmd:[,} {opt l:abel}{cmd:("}{it:string}{cmd:")}
{opt e:rror}{cmd:("}{it:string}{cmd:")}
{opt default(defnumval)} {opt nomem:ory}
{cmd:groupbox} {opt onclickon(iaction)}
{opt onclickoff(iaction)} {opt op:tion(optionname)}{cmd:]}
{title:Member functions}
{p2colset 5 27 29 2}{...}
{p2col :{cmd:setlabel} {it:string}}sets text to string{p_end}
{p2col :{cmd:setoff}}unchecks checkbox{p_end}
{p2col :{cmd:seton}}checks checkbox{p_end}
{p2colreset}{...}
{pstd}
The standard member functions {opt hide}, {opt show}, {opt disable},
{opt enable}, and {opt setposition} are also provided.
{title:Returned values for use in PROGRAM}
{pstd}
Returns numeric, 0 or 1, depending on whether the box is checked.
{title:Description}
{pstd}
{hi:CHECKBOX} defines a checkbox control, which indicates
an option that is either on or off.
{title:Options}
{phang}
{opt label}{cmd:("}{it:string}{cmd:")} specifies the text to be displayed next
to the control. You should specify text that clearly implies two opposite
states so that it is obvious what happens when the checkbox is checked or
unchecked.
{phang}
{opt error}{cmd:("}{it:string}{cmd:")} specifies the text to be displayed
describing this field to the user in automatically generated error boxes.
{phang}
{opt default(defnumval)} specifies whether the box is checked or unchecked
initially; it will be unchecked if {it:defnumval} evaluates to 0, and it will
be checked otherwise. If {opt default()} is not specified, {cmd:default(0)}
is assumed.
{phang}
{opt nomemory} specifies that the checkbox not remember how it was filled in
between invocations.
{phang}
{opt groupbox} makes this checkbox control also a group box into which other
controls can be placed to emphasize that they are related. The group box is just
an outline; it does not cause the controls "inside" to be disabled or hidden
or in any other way act differently than they would if they were outside the
group box. On some platforms, radio buttons have precedence over checkbox
group boxes. You may place radio buttons within a checkbox group box, but do
not place a checkbox group box within a group of radio buttons. If you do,
you may not be able to click on the checkbox control on some platforms.
{phang}
{opt onclickon(iaction)} and {opt onclickoff(iaction)} specify the i-actions
to be invoked when the checkbox is clicked on or off. This could be used, for
instance, to hide, show, disable, or enable other input controls. The default
i-action is to do nothing. Note that the {opt onclickon()} or
{opt onclickoff()} i-action will be invoked the first time the checkbox is
displayed.
{phang}
{opt option(optionname)} is a communication option that associates
{it:optionname} with the value of the checkbox.
{title:Example}
{psee}{cmd:CHECKBOX robust 10 10 100 ., label(Robust VCE)}{p_end}
{marker remarks3.6.2}{...}
{title:3.6.2 RADIO on/off input control}
{title:Syntax}
{p 8 15 2}
{cmd:RADIO} {it:newcontrolname} {it:x} {it:y} {it:xsize} {it:ysize}
{cmd:[,} {cmd:[}{opt f:irst}|{opt m:iddle}|{opt la:st}{cmd:]}
{opt l:abel}{cmd:("}{it:string}{cmd:")}
{opt e:rror}{cmd:("}{it:string}{cmd:")} {opt default(defnumval)}
{opt nomem:ory} {opt onclickon(iaction)} {opt onclickoff(iaction)}
{opt op:tion(optionname)}{cmd:]}
{title:Member functions}
{p2colset 5 27 29 2}{...}
{p2col :{cmd:setlabel} {it:string}}sets text to string{p_end}
{p2col :{cmd:seton}}checks the radio button and unchecks any other buttons
in the group{p_end}
{p2colreset}{...}
{phang}
The standard member functions {opt hide}, {opt show}, {opt disable},
{opt enable}, and {opt setposition} are also provided.
{title:Returned values for use in PROGRAM}
{pstd}
Returns numeric, 0 or 1, depending on whether the button is checked.
{title:Description}
{pstd}
{hi:RADIO} defines a radio button control in a radio-button group. Radio
buttons are used in groups of two or more to select mutually exclusive, but
related, choices when the number of choices is small. Selecting one radio
button automatically unselects the others in its group.
{title:Options}
{phang}
{opt first}, {opt middle}, and {opt last} specify whether this radio button is
the first, a middle, or the last member of a group. There must be one
{opt first} and one {opt last}. There can be zero or more {opt middle}
members. {opt middle} is the default if no option is specified.
{phang}
{opt label}{cmd:("}{it:string}{cmd:")} specifies the text to be displayed next
to the control.
{phang}
{opt error}{cmd:("}{it:string}{cmd:")} specifies the text to be displayed
describing this field to the user in automatically generated error boxes.
{phang}
{opt default(defnumval)} specifies whether the radio button is to start as
selected or unselected; it will be unselected if {it:defnumval} evaluates to 0
and will be selected otherwise. If {opt default()} is not specified,
{cmd:default(0)} is assumed unless {opt first} is also specified, in which
case {cmd:default(1)} is assumed. It is considered bad style to use
anything other than the first button as the default, so this option is rarely
specified.
{phang}
{opt nomemory} specifies that the radio button not remember how it was filled
in between invocations.
{phang}
{opt onclickon(iaction)} and {opt onclickoff(iaction)} specify that i-action
be invoked when the radio button is clicked on or clicked off. This could be
used, for instance, to hide, show, disable, or enable other input controls.
The default i-action is to do nothing. Note that the {opt onclickon()}
i-action will be invoked the first time the radio button is displayed if it is
selected.
{phang}
{opt option(optionname)} is a communication option that associates
{it:optionname} with the value of the radio button.
{title:Example}
{hi:RADIO} {cmd: r1 10 10 100 ., first label("First choice")}
{hi:RADIO} {cmd: r2 @ +20 @ ., middle label("Second choice")}
{hi:RADIO} {cmd: r3 @ +20 @ ., middle label("Third choice")}
{hi:RADIO} {cmd: r4 @ +20 @ ., last label("Last choice")}
{marker remarks3.6.3}{...}
{title:3.6.3 SPINNER numeric input control}
{title:Syntax}
{p 8 17 2}
{cmd:SPINNER} {it:newcontrolname} {it:x} {it:y} {it:xsize} {it:ysize}
{cmd:[,} {opt l:abel}{cmd:("}{it:string}{cmd:")}
{opt e:rror}{cmd:("}{it:string}{cmd:")}
{opt default(defnumval)} {opt nomem:ory} {opt min(defnumval)}
{opt max(defnumval)} {opt onchange(iaction)}
{opt op:tion(optionname)}{cmd:]}
{title:Member functions}
{p2colset 5 26 28 2}{...}
{p2col :{cmd:setvalue} {it:#}}sets the actual value of the spinner to {it:#}{p_end}
{p2col :{cmd:setrange} {it:min# max#}}sets the range of the spinner to {it:min# max#}{p_end}
{p2col :{cmd:setdefault} {it:#}}sets the default of the spinner to {it:#}. This does not
change the value shown in the spinner control.{p_end}
{p2colreset}{...}
{pstd}
The standard member functions {opt hide}, {opt show}, {opt disable},
{opt enable}, and {opt setposition} are also provided.
{title:Returned values for use in PROGRAM}
{pstd}
Returns numeric, the value of the spinner.
{title:Description}
{pstd}
{hi:SPINNER} defines a spinner, which displays an edit field that accepts
an integer number, which the user may either increment or decrement by
clicking up/down arrows.
{title:Options}
{phang}
{opt label}{cmd:("}{it:string}{cmd:")} specifies a description for the
control, but it does not display the label next to the spinner. If you want
to label the spinner, you must use a {hi:TEXT} static control.
{phang}
{opt error}{cmd:("}{it:string}{cmd:")} specifies the text to be displayed in
describing this field to the user in automatically generated error boxes.
{phang}
{opt default(defnumval)} specifies the initial integer value of the spinner.
If not specified, {opt min()} is assumed, and, if that is not specified, 0 is
assumed.
{phang}
{opt nomemory} specifies that the spinner not remember how it was filled in
between invocations.
{phang}
{opt min(defnumval)} and {opt max(defnumval)} set the minimum and maximum
integer values of the spinner. {cmd:min(0)} and {cmd:max(100)} are the
defaults.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -