2 '\" Copyright (c) 1995 DSC Technologies Corporation
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\" @(#) entryfield.n 1.21 94/12/17 16:04:44
12 '\" Note: do not modify the .SH NAME line immediately below!
14 entryfield \- Create and manipulate a entry field widget
16 \fBentryfield\fI \fIpathName \fR?\fIoptions\fR?
18 itk::Widget <- LabeledWidget <- entryfield
19 .SH "STANDARD OPTIONS"
23 \fBbackground\fR \fBborderWidth\fR \fBcursor\fR \fBexportSelection\fR
24 \fBforeground\fR \fBhighlightColor\fR \fBhighlightThickness\fR \fBinsertBackground\fR
25 \fBinsertBorderWidth\fR \fBinsertOffTime\fR \fBinsertOnTime\fR \fBinsertWidth\fR
26 \fBjustify\fR \fBrelief\fR \fBselectBackground\fR \fBselectBorderWidth\fR
27 \fBselectForeground\fR \fBtextVariable\fR \fBwidth\fR
30 See the "options" manual entry for details on the standard options.
31 .SH "ASSOCIATED OPTIONS"
35 \fBshow\fR \fBstate\fR
38 See the "entry" manual entry for details on the associated options.
39 .SH "INHERITED OPTIONS"
43 \fBdisabledForeground\fR \fBlabelBitmap\fR \fBlabelFont\fR \fBlabelImage\fR
44 \fBlabelMargin\fR \fBlabelPos\fR \fBlabelText\fR \fBlabelVariable\fR
48 See the "labeledwidget" class manual entry for details on the
50 .SH "WIDGET-SPECIFIC OPTIONS"
53 Name: \fBchildSitePos\fR
55 Command-Line Switch: \fB-childsitepos\fR
58 Specifies the position of the child site in the entry field: \fBn\fR,
59 \fBs\fR, \fBe\fR, or \fBw\fR. The default is e.
64 Command-Line Switch: \fB-command\fR
67 Specifies a Tcl command to be executed upon detection of a Return key
73 Command-Line Switch: \fB-fixed\fR
76 Restrict entry to the specified number of chars. A value of 0, which is the
77 default, denotes no limit. The value is the maximum number of chars the
78 user may type into the field, regardles of field width. For example,
79 if the field width is set to 20 and the fixed value is 10, the user will
80 only be able to type 10 characters into the field which is 20 characters long.
83 Name: \fBfocusCommand\fR
85 Command-Line Switch: \fB-focuscommand\fR
88 Specifies a Tcl command to be executed upon reception of focus.
93 Command-Line Switch: \fB-invalid\fR
96 Specifies a Tcl command to be executed upon determination of invalid input.
100 Name: \fBtextBackground\fR
101 Class: \fBBackground\fR
102 Command-Line Switch: \fB-textbackground\fR
105 Background color for inside textual portion of the entry field. The value
106 may be given in any of the forms acceptable to \fBTk_GetColor\fR.
111 Command-Line Switch: \fB-textfont\fR
114 Name of font to use for display of text in entryfield. The value
115 may be given in any of the forms acceptable to \fBTk_GetFont\fR.
120 Command-Line Switch: \fB-validate\fR
123 The validate option allows specification of a validation mechanism. Standard
124 character validation such as \fBnumeric\fR, \fBalphabetic\fR, \fBinteger\fR,
125 \fBhexidecimal\fR, \fBreal\fR, and \fBalphanumeric\fR can be handled through
126 the use of keywords. Should more
127 extensive validation be necessary, the value may contain the name of
128 a command script. The script should return a boolean value. True for
129 valid, false for invalid. If false is returned, then the procedure
130 associated with the invalid option will be invoked.
131 If the validation script contains
132 any \fB%\fR characters, then the script will not be
133 executed directly. Instead, a new script will be
134 generated by replacing each \fB%\fR, and the character following
135 it, with information from the entryfield. The replacement
136 depends on the character following the \fB%\fR, as defined in the
140 Replaced with the current input character.
143 Replaced with the contents of the entryfield modified to include the latest
144 keystoke. This is equivalent to peeking at the future contents, enabling
145 rejection prior to the update.
148 Replaced with the current contents of the entryfield prior to the latest
149 keystroke being added.
152 Replaced with the entryfield widget pathname.
158 The \fBentryfield\fR command creates an enhanced text entry widget with an
159 optional associated label. Addtional options support validation and
160 establishing a upper limit on the number of characters which may be
161 entered in the field.
166 The \fBentryfield\fR command creates a new Tcl command whose
167 name is \fIpathName\fR. This
168 command may be used to invoke various
169 operations on the widget. It has the following general form:
171 \fIpathName option \fR?\fIarg arg ...\fR?
173 \fIOption\fR and the \fIarg\fRs
174 determine the exact behavior of the command. The following
175 commands are possible for entryfield widgets:
176 .SH "ASSOCIATED METHODS"
180 \fBdelete\fR \fBget\fR \fBicursor\fR \fBindex\fR
181 \fBinsert\fR \fBscan\fR \fBselection\fR \fBxview\fR
184 See the "entry" manual entry for details on the associated methods.
185 .SH "WIDGET-SPECIFIC METHODS"
187 \fIpathName \fBcget\fR \fIoption\fR
188 Returns the current value of the configuration option given
190 \fIOption\fR may have any of the values accepted by the \fBentryfield\fR
193 \fIpathName \fBchildsite\fR
194 Returns the path name of the child site.
196 \fIpathName \fBclear\fR
199 \fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
200 Query or modify the configuration options of the widget.
201 If no \fIoption\fR is specified, returns a list describing all of
202 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
203 information on the format of this list). If \fIoption\fR is specified
204 with no \fIvalue\fR, then the command returns a list describing the
205 one named option (this list will be identical to the corresponding
206 sublist of the value returned if no \fIoption\fR is specified). If
207 one or more \fIoption\-value\fR pairs are specified, then the command
208 modifies the given widget option(s) to have the given value(s); in
209 this case the command returns an empty string.
210 \fIOption\fR may have any of the values accepted by the \fBentryfield\fR
216 Name: \fBefchildsite\fR
220 The efchildsite component is the user child site for the entry field. See
221 the "frame" widget manual entry for details on the efchildsite component item.
228 The entry component provides the entry field for user text input and display.
229 See the "entry" widget manual entry for details on the entry component item.
234 option add *textBackground white
237 puts stdout "Return Pressed"
241 puts stdout "Alphabetic contents invalid"
244 entryfield .ef -command returnCmd
246 entryfield .fef -labeltext "Fixed:" -fixed 10 -width 12
248 entryfield .nef -labeltext "Numeric:" -validate numeric -width 12
250 entryfield .aef -labeltext "Alphabetic:" \\
251 -validate alphabetic -width 12 -invalid invalidCmd
253 entryfield .pef -labeltext "Password:" \\
254 -show \267 -width 12 -command returnCmd
256 Labeledwidget::alignlabels .ef .fef .nef .aef .pef
258 pack .ef -fill x -expand yes -padx 10 -pady 5
259 pack .fef -fill x -expand yes -padx 10 -pady 5
260 pack .nef -fill x -expand yes -padx 10 -pady 5
261 pack .aef -fill x -expand yes -padx 10 -pady 5
262 pack .pef -fill x -expand yes -padx 10 -pady 5