First checkin, AXE release 0.2
[AXE.git] / doc / edit.html
1 <HTML>
2 <HEAD>
3 <TITLE>edit - ANDROMEDA X-windows Encapsulation</TITLE>
4 <!--Created by Applixware HTML Authoring System, Release 4.3 on Thu Jun 18 12:51:58 1998-->
5 <!--Ax:WP:DocVar:HTMLCellWidthPolicy@:"0"-->
6 </HEAD>
7 <BODY BGCOLOR="#ffffff">
8 <H1>class edit</H1>
9 <HR>
10 <H2>NAME</H2>
11 <P>edit - Edit a single line of text</P>
12 <H2>SYNOPSIS</H2>
13 <P>class edit : public <A HREF="window.html">window</A></P>
14 <H2>DESCRIPTION</H2>
15 <P>An <B>edit</B> object contains a single line of text that can be edited. A
16 text cursor is drawn in the text to mark the position in which characters
17 typed from the keyboard will be inserted. The cursor can be moved by using the
18 left and right cursor keys or by pressing the mouse button in the text. The
19 window in which the text is displayed does not need to be large enough to
20 display the whole line of text. If the text exceeds the size of the window,
21 only a part of the text is visible at a time. The user can scroll the text
22 horizontally by moving the text cursor with the cursor keys.</P>
23 <H3>Handled events</H3>
24 <P>Buttonpress sets the focus to the <B>edit</B> window. The X server will
25 send a FocusIn event as a result of the SetFocus</P>
26 <P>Mouse click deselects any selection but does not change the cut buffer.
27 </P>
28 <P>Button release is the end of a click or the end of a drag.</P>
29 <P>MotionNotify signifies a drag (only with button 1 pressed).</P>
30 <P>Four events, EnterNotify, LeaveNotify, FocusIn and FocusOut, are tracked to
31 tell if the <B>edit</B> object has the keyboard focus. (see Keyboard focus below).
32 </P>
33 <H3>Sent messages</H3>
34 <P>EDIT_ENTERED - When the Enter key (normal or keypad) is pressed on the edit
35 window. This is the default action of the overridable function enter()
36 </P>
37 <P>EDIT_FOCUSLOST - When the (implicit or explicit) focus is lost. This is the
38 default action of the overridable function focuslost()</P>
39 <P></P>
40 <H3>Edit keys</H3>
41 <P>Backspace: remove character before cursor position</P>
42 <P>Delete : remove character after cursor position</P>
43 <P>Return or Enter: send a <B>EDIT_ENTERED</B> message to the parent window
44 through virtual function enter().</P>
45 <P>Cursor left/right : move cursor. If the cursor would be moved outside the
46 window, the text is moved one quarter of the window's size to compensate.
47 </P>
48 <H3>Keyboard focus</H3>
49 <P>Implicit focus by moving the mouse on the <B>edit</B> window. The focus is
50 lost when the mouse is moved outside the <B>edit</B> window.</P>
51 <P>Explicit focus by clicking the left mouse button. The focus remains until
52 set to another window.</P>
53 <P>Four events, EnterNotify, LeaveNotify, FocusIn and FocusOut, are tracked to
54 tell if the <B>edit</B> object has the keyboard focus. These four events drive
55 the state diagram shown below:</P>
56 <P><IMG SRC="edit_focus.png"></P>
57 <P></P>
58 <H3>Copy and Paste</H3>
59 <P>Copy by dragging the left mouse button. The selected text is stores in the
60 X cut buffer.</P>
61 <P>Double-click selects the whole text (not implemented yet)</P>
62 <P>Selection is undone by a keypress or left mouse button. If the key is an
63 edit key, the selected text is deleted first. Keys that would not normally
64 change the text do not delete the selected text.</P>
65 <P>Paste at the cursor position by clicking the middle mouse button. The
66 cursor position is not changed.</P>
67 <P></P>
68 <TABLE WIDTH=600 CELLPADDING=1>
69 <TR>
70 <TH COLSPAN=2 WIDTH=100%>
71 <P>Member Functions</P>
72 </TH></TR>
73 <TR>
74 <TD COLSPAN=1 WIDTH=50%>
75 <P><A HREF="edit_edit.html">edit</A></P>
76 </TD>
77 <TD COLSPAN=1 WIDTH=50%>
78 <P>constructor and destructor</P>
79 </TD></TR>
80 <TR>
81 <TD COLSPAN=1 WIDTH=50%>
82 <P>operator =</P>
83 </TD>
84 <TD COLSPAN=1 WIDTH=50%>
85 <P>Set the contents of the text. by assigning a <A HREF="../ACL/string.html">string
86 </A></P>
87 </TD></TR>
88 <TR>
89 <TD COLSPAN=1 WIDTH=50%>
90 <P>operator string &amp;</P>
91 </TD>
92 <TD COLSPAN=1 WIDTH=50%>
93 <P>Get the contents of the text into a string</P>
94 </TD></TR>
95 <TR>
96 <TD COLSPAN=1 WIDTH=50%>
97 <P>SelectAll</P>
98 </TD>
99 <TD COLSPAN=1 WIDTH=50%>
100 <P>Select the entire string for copy or delete</P>
101 </TD></TR>
102 <TR>
103 <TD COLSPAN=1 WIDTH=50%>
104 <P>ClearSelection</P>
105 </TD>
106 <TD COLSPAN=1 WIDTH=50%>
107 <P>De-select the selected text</P>
108 </TD></TR>
109 <TR>
110 <TD COLSPAN=1 WIDTH=50%>
111 <P>DeleteSelection</P>
112 </TD>
113 <TD COLSPAN=1 WIDTH=50%>
114 <P>Delete the selected text from the string</P>
115 </TD></TR>
116 </TABLE>
117 <H2>BUGS</H2>
118 <P>Start a drag inside selected text to move the selected text (drag &amp;
119 drop): Not implemented</P>
120 <P>Double click to select all text: Not implemented</P>
121 <P></P>
122 <H2>SEE ALSO</H2>
123 <H2>DIAGNOSTICS</H2>
124 <P><A HREF="/src/acl/AXE/edit.h">Source Code</A></P>
125 <P></P>
126 </BODY>
127 </HTML>