📄 dialog_programming.hlp
字号:
Returns string, the contents of the edit field.
{title:Description}
{pstd}
{hi:EDIT} defines an edit field. An edit field is a box into which the
user may enter and edit text; the width of the box does not limit how much
text can be entered.
{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 edit field. If you
want to label the edit field, 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(defstrval)} specifies the default contents of the edit field. If
not specified, {opt default("")} is assumed. When there is default text, the
current cursor position will be at the end of the text.
{phang}
{opt nomemory} specifies that the edit field is not to remember how it was
filled in between invocations.
{phang}
{opt max(#)} specifies the maximum number of characters that may be entered
into the edit field.
{phang}
{opt numonly} specifies the edit field as only being able to contain period,
numeric characters 0 through 9, and {cmd:-} (minus).
{phang}
{opt password} specifies that the characters entered into the edit field be
shown on the screen as asterisks or bullets, depending on the operating
system.
{phang}
{opt onchange(iaction)} specifies the i-action to be invoked when the contents
of the edit field are changed. The default i-action is to do nothing. Note
that the {opt onchange()} i-action will be invoked the first time the spinner
is displayed.
{phang}
{opt onclick(iaction)} specifies the i-action to be invoked when the user
clicks in the edit field.
{phang}
{opt option(optionname)} is a communication option that associates
{it:optionname} with the contents of the edit field.
{title:Example}
{hi:TEXT} {cmd:tlab 10 10 200 ., label("Title")}
{hi:EDIT} {cmd:title @ +20 @ ., label("title")}
{marker remarks3.6.5}
{title:3.6.5 VARLIST and VARNAME string input controls}
{title:Syntax}
{p 8 19 2}
{{hi:VARLIST}|{hi:VARNAME}} {it:newcontrolname}
{it:x} {it:y} {it:xsize} {it:ysize} {cmd:[,}
{opt l:abel}("{it:string}") {opt e:rror}("{it:string}")
{opt default(defstrval)} {opt nomem:ory} {cmd:allowcat allowts}
{opt op:tion(optionname)}]{p_end}
{title:Member functions}
{p2colset 5 30 32 2}{...}
{p2col :{opt setlabel} {it:string}}sets the label for the varlist edit
field{p_end}
{p2col :{opt setvalue} {it:string}}sets the value shown in the varlist edit field{p_end}
{p2col :{opt append} {it:string}}appends {it:string} to the value in the varlist edit field{p_end}
{p2col :{opt prepend} {it:string}}prepends {it:string} to the value of the varlist edit field{p_end}
{p2col :{opt insert} {it:string}}inserts {it:string} at the current cursor position of the varlist edit field{p_end}
{p2col :{opt smartinsert} {it:string}}smartly inserts {it:string} at the
current cursor position in the varlist edit field. A {opt smartinsert}
ensures that the inserted text will have leading and trailing spaces around
it.{p_end}
{p2colreset}{...}
{pstd}
The standard member functions {opt hide}, {opt show}, {opt disable}, and
{opt enable} are also provided.
{title:Returned values for use in PROGRAM}
{pstd}
Returns string, the contents of the varlist edit field.
{title:Description}
{pstd}
{hi:VARLIST} and {hi:VARNAME} are special cases of an edit field.
{hi:VARLIST} provides an edit field into which one or more Stata variable
names may be entered (along with standard Stata varlist abbreviation), and
{hi:VARNAME} provides an edit field into which one Stata variable name may be
entered (with standard Stata varname abbreviations allowed).
{title:Options}
{phang}
{opt label}{cmd:("}{it:string}"{cmd:)} specifies a description for the control
but does not display the label next to the varlist edit field. If you want to
label the control, you must use a {hi:TEXT} static control.
{pmore}
In addition, when the {hi:VARNAME} or {hi:VARLIST} input control receives the
focus, the {opt label()} is displayed at the top of the Variables window to
indicate that clicking on variables will result in their being copied to the
{hi:VARNAME} or {hi:VARLIST} 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(defstrval)} specifies the default contents of the edit field. If
not specified, {opt default("")} is assumed.
{phang}
{opt nomemory} specifies that the edit field not remember how it was filled in
between invocations.
{phang}
{opt allowcat} specifies that the control allows {opt xi}-style
categorical/interaction terms; see {helpb xi}.
{phang}
{opt allowts} specifies that the control allows time-series operators; see
{helpb tsvarlist}.
{phang}
{opt option(optionname)} is a communication option that associates
{it:optionname} with the contents of the edit field.
{title:Example}
{hi:TEXT} {cmd:dvlab 10 10 200 ., label("Dependent variable")}
{hi:VARNAME} {cmd:depvar @ +20 @ ., label("dep. var")}
{hi:TEXT} {cmd:ivlab @ +30 @ ., label("Independent variables")}
{hi:VARLIST} {cmd:idepvars @ +20 @ ., label("ind. vars.")}
{marker remarks3.6.6}{...}
{title:3.6.6 FILE string input control}
{title:Syntax}
{p 8 16 2}
{cmd:FILE} {it:newcontrolname} {it:x} {it:y} {it:xsize} {it:ysize}
{cmd:[,} {opt l:abel}("{it:string}") {opt e:rror}("{it:string}")
{opt default(defstrval)} {opt nomem:ory} {opt buttonw:idth(#)}
{opt dialogti:tle(string)} {cmd:save} {opt filter(string)}
{opt onchange(iaction)} {opt op:tion(optionname)}{cmd:]}
{title:Member functions}
{p2colset 5 30 32 2}{...}
{p2col :{opt setlabel} {it:string}} sets the label shown on the edit button{p_end}
{p2col :{opt setvalue} {it:string}} sets the value shown in the edit field{p_end}
{p2col :{opt append} {it:string}} appends {it:string} to the value in the edit field{p_end}
{p2col :{opt prepend} {it:string}} prepends {it:string} to the value of the edit field{p_end}
{p2col :{opt insert} {it:string}} inserts {it:string} at the current cursor position of the edit field{p_end}
{p2col :{opt smartinsert} {it:string}} smartly inserts {it:string} at the
current cursor position in the edit field. A {opt smartinsert} ensures that
the inserted text will have leading and trailing spaces around it.{p_end}
{p2colreset}{...}
{pstd}
The standard member functions {opt hide}, {opt show}, {opt disable}, and
{opt enable} are also provided.
{title:Returned values for use in PROGRAM}
{pstd}
Returns string, the contents of the edit field (the file chosen).
{title:Description}
{pstd}
{hi:FILE} is a special edit field with a button on the right for selecting a
filename. When the user clicks on the button, a file dialog is displayed. If
the user selects a filename and clicks {hi:OK}, that filename is put into the
edit field. The user may alternatively type a filename into the edit field.
{title:Options}
{phang}
{opt label}{cmd:("}{it:string}{cmd:")} specifies the text to appear on the button. The
default is {bind:{cmd:("Browse . . .")}}.
{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(defstrval)} specifies the default contents of the edit
field. If not specified, {opt default("")} is assumed.
{phang}
{opt nomemory} specifies that the edit field not remember how it was filled in
between invocations.
{phang}
{opt buttonwidth(#)} specifies the width in pixels of the button. The default
is {cmd:buttonwidth(80)}. The overall size specified in {it:xsize} includes
the button.
{phang}
{opt dialogtitle(string)} is the title to show on the file dialog when you
click on the file button.
{phang}
{opt save} specifies that the file dialog allows the user to choose a filename
for saving rather than one for opening.
{phang}
{opt filter} consists of pairs of descriptions and wildcard file selection
strings separated by "{opt |}", such as
{pmore}
{cmd:filter("Stata Graphs|*.gph|All Files|*.*")}
{phang}
{opt onchange(iaction)} specifies an i-action to be invoked when the user
changes the chosen file. The default i-action is to do nothing. Note that
the {opt onchange()} i-action will be invoked the first time the file chooser
is displayed.
{phang}
{opt option(optionname)} is a communication option that associates
{it:optionname} with the contents of the edit field.
{title:Example}
{psee}{cmd:FILE fname 10 10 300 ., error("Filename to open") label("Browse . . .")}{p_end}
{marker remarks3.6.7}{...}
{title:3.6.7 LISTBOX list input control}
{title:Syntax}
{p 8 19 2}
{cmd:LISTBOX} {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 nomem:ory} {opt cont:ents(conspec)} {opt val:ues(listname)}
{opt ondblclick(iaction)}
{cmd:[}{opt onselchange(iaction)}|{opt onselchangelist(listname)}{cmd:]}
{opt op:tion(optionname)}{cmd:]}
{title: Member functions}
{p2colset 8 26 28 2}{...}
{p2col :{opt setlabel} {it:string}}sets the label for the list box{p_end}
{p2col :{opt setvalue} {it:string}}sets the currently selected item{p_end}
{p2colreset}{...}
{pstd}
The standard member functions {opt hide}, {opt show}, {opt disable}, and
{opt enable} are also provided.
{title: Returned values for use in PROGRAM}
{pstd}
Returns string, the text of the item chosen, or, if {opt values(listname)} is
specified, the text from the corresponding element of {it:listname}.
{title: Description}
{pstd}
{hi:LISTBOX} defines a list box control. Like radio buttons, a list box
allows the user to make a selection from a number of mutually exclusive, but
related, choices, yet is more appropriate when the number of choices is large.
{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 control. If you want to
label the list box, 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 nomemory} specifies that the list box not remember the item selected
between invocations. Note that there is no {opt default()} for a list box,
but even so, list boxes remember previous selections by default.
{phang}
{opt contents(conspec)} specifies the items to be shown in the list box from
which the user may choose. If {opt contents()} is not specified, the list box
will be empty.
{phang}
{opt values(listname)} specifies the list (see {hi:Section 3.5}) for which the
values of {opt contents()} should match one-to-one. When the user chooses the
{it:k}th element from {opt contents()}, the {it:k}th element of {it:listname}
will be returned. If the lists do not match one-to-one, extra elements of
{it:listname} are ignored, and extra elements of {opt contents()} return
themselves.
{phang}
{opt ondblclick(iaction)} specifies the i-action to be invoked when an item in
the list is double clicked. Note that the double-clicked item is selected
before the {it:iaction} is invoked.
{phang}
{opt onselchange(iaction)} and {opt onselchangelist(listname)} are
alternatives. They specify the i-action to be invoked when a selection in the
list changes.
{pmore}
{opt onselchange(iaction)} performs the same i-action regardless of which
element of the list was chosen.
{pmore}
{opt onselchangelist(listname)} specifies a vector of {it:iactions} that
should match one-to-one with {opt contents()}. If the user selects the
{it:k}th element of {opt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -