projman/hlp/en/bwidget/Entry.html

341 lines
12 KiB
HTML
Raw Normal View History

2015-10-19 13:27:31 +03:00
<HTML>
<HEAD><TITLE>Entry</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>Entry</B>
- Entry widget with <B>state</B> option, dynamic help and drag and drop facilities
</DD></DL>
<DL>
<DT><I>CREATION</I></DT>
<DD><A HREF="#descr"><B>Entry</B></A> <I>pathName</I> ?<I>option value...</I>?</DD>
</DL>
<DL>
<DT><I>STANDARD OPTIONS</I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-background">-background or -bg</A></TD>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-borderwidth">-borderwidth or -bd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-disabledforeground">-disabledforeground</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-exportselection">-exportselection</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-font">-font</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-foreground">-foreground or -fg</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightbackground">-highlightbackground</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightcolor">-highlightcolor</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightthickness">-highlightthickness</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-insertbackground">-insertbackground</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-insertborderwidth">-insertborderwidth</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-insertofftime">-insertofftime</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-insertontime">-insertontime</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-insertwidth">-insertwidth</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-justify">-justify</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-relief">-relief</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-selectbackground">-selectbackground</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-selectborderwidth">-selectborderwidth</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-selectforeground">-selectforeground</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-takefocus">-takefocus</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-text">-text</A></TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-textvariable">-textvariable</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-xscrollcommand">-xscrollcommand</A></TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-command">-command</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragenabled">-dragenabled</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragendcmd">-dragendcmd</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragevent">-dragevent</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-draginitcmd">-draginitcmd</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragtype">-dragtype</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dropcmd">-dropcmd</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-dropenabled">-dropenabled</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dropovercmd">-dropovercmd</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-droptypes">-droptypes</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-editable">-editable</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-helptext">-helptext</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-helptype">-helptype</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-helpvar">-helpvar</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-show">-show</A></TR>
<TD>&nbsp;&nbsp;<A HREF="#-state">-state</A></TR>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-width">-width</A></TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
<I>option</I>
</DD>
<DD><I>pathName</I> <A HREF="#configure"><B>configure</B></A>
?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DD>
<DD><I>pathName</I> <A HREF="#invoke"><B>invoke</B></A>
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
The <B>Entry</B> widget extends the default Tk entry. Options have been added to provide
visual effect depending on the state of the Entry,
<A HREF="DynamicHelp.html">DynamicHelp</A> options,
and <A HREF="DragSite.html">Drag</A> and
<A HREF="DropSite.html">Drop</A>.
Entry behaves much like a Label, with <B>text</B> option to set its contents.
<BR>Tk entry command can also be used on Entry widget.
</P>
<BR><HR WIDTH="50%"><BR>
<B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>
<DL><DT><A NAME="-command"><B>-command</B></A></DT>
<DD>
Specifies a command when user press &lt;Return&gt; in the Entry.
</DD>
</DL>
<DL><DT><A NAME="-dragenabled"><B>-dragenabled</B></A></DT>
<DD>
A boolean specifying if drag is enabled.
</DD>
</DL>
<DL><DT><A NAME="-dragendcmd"><B>-dragendcmd</B></A></DT>
<DD>
Specifies a command to be called when drag ended.
<B>dragendcmd</B> must be a command conforming to the description of the
option <B>dragendcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.
<BR>If <B>dragendcmd</B> is empty, the internal <I>dragend</I> command updates the entry
following the operation (<B>move</B> or <B>copy</B>) and the dragged data
(whole or selected part of the entry).
</DD>
</DL>
<DL><DT><A NAME="-dragevent"><B>-dragevent</B></A></DT>
<DD>
Specifies the number of the mouse button associated to the drag.
Must be <B>1</B>, <B>2</B> or <B>3</B>.
</DD>
</DL>
<DL><DT><A NAME="-draginitcmd"><B>-draginitcmd</B></A></DT>
<DD>
Specifies a command to be called when <B>dragevent</B> occurs on widget.
<B>draginitcmd</B> must be a command conforming to the description of the
option <B>draginitcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.
<BR>if <B>draginitcmd</B> is empty, the command refuse the drag if entry is empty or if
portion of text is selected and event doesn't occur above the selection. In all other cases,
the command returns:
<UL>
<LI>as the data type, the value of option <B>dragtype</B> or <I>TEXT</I> if empty,
<LI>as the operations, <I>{copy move}</I> if <B>state</B> is normal and <B>editable</B>
is true, or <I>{copy}</I> only in other cases,
<LI>as the data, the whole content or the selected portion of the entry.
</UL>
</DD>
</DL>
<DL><DT><A NAME="-dragtype"><B>-dragtype</B></A></DT>
<DD>
Specifies an alternate type of dragged object.
</DD>
</DL>
<DL><DT><A NAME="-dropcmd"><B>-dropcmd</B></A></DT>
<DD>
Entry has a command wrapper for <I>drop</I> events. This command stops auto scrolling
and extract current position.
<BR>If <B>dropcmd</B> is not empty, it is called with the following arguments:
<UL>
<LI>the pathname of the Entry,
<LI>the pathname of the drag source,
<LI>the numeric index in the entry designated by the cursor,
<LI>the current operation,
<LI>the data type,
<LI>the data.
</UL>
and must return a value conforming to <B>dropcmd</B> option described in
<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.
If <B>dropcmd</B> is empty, the wrapper updates the entry following the type of data:
<DL><DD><TABLE BORDER=0 CELLSPACING=1>
<TR><TD><I>COLOR</I> or <I>FGCOLOR</I></TD>
<TD>reconfigure the <B>foreground</B> of the Entry</TD>
<TR><TD><I>BGCOLOR</I></TD>
<TD>reconfigure the <B>background</B> of the Entry</TD>
<TR><TD><I>TEXT</I>,<BR>or any other tag</TD>
<TD>reconfigure the Entry to display the associated string.</TD>
</TABLE></DL>
and returns 1.
</DD>
</DL>
<DL><DT><A NAME="-dropenabled"><B>-dropenabled</B></A></DT>
<DD>
A boolean specifying if drop is enabled.
</DD>
</DL>
<DL><DT><A NAME="-dropovercmd"><B>-dropovercmd</B></A></DT>
<DD>
Entry has a command wrapper for <I>drag-over</I> events. This command enables auto scrolling
and position extraction during the <I>drag-over</I>.
<BR>If <B>dropovercmd</B> is empty, the wrapper accepts the drop if <B>editable</b> option is
true and <B>state</B> option is normal.
<BR>If <B>dropovercmd</B> is not empty, it is called with the following arguments:
<UL>
<LI>the pathname of the Entry,
<LI>the pathname of the drag source,
<LI>the event,
<LI>the numeric index in the entry designated by the cursor,
<LI>the current operation,
<LI>the data type,
<LI>the data.
</UL>
and must return a value conforming to <B>dropovercmd</B> option described in
<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.
</DD>
</DL>
<DL><DT><A NAME="-droptypes"><B>-droptypes</B></A></DT>
<DD>
Specifies a list of accepted dropped object/operation.
See option <B>droptypes</B> of
<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.
for more infromation.
Default accepts <I>FGCOLOR</I>, <I>COLOR</I>, <I>BGCOLOR</I> and <I>TEXT</I>,
all with <B>copy</B> and <B>move</B> operations.
</DD>
</DL>
<DL><DT><A NAME="-editable"><B>-editable</B></A></DT>
<DD>
Specifies whether the Entry is editable by the user. Equivalent to the <B>state</B> option
of the Tk entry widget.
</DD>
</DL>
<DL><DT><A NAME="-helptext"><B>-helptext</B></A></DT>
<DD>
Text for dynamic help. If empty, no help is available for this widget.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptype"><B>-helptype</B></A></DT>
<DD>
Type of dynamic help. Use <I>balloon</I> or <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helpvar"><B>-helpvar</B></A></DT>
<DD>
Variable to use when <B>helptype</B> option is <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-show"><B>-show</B></A></DT>
<DD>
If this option is specified, then the true contents of the entry are not displayed in the
window. Instead, each character in the entry's value will be displayed as the first character
in the value of this option, such as ``*''. This is useful, for example, if the entry is to
be used to enter a password. If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents of the entry.
</DD>
</DL>
<DL><DT><A NAME="-state"><B>-state</B></A></DT>
<DD>
Specifies one of two states for the Entry: <B>normal</B> or <B>disabled</B>.
In normal state the text of the Entry is displayed using the <B>foreground</B> option.
In disabled state the text of the Entry is displayed using the <B>disabledforeground</B>
option. If the entry is disabled then the value may not be changed by user input
and no insertion cursor will be displayed, even if the input focus is in the widget.
Disabled state is the same as not editable with visual effect.
</DD>
</DL>
<DL><DT><A NAME="-width"><B>-width</B></A></DT>
<DD>
Specifies an integer value indicating the desired width of the entry window, in average-size
characters of the widget's font. If the value is less than or equal to zero, the widget picks
a size just large enough to hold its current text.
</DD>
</DL>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
<I>option</I>
</DT><DD>
Returns the current value of the configuration option given by <I>option</I>.
<I>Option</I> may have any of the values accepted by the creation command.
</DD></DL>
<DL><DT><A NAME="configure"><I>pathName</I> <B>configure</B></A>
?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DT><DD>
Query or modify the configuration options of the widget. If no <I>option</I> is specified,
returns a list describing all of the available options for <I>pathName</I>.
If <I>option</I> is specified with no <I>value</I>, then the command returns a list
describing the one named <I>option</I> (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If one or
more <I>option-value</I> pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the creation command.
Read-only options are not be modified.
</DD></DL>
<DL><DT><A NAME="invoke"><I>pathName</I> <B>invoke</B></A>
</DT><DD>
Calls the command specified by the option <B>-command</B>.
</DD></DL>
</BODY></HTML>