File: TextUndo.pod

package info (click to toggle)
perl-tk 1%3A804.027-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 30,204 kB
  • ctags: 33,761
  • sloc: ansic: 340,354; perl: 44,606; sh: 8,869; makefile: 5,658; asm: 996; yacc: 883; cpp: 570; pascal: 536
file content (129 lines) | stat: -rw-r--r-- 2,971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

=head1 NAME

Tk::TextUndo - perl/tk text widget with bindings to undo changes.

=for pm Tk/TextUndo.pm

=for category Derived Widgets

=head1 SYNOPSIS

S<    >B<use Tk::TextUndo;>

S<    >I<$testundo> = I<$parent>-E<gt>B<TextUndo>(?I<-option>=E<gt>I<value>, ...?);

=head1 DESCRIPTION

This IS-A text widget with an unlimited 'undo' history but without
a re'undo' capability.

=head2 Bindings

The C<TextUndo> widget has the same bindings as the L<Text|Tk::Text> widget.
In addition there are the following bindings:

=over 4

=item Event <L4> <<Undo>>

undo the last change.  Pressing <L4> several times undo
step by step the changes made to the text widget.

=back

=head2 Extended Methods

The C<TextUndo> widget is derived from and has the same methods
as C<Text> widget.
In addition, the extended text widget methods as documented
in I<"Mastering Perl/Tk"> are included in this pod (with
permission from the author, B<Steve Lidie>).

=over 4

=item I<$textundo>-E<gt>B<ConfirmDiscard>

Displays a messageBox that says "Save Edits?". Returns 0 if yes or cancel,
1 if no.

=item I<$textundo>-E<gt>B<ConfirmEmptyDocument>

Displays a messageBox that says "Save Edits?". The widget is cleared
if the reply is no.

=item I<$textundo>-E<gt>B<ConfirmExit>

Destroys the widget if you answer yes.

=item I<$textundo>-E<gt>B<CreateFileSelect>

Creates a popup file browser to select a filename.

=item I<$textundo>-E<gt>B<deleteStringAtStartOfSelectedLines(I<?string?>)>

Deletes I<string> from the start of every selected line.

=item I<$textundo>-E<gt>B<EmptyDocument>

Deletes all text and undo/redo information; undefs the filename.

=item I<$textundo>-E<gt>B<FileName(I<?pathName?>)>

Optionally updates the current filename to I<pathName>. Returns the 
current filename.

=item I<$textundo>-E<gt>B<IncludeFile>

Similar to Load, except it does not call EmptyDocument first.

=item I<$textundo>-E<gt>B<insertStringAtStartOfSelectedLines(I<?string?>)>

Inserts I<string> at the start of every selected line.

=item I<$textundo>-E<gt>B<Load(I<pathName>)>

Loads the contents of I<pathName> into the widget. Load()
delete the previous contents of the widget as well as it's
undo history.

=item I<$textundo>-E<gt>B<numberChanges>

Returns the number of current undo operations.

=item I<$textundo>-E<gt>B<redo>

Redoes the previous operation.

=item I<$textundo>-E<gt>B<ResetUndo>

Deletes all undo and redo information.

=item I<$textundo>-E<gt>B<Save(I<?pathName?>)>

Saves the contents of the widget to a file. If
I<pathName> is not specified, the filename from the last Load
call is used.  If no file was previously loaded an error message
pops up. The default filename of the last Load call
is not overwriten by I<pathName>.

=item I<$textundo>-E<gt>B<SizeRedo>

Returns the number of current redo operations.

=item I<$textundo>-E<gt>B<undo>

Undoes the previous operation.

=back

=head1 KEYS

widget, text, undo

=head1 SEE ALSO

L<Tk::Text>, L<Tk::ROText>

=cut