"Fossies" - the Fresh Open Source Software Archive 
Member "namefix.pl/libs/gui/edit_lists.pm" (13 Dec 2008, 5312 Bytes) of package /linux/privat/old/namefix.pl_4.0.2.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "edit_lists.pm" see the
Fossies "Dox" file reference documentation.
1 use strict;
2 use warnings;
3
4 #--------------------------------------------------------------------------------------------------------------
5 # Edit Word Casing List Dialog
6 #--------------------------------------------------------------------------------------------------------------
7
8 sub edit_cas_list
9 {
10 my $dtext = "";
11
12 if(-f $main::casing_file)
13 {
14 $dtext = &readjf("$main::casing_file");
15 } else
16 {
17 $dtext = join("\n", @main::word_casing_arr);
18 }
19
20 my $top = $main::mw -> Toplevel();
21 $top -> title
22 (
23 "Edit Word Casing List"
24 );
25
26 my $txt = $top -> Scrolled
27 (
28 'Text',
29 -scrollbars=>"osoe",
30 -width=>60,
31 -height=>20,
32 -font=>$main::dialog_font
33 )
34 -> grid
35 (
36 -row => 2,
37 -column => 1,
38 -columnspan => 2
39 );
40 $txt->menu(undef);
41
42 $txt -> insert
43 (
44 'end',
45 "$dtext"
46 );
47
48 my $but_save = $top -> Button
49 (
50 -text=>"Save",
51 -activebackground => 'white',
52 -command => sub
53 {
54 \&save_file
55 (
56 "$main::casing_file",
57 $txt -> get('0.0', 'end')
58 );
59 }
60 )
61 -> grid
62 (
63 -row => 4,
64 -column => 1,
65 -sticky=>"ne"
66 );
67
68 my $but_close = $top -> Button
69 (
70 -text=>"Close",
71 -activebackground => 'white',
72 -command => sub {
73 destroy $top;
74 }
75 )
76 -> grid
77 (
78 -row => 4,
79 -column => 2,
80 -sticky=>"nw"
81 );
82
83 $top->resizable(0,0);
84 }
85
86
87 #--------------------------------------------------------------------------------------------------------------
88 # Edit Kill Word List Dialog
89 #--------------------------------------------------------------------------------------------------------------
90
91 sub edit_word_list
92 {
93 my $dtext = "";
94
95 if(-f $main::killwords_file)
96 {
97 $dtext = &readsjf("$main::killwords_file");
98 }
99 else
100 {
101 $dtext = join("\n", sort @main::kill_words_arr);
102 }
103
104 my $top = $main::mw -> Toplevel();
105 $top -> title("Edit Kill Word List");
106
107 my $txt = $top -> Scrolled
108 (
109 'Text',
110 -scrollbars=>'osoe',
111 -font=>$main::dialog_font,
112 -width=>60,
113 -height=>20,
114
115 )
116 -> grid
117 (
118 -row => 2,
119 -column => 1,
120 -columnspan => 2
121 );
122 $txt->menu(undef);
123
124 $txt -> insert('end', "$dtext");
125
126 my $but_save = $top -> Button
127 (
128 -text=>"Save",
129 -activebackground => 'white',
130 -command => sub
131 {
132 \&save_file("$main::killwords_file",
133 $txt -> get('0.0', 'end'));
134 }
135 )
136 -> grid
137 (
138 -row => 4,
139 -column => 1,
140 -sticky=>"ne"
141 );
142
143 my $but_close = $top -> Button
144 (
145 -text=>"Close",
146 -activebackground => 'white',
147 -command => sub
148 {
149 destroy $top;
150 }
151 )
152 -> grid
153 (
154 -row => 4,
155 -column => 2,
156 -sticky=>"nw"
157 );
158
159 $top->resizable(0,0);
160 }
161
162
163 #--------------------------------------------------------------------------------------------------------------
164 # Edit Pattern List Dialog
165 #--------------------------------------------------------------------------------------------------------------
166
167 sub edit_pat_list
168 {
169 my $dtext = "";
170
171 if(-f $main::killpat_file)
172 {
173 $dtext = &readsjf("$main::killpat_file");
174 } else
175 {
176 $dtext = join("\n", sort @main::kill_patterns_arr);
177 }
178
179 my $top = $main::mw -> Toplevel();
180 $top -> title("Edit Kill Pattern List");
181
182 my $txt = $top -> Scrolled
183 (
184 'Text',
185 -scrollbars=>'osoe',
186 -width=>45,
187 -height=>10,
188 -font=>$main::edit_pat_font
189 )
190 -> grid
191 (
192 -row=>2,
193 -column=>1,
194 -columnspan=>2
195 );
196 $txt->menu(undef);
197
198 $txt -> insert('end', "$dtext");
199
200 my $but_save = $top -> Button
201 (
202 -text=>"Save",
203 -activebackground => 'white',
204 -command => sub
205 {
206 \&save_file(
207 "$main::killpat_file",
208 $txt -> get('0.0', 'end')
209 );
210 }
211 )
212 -> grid(
213 -row => 4,
214 -column => 1,
215 -sticky=>"ne"
216 );
217
218 my $but_close = $top -> Button(
219 -text=>"Close",
220 -activebackground => 'white',
221 -command => sub {
222 destroy $top;
223 }
224 )
225 -> grid(
226 -row => 4,
227 -column => 2,
228 -sticky=>"nw"
229 );
230
231 $top->resizable(0,0);
232 }
233
234
235 1;