arcadia 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +9 -5
- data/bin/arcadia +13 -13
- data/bin/arcadia.bat +1 -0
- data/conf/arcadia.conf +6 -5
- data/conf/arcadia.init.rb +34 -34
- data/conf/arcadia.res.rb +6 -0
- data/ext/ae-breakpoints/ae-breakpoints.conf +10 -0
- data/ext/ae-breakpoints/ae-breakpoints.rb +349 -0
- data/ext/ae-complete-code/ae-complete-code.conf +0 -0
- data/ext/ae-complete-code/ae-complete-code.rb +74 -76
- data/ext/ae-doc-code/ae-doc-code.conf +15 -15
- data/ext/ae-doc-code/ae-doc-code.rb +300 -295
- data/ext/ae-editor/ae-editor.conf +4 -4
- data/ext/ae-editor/ae-editor.rb +450 -140
- data/ext/ae-editor/langs/conf.lang +0 -0
- data/ext/ae-editor/langs/lang.lang.bind +0 -0
- data/ext/ae-editor/langs/rb.lang +0 -0
- data/ext/ae-editor/langs/rbw.lang.bind +0 -0
- data/ext/ae-event-log/ae-event-log.conf +0 -0
- data/ext/ae-event-log/ae-event-log.rb +0 -0
- data/ext/ae-file-history/ae-file-history.conf +0 -0
- data/ext/ae-file-history/ae-file-history.rb +437 -373
- data/ext/ae-flag/ae-flag.conf +0 -0
- data/ext/ae-flag/ae-flag.rb +0 -0
- data/ext/ae-output-event/ae-output-event.conf +0 -0
- data/ext/ae-output/ae-output.conf +0 -0
- data/ext/ae-output/ae-output.rb +0 -0
- data/ext/ae-rad/ae-rad-inspector.rb +0 -0
- data/ext/ae-rad/ae-rad-libs.rb +0 -0
- data/ext/ae-rad/ae-rad-palette.rb +0 -0
- data/ext/ae-rad/ae-rad.conf +0 -0
- data/ext/ae-rad/ae-rad.rb +0 -0
- data/ext/ae-rad/lib/tk/al-tk.rb +4 -4
- data/ext/ae-rad/lib/tk/al-tk.res.rb +0 -0
- data/ext/ae-rad/lib/tk/al-tkarcadia.rb +25 -26
- data/ext/ae-rad/lib/tk/al-tkcustom.rb +0 -0
- data/ext/ae-rad/lib/tkext/al-bwidget.rb +0 -0
- data/ext/ae-rad/lib/tkext/al-iwidgets.rb +0 -0
- data/ext/ae-rad/lib/tkext/al-tile.rb +0 -0
- data/ext/ae-rad/lib/tkext/al-tktable.rb +0 -0
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +0 -0
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +1589 -1566
- data/ext/ae-search-in-files/ae-search-in-files.conf +0 -0
- data/ext/ae-search-in-files/ae-search-in-files.rb +0 -0
- data/ext/ae-shell/ae-shell.conf +0 -0
- data/ext/ae-shell/ae-shell.rb +0 -0
- data/ext/ae-shell/sh.rb +0 -0
- data/lib/a-commons.rb +27 -8
- data/lib/a-contracts.rb +3 -1
- data/lib/a-core.rb +33 -12
- data/lib/a-tkcommons.rb +17 -1
- data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/BWidget.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Button.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ComboBox.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Dialog.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/DragSite.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/DropSite.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Entry.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Label.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ListBox.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/MainFrame.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/NoteBook.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/PagesManager.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollView.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/SelectColor.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/SelectFont.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Separator.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/SpinBox.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/StatusBar.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Tree.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/Widget.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/contents.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/index.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/navtree.html +0 -0
- data/tcl/BWidget-1.8.0/BWman/options.htm +0 -0
- data/tcl/BWidget-1.8.0/CHANGES.txt +0 -0
- data/tcl/BWidget-1.8.0/ChangeLog +0 -0
- data/tcl/BWidget-1.8.0/LICENSE.txt +0 -0
- data/tcl/BWidget-1.8.0/README.txt +0 -0
- data/tcl/BWidget-1.8.0/arrow.tcl +0 -0
- data/tcl/BWidget-1.8.0/bitmap.tcl +0 -0
- data/tcl/BWidget-1.8.0/button.tcl +0 -0
- data/tcl/BWidget-1.8.0/buttonbox.tcl +0 -0
- data/tcl/BWidget-1.8.0/color.tcl +0 -0
- data/tcl/BWidget-1.8.0/combobox.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/basic.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/bwidget.xbm +0 -0
- data/tcl/BWidget-1.8.0/demo/demo.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/dnd.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/manager.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/select.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/tree.tcl +0 -0
- data/tcl/BWidget-1.8.0/demo/x1.xbm +0 -0
- data/tcl/BWidget-1.8.0/dialog.tcl +0 -0
- data/tcl/BWidget-1.8.0/dragsite.tcl +0 -0
- data/tcl/BWidget-1.8.0/dropsite.tcl +0 -0
- data/tcl/BWidget-1.8.0/dynhelp.tcl +0 -0
- data/tcl/BWidget-1.8.0/entry.tcl +0 -0
- data/tcl/BWidget-1.8.0/font.tcl +0 -0
- data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
- data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
- data/tcl/BWidget-1.8.0/images/error.gif +0 -0
- data/tcl/BWidget-1.8.0/images/file.gif +0 -0
- data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
- data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
- data/tcl/BWidget-1.8.0/images/info.gif +0 -0
- data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
- data/tcl/BWidget-1.8.0/images/minus.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/new.gif +0 -0
- data/tcl/BWidget-1.8.0/images/opcopy.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/open.gif +0 -0
- data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/oplink.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/opmove.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
- data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
- data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
- data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
- data/tcl/BWidget-1.8.0/images/plus.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/print.gif +0 -0
- data/tcl/BWidget-1.8.0/images/question.gif +0 -0
- data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/save.gif +0 -0
- data/tcl/BWidget-1.8.0/images/target.xbm +0 -0
- data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
- data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
- data/tcl/BWidget-1.8.0/init.tcl +0 -0
- data/tcl/BWidget-1.8.0/label.tcl +0 -0
- data/tcl/BWidget-1.8.0/labelentry.tcl +0 -0
- data/tcl/BWidget-1.8.0/labelframe.tcl +0 -0
- data/tcl/BWidget-1.8.0/lang/da.rc +0 -0
- data/tcl/BWidget-1.8.0/lang/de.rc +0 -0
- data/tcl/BWidget-1.8.0/lang/en.rc +0 -0
- data/tcl/BWidget-1.8.0/lang/es.rc +0 -0
- data/tcl/BWidget-1.8.0/lang/fr.rc +0 -0
- data/tcl/BWidget-1.8.0/listbox.tcl +0 -0
- data/tcl/BWidget-1.8.0/mainframe.tcl +0 -0
- data/tcl/BWidget-1.8.0/messagedlg.tcl +0 -0
- data/tcl/BWidget-1.8.0/notebook.tcl +0 -0
- data/tcl/BWidget-1.8.0/pagesmgr.tcl +0 -0
- data/tcl/BWidget-1.8.0/panedw.tcl +0 -0
- data/tcl/BWidget-1.8.0/panelframe.tcl +0 -0
- data/tcl/BWidget-1.8.0/passwddlg.tcl +0 -0
- data/tcl/BWidget-1.8.0/pkgIndex.tcl +0 -0
- data/tcl/BWidget-1.8.0/progressbar.tcl +0 -0
- data/tcl/BWidget-1.8.0/progressdlg.tcl +0 -0
- data/tcl/BWidget-1.8.0/scrollframe.tcl +0 -0
- data/tcl/BWidget-1.8.0/scrollview.tcl +0 -0
- data/tcl/BWidget-1.8.0/scrollw.tcl +0 -0
- data/tcl/BWidget-1.8.0/separator.tcl +0 -0
- data/tcl/BWidget-1.8.0/spinbox.tcl +0 -0
- data/tcl/BWidget-1.8.0/statusbar.tcl +0 -0
- data/tcl/BWidget-1.8.0/tests/entry.test +0 -0
- data/tcl/BWidget-1.8.0/titleframe.tcl +0 -0
- data/tcl/BWidget-1.8.0/tree.tcl +0 -0
- data/tcl/BWidget-1.8.0/utils.tcl +0 -0
- data/tcl/BWidget-1.8.0/widget.tcl +0 -0
- data/tcl/BWidget-1.8.0/wizard.tcl +0 -0
- data/tcl/BWidget-1.8.0/xpm2image.tcl +0 -0
- metadata +158 -154
File without changes
|
File without changes
|
data/ext/ae-editor/langs/rb.lang
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,373 +1,437 @@
|
|
1
|
-
#
|
2
|
-
# ae-file-history.rb - Arcadia Ruby ide
|
3
|
-
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
class TreeNode
|
8
|
-
attr_reader :sons
|
9
|
-
attr_reader :parent
|
10
|
-
attr_reader :kind
|
11
|
-
attr_reader :rif, :label, :helptext
|
12
|
-
attr_writer :rif, :label, :helptext
|
13
|
-
def initialize(parent=nil, kind='KClass')
|
14
|
-
@sons = Array.new
|
15
|
-
@parent = parent
|
16
|
-
@kind = kind
|
17
|
-
@label = ''
|
18
|
-
if @parent !=nil
|
19
|
-
@parent.sons << self
|
20
|
-
end
|
21
|
-
yield(self) if block_given?
|
22
|
-
end
|
23
|
-
|
24
|
-
def <=> (other)
|
25
|
-
self.label.strip <=> other.label.strip
|
26
|
-
end
|
27
|
-
|
28
|
-
def path
|
29
|
-
_path = @label
|
30
|
-
if @parent != nil
|
31
|
-
_path = @parent.path+_path
|
32
|
-
end
|
33
|
-
return _path
|
34
|
-
end
|
35
|
-
|
36
|
-
def
|
37
|
-
node = nil
|
38
|
-
parent = self
|
39
|
-
sons.each{|_tree|
|
40
|
-
if _path[0.._tree.label.length-1] == _tree.label
|
41
|
-
res = _path[_tree.label.length.._path.length-1]
|
42
|
-
if ["\\","/"].include?(res[0,1])
|
43
|
-
parent = _tree
|
44
|
-
node= _tree.dir(res)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
break if node != nil
|
48
|
-
}
|
49
|
-
if node == nil
|
50
|
-
node = TreeNode.new(parent,'KDir') do |_node|
|
51
|
-
_node.label=_path
|
52
|
-
_node.rif= parent.path+_path
|
53
|
-
end
|
54
|
-
end
|
55
|
-
return node
|
56
|
-
end
|
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
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
@
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
if
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
}
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
end
|
373
|
-
|
1
|
+
#
|
2
|
+
# ae-file-history.rb - Arcadia Ruby ide
|
3
|
+
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
+
#
|
5
|
+
|
6
|
+
|
7
|
+
class TreeNode
|
8
|
+
attr_reader :sons
|
9
|
+
attr_reader :parent
|
10
|
+
attr_reader :kind
|
11
|
+
attr_reader :rif, :label, :helptext
|
12
|
+
attr_writer :rif, :label, :helptext
|
13
|
+
def initialize(parent=nil, kind='KClass')
|
14
|
+
@sons = Array.new
|
15
|
+
@parent = parent
|
16
|
+
@kind = kind
|
17
|
+
@label = ''
|
18
|
+
if @parent !=nil
|
19
|
+
@parent.sons << self
|
20
|
+
end
|
21
|
+
yield(self) if block_given?
|
22
|
+
end
|
23
|
+
|
24
|
+
def <=> (other)
|
25
|
+
self.label.strip <=> other.label.strip
|
26
|
+
end
|
27
|
+
|
28
|
+
# def path
|
29
|
+
# _path = @label
|
30
|
+
# if @parent != nil
|
31
|
+
# _path = @parent.path+_path
|
32
|
+
# end
|
33
|
+
# return _path
|
34
|
+
# end
|
35
|
+
|
36
|
+
def dir_old(_path)
|
37
|
+
node = nil
|
38
|
+
parent = self
|
39
|
+
sons.each{|_tree|
|
40
|
+
if _path[0.._tree.label.length-1] == _tree.label
|
41
|
+
res = _path[_tree.label.length.._path.length-1]
|
42
|
+
if ["\\","/"].include?(res[0,1])
|
43
|
+
parent = _tree
|
44
|
+
node= _tree.dir(res)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
break if node != nil
|
48
|
+
}
|
49
|
+
if node == nil
|
50
|
+
node = TreeNode.new(parent,'KDir') do |_node|
|
51
|
+
_node.label=_path
|
52
|
+
_node.rif= parent.path+_path
|
53
|
+
end
|
54
|
+
end
|
55
|
+
return node
|
56
|
+
end
|
57
|
+
|
58
|
+
def dir(_path)
|
59
|
+
node = nil
|
60
|
+
parent = self
|
61
|
+
sons.each{|_tree|
|
62
|
+
["\\","/"].include?(_path[0,1])?_index = 1:_index=0
|
63
|
+
if _path[_index.._tree.label.length-1+_index] == _tree.label
|
64
|
+
res = _path[_tree.label.length+_index.._path.length-1]
|
65
|
+
if ["\\","/"].include?(res[0,1])
|
66
|
+
parent = _tree
|
67
|
+
node= _tree.dir(res)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
break if node != nil
|
71
|
+
}
|
72
|
+
if node == nil
|
73
|
+
if _path.length > 0 && (_path.include?("/")||_path.include?("\\"))
|
74
|
+
_path.include?("/")?_sep="/":_sep="\\"
|
75
|
+
_parent_length = _path.length - _path.split(_sep)[-1].length
|
76
|
+
_parent_path = _path[0.._parent_length-2]
|
77
|
+
if _parent_path != _path
|
78
|
+
parent = parent.dir(_parent_path)
|
79
|
+
_path = _path[_parent_length-1.._path.length-1]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
node = TreeNode.new(parent,'KDir') do |_node|
|
83
|
+
_node.label=_path
|
84
|
+
if ["\\","/"].include?(_node.label[0,1])
|
85
|
+
_node.label = _node.label[1..-1]
|
86
|
+
end
|
87
|
+
parent.rif == "root"?parent_rif = "":parent_rif=parent.rif
|
88
|
+
_node.rif= (parent_rif+_path).sub(":",'%%%')
|
89
|
+
end
|
90
|
+
end
|
91
|
+
return node
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
class FilesHistrory < ArcadiaExt
|
100
|
+
include Autils
|
101
|
+
attr_reader :htree
|
102
|
+
|
103
|
+
def sync_on
|
104
|
+
@sync = true
|
105
|
+
select_file_without_event(@last_file) if @last_file
|
106
|
+
|
107
|
+
#Arcadia.attach_listener(self, BufferRaisedEvent)
|
108
|
+
end
|
109
|
+
|
110
|
+
def sync_off
|
111
|
+
@sync = false
|
112
|
+
#Arcadia.detach_listener(self, BufferRaisedEvent)
|
113
|
+
end
|
114
|
+
|
115
|
+
def on_before_build(_event)
|
116
|
+
Arcadia.attach_listener(self, BufferRaisedEvent)
|
117
|
+
end
|
118
|
+
|
119
|
+
def on_build(_event)
|
120
|
+
@h_stack = Array.new
|
121
|
+
@cb_sync = TkCheckButton.new(self.frame.hinner_frame, Arcadia.style('checkbox')){
|
122
|
+
text 'Sync'
|
123
|
+
justify 'left'
|
124
|
+
variable 1
|
125
|
+
#command do_check
|
126
|
+
place('x' => 0,'y' => 0,'height' => 22)
|
127
|
+
}
|
128
|
+
|
129
|
+
do_check = proc {
|
130
|
+
if @cb_sync.cget('onvalue')==@cb_sync.cget('variable').value.to_i
|
131
|
+
sync_on
|
132
|
+
else
|
133
|
+
sync_off
|
134
|
+
end
|
135
|
+
}
|
136
|
+
@sync = false
|
137
|
+
@cb_sync.command(do_check)
|
138
|
+
|
139
|
+
do_select_item = proc{|_self|
|
140
|
+
if _self.selection_get[0].length >0
|
141
|
+
_selected = ""
|
142
|
+
_self.selection_get[0].each{|_block|
|
143
|
+
_selected = _selected + _block.to_s + "\s"
|
144
|
+
}
|
145
|
+
_selected = _selected.strip
|
146
|
+
else
|
147
|
+
_selected = _self.selection_get[0]
|
148
|
+
end
|
149
|
+
_dir, _file = _selected.sub("%%%",":").split('@@@')
|
150
|
+
if _file
|
151
|
+
_file = File.expand_path( _file , _dir )
|
152
|
+
else
|
153
|
+
_file = Tk.getOpenFile('initialdir'=>_dir)
|
154
|
+
end
|
155
|
+
if _file && _file.strip.length > 0
|
156
|
+
Arcadia.process_event(OpenBufferEvent.new(self,'file'=>_file))
|
157
|
+
#EditorContract.instance.open_file(self,'file'=>_file)
|
158
|
+
end
|
159
|
+
}
|
160
|
+
# _background = conf('color.background')
|
161
|
+
# _foreground = conf('color.foreground')
|
162
|
+
@font = Arcadia.conf('treeitem.font')
|
163
|
+
@font_b = "#{Arcadia.conf('treeitem.font')} bold"
|
164
|
+
|
165
|
+
@htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
|
166
|
+
#relief 'flat'
|
167
|
+
showlines false
|
168
|
+
deltay 18
|
169
|
+
#background _background
|
170
|
+
#crossfill _foreground
|
171
|
+
#dragenabled true
|
172
|
+
selectcommand proc{ do_select_item.call(self) }
|
173
|
+
place('relwidth' => 1,'relheight' => '1', 'x' => '0','y' => '22', 'height' => -22)
|
174
|
+
}
|
175
|
+
_scrollcommand = proc{|*args| @htree.yview(*args)}
|
176
|
+
_scrollbar = TkScrollbar.new(self.frame.hinner_frame, Arcadia.style('scrollbar')){|s|
|
177
|
+
width 8
|
178
|
+
command _scrollcommand
|
179
|
+
}.pack('side'=>'right', 'fill'=>'y')
|
180
|
+
@htree.yscrollcommand proc{|first,last| _scrollbar.set(first,last)}
|
181
|
+
|
182
|
+
self.build_tree
|
183
|
+
end
|
184
|
+
|
185
|
+
def on_after_build(_event)
|
186
|
+
Arcadia.attach_listener(self, OpenBufferEvent)
|
187
|
+
#Arcadia.attach_listener(self, CloseBufferEvent)
|
188
|
+
end
|
189
|
+
|
190
|
+
def history_file
|
191
|
+
if !defined?(@arcadia_history_file)
|
192
|
+
@arcadia_history_file = @arcadia.local_dir+'/'+conf('file.name')
|
193
|
+
end
|
194
|
+
return @arcadia_history_file
|
195
|
+
end
|
196
|
+
|
197
|
+
def on_after_open_buffer(_event)
|
198
|
+
if _event.file && File.exist?(_event.file)
|
199
|
+
self.add2history(_event.file)
|
200
|
+
add_to_tree(_event.file)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def on_after_close_buffer(_event)
|
205
|
+
if _event.file
|
206
|
+
self.add2history(_event.file)
|
207
|
+
add_to_tree(_event.file)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def select_file_without_event(_file)
|
212
|
+
_d, _f = File.split(File.expand_path(_file))
|
213
|
+
_d = _d.downcase if is_windows?
|
214
|
+
_f = _f.downcase if is_windows?
|
215
|
+
_file_node_rif = _d+'@@@'+_f
|
216
|
+
if @htree.exist?(_file_node_rif)
|
217
|
+
_proc = @htree.selectcommand
|
218
|
+
@htree.selectcommand(proc{nil})
|
219
|
+
begin
|
220
|
+
parent = root.dir(_d)
|
221
|
+
@htree.selection_clear
|
222
|
+
@htree.selection_add(_file_node_rif)
|
223
|
+
#@htree.close_tree('root')
|
224
|
+
while !parent.nil? && parent.rif != 'root'
|
225
|
+
@htree.open_tree(parent.rif, false)
|
226
|
+
parent = parent.parent
|
227
|
+
end
|
228
|
+
@htree.see(_file_node_rif)
|
229
|
+
ensure
|
230
|
+
@htree.selectcommand(_proc)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
def on_buffer_raised(_event)
|
236
|
+
return if _event.file.nil?
|
237
|
+
@last_file = _event.file
|
238
|
+
if @sync
|
239
|
+
select_file_without_event(_event.file)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# def do_editor_event(_event)
|
244
|
+
# case _event.signature
|
245
|
+
# when EditorContract::FILE_AFTER_OPEN
|
246
|
+
# if _event.context.file
|
247
|
+
# self.add2history(_event.context.file)
|
248
|
+
# add_to_tree(_event.context.file)
|
249
|
+
# end
|
250
|
+
# when EditorContract::FILE_AFTER_CLOSE
|
251
|
+
# if _event.context.file
|
252
|
+
# end
|
253
|
+
# end
|
254
|
+
# end
|
255
|
+
|
256
|
+
def root
|
257
|
+
if !defined?(@root)
|
258
|
+
@root = TreeNode.new(nil, 'KRoot'){|_node|
|
259
|
+
_node.rif= 'root'
|
260
|
+
_node.label=''
|
261
|
+
}
|
262
|
+
end
|
263
|
+
return @root
|
264
|
+
end
|
265
|
+
|
266
|
+
def build_tree
|
267
|
+
file_dir = Hash.new
|
268
|
+
nodes = Array.new
|
269
|
+
if File.exist?(history_file)
|
270
|
+
f = File::open(history_file,'r')
|
271
|
+
f_open = $arcadia['pers']['editor.files.open'].split("|") if $arcadia['pers']['editor.files.open']
|
272
|
+
begin
|
273
|
+
_lines = f.readlines.collect!{| line | line.chomp+"\n" }.to_s
|
274
|
+
_lines.sort.each{|_line|
|
275
|
+
_file = _line.split(';')[0]
|
276
|
+
if FileTest::exist?(_file)
|
277
|
+
dir,fil =File.split(File.expand_path(_file))
|
278
|
+
dir = dir.downcase if is_windows?
|
279
|
+
fil = fil.downcase if is_windows?
|
280
|
+
file_dir[dir] = Array.new if file_dir[dir] == nil
|
281
|
+
file_dir[dir] << fil if !file_dir[dir].include?(fil)
|
282
|
+
end
|
283
|
+
}
|
284
|
+
ensure
|
285
|
+
f.close unless f.nil?
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
file_dir.keys.sort.each{|_dir|
|
290
|
+
node = root.dir(_dir)
|
291
|
+
file_dir[_dir].each{|file|
|
292
|
+
TreeNode.new(node, 'KFile'){|_node|
|
293
|
+
_node.rif= _dir+'@@@'+file
|
294
|
+
_node.label=file
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
#@image_kdir = TkPhotoImage.new('dat' => BOOK_GIF)
|
300
|
+
@image_kdir = TkPhotoImage.new('dat' => ICON_FOLDER_OPEN_GIF)
|
301
|
+
@image_kfile_rb = TkPhotoImage.new('dat' => RUBY_DOCUMENT_GIF)
|
302
|
+
@image_kfile = TkPhotoImage.new('dat' => DOCUMENT_GIF)
|
303
|
+
|
304
|
+
build_tree_from_node(root)
|
305
|
+
end
|
306
|
+
|
307
|
+
def add_to_tree(_file)
|
308
|
+
_d, _f = File.split(File.expand_path(_file))
|
309
|
+
return if _f.nil?
|
310
|
+
#Arcadia.new_error_msg(self, "add_to_tree _file=#{_file}")
|
311
|
+
#Arcadia.new_error_msg(self, "add_to_tree _d=#{_d}")
|
312
|
+
#Arcadia.new_error_msg(self, "add_to_tree _f=#{_f}")
|
313
|
+
_d = _d.downcase if is_windows?
|
314
|
+
_f = _f.downcase if is_windows?
|
315
|
+
#_foreground = conf('color.foreground')
|
316
|
+
node = root.dir(_d)
|
317
|
+
|
318
|
+
node_stack = Array.new
|
319
|
+
node_stack << node
|
320
|
+
_parent = node.parent
|
321
|
+
while _parent.rif != 'root'
|
322
|
+
node_stack << _parent
|
323
|
+
_parent = _parent.parent
|
324
|
+
end
|
325
|
+
node_stack.reverse!
|
326
|
+
|
327
|
+
node_stack.each{|_node|
|
328
|
+
if !@htree.exist?(_node.rif)
|
329
|
+
@htree.insert('end', _node.parent.rif ,_node.rif, {
|
330
|
+
'text' => _node.label,
|
331
|
+
'helptext' => _node.rif,
|
332
|
+
'deltax'=>-1,
|
333
|
+
'image'=> image('KDir')
|
334
|
+
}.update(Arcadia.style('treeitem'))
|
335
|
+
)
|
336
|
+
end
|
337
|
+
}
|
338
|
+
# if !@htree.exist?(node.rif)
|
339
|
+
# @htree.insert('end', node.parent.rif ,node.rif, {
|
340
|
+
# 'text' => node.label,
|
341
|
+
# 'helptext' => node.rif,
|
342
|
+
# 'deltax'=>-1,
|
343
|
+
# 'image'=> image('KDir')
|
344
|
+
# }.update(Arcadia.style('treeitem'))
|
345
|
+
# )
|
346
|
+
# end
|
347
|
+
|
348
|
+
|
349
|
+
_file_node_rif = _d+'@@@'+_f
|
350
|
+
if !@htree.exist?(_file_node_rif)
|
351
|
+
@htree.insert('end', node.rif ,_file_node_rif, {
|
352
|
+
'text' => _f ,
|
353
|
+
'helptext' => _f,
|
354
|
+
'deltax'=>-1,
|
355
|
+
#'fill' => _foreground,
|
356
|
+
#'font'=>@font_b,
|
357
|
+
'image'=> image('KFile',_f)
|
358
|
+
}.update(Arcadia.style('treeitem'))
|
359
|
+
)
|
360
|
+
end
|
361
|
+
|
362
|
+
end
|
363
|
+
|
364
|
+
def image(_kind, _label='.rb')
|
365
|
+
if _kind == 'KDir'
|
366
|
+
return @image_kdir
|
367
|
+
elsif _kind == 'KFile' && _label.include?('.rb')
|
368
|
+
return @image_kfile_rb
|
369
|
+
else
|
370
|
+
return @image_kfile
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
def build_tree_from_node(_node)
|
375
|
+
#_foreground = conf('color.foreground')
|
376
|
+
_sorted_sons = _node.sons.sort
|
377
|
+
for inode in 0.._sorted_sons.length - 1
|
378
|
+
_son = _sorted_sons[inode]
|
379
|
+
@htree.insert('end', _son.parent.rif ,_son.rif, {
|
380
|
+
'text' => _son.label ,
|
381
|
+
# 'fill' => _foreground,
|
382
|
+
'helptext' => _son.helptext,
|
383
|
+
'deltax'=>-1,
|
384
|
+
# 'font'=>@font,
|
385
|
+
'image'=> image(_son.kind, _son.label)
|
386
|
+
}.update(Arcadia.style('treeitem'))
|
387
|
+
)
|
388
|
+
build_tree_from_node(_son)
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
|
393
|
+
def add2history(_filename, _text_index='1.0')
|
394
|
+
if _filename && File.exist?(_filename)
|
395
|
+
_filename = _filename.sub(Dir::pwd+'/',"")
|
396
|
+
_filename = File.expand_path(_filename)
|
397
|
+
_filename_index = _filename+";"+_text_index
|
398
|
+
#Arcadia.new_error_msg(self, "add2history _filename=#{_filename}")
|
399
|
+
#Arcadia.new_error_msg(self, "add2history history_file=#{history_file}")
|
400
|
+
|
401
|
+
if File.exist?(history_file)
|
402
|
+
f = File::open(history_file,'r')
|
403
|
+
begin
|
404
|
+
_lines = f.readlines.collect!{| line | line.chomp}
|
405
|
+
ensure
|
406
|
+
f.close unless f.nil?
|
407
|
+
end
|
408
|
+
f = File.new(history_file, "w")
|
409
|
+
begin
|
410
|
+
if f
|
411
|
+
_l= conf('length').to_i
|
412
|
+
f.syswrite(_filename_index+"\n")
|
413
|
+
_lines[0.._l-2].each{|_line|
|
414
|
+
_lfile = _line.split(';')
|
415
|
+
if _lfile
|
416
|
+
f.syswrite(_line+"\n") if (_lfile[0] != _filename)&&(_line.length > 0)
|
417
|
+
end
|
418
|
+
}
|
419
|
+
end
|
420
|
+
ensure
|
421
|
+
f.close unless f.nil?
|
422
|
+
end
|
423
|
+
else
|
424
|
+
dir,fil =File.split(File.expand_path(history_file))
|
425
|
+
if !File.exist?(dir)
|
426
|
+
Dir.mkdir(dir)
|
427
|
+
end
|
428
|
+
f = File.new(history_file, "w+")
|
429
|
+
begin
|
430
|
+
f.syswrite(_filename+"\n") if f
|
431
|
+
ensure
|
432
|
+
f.close unless f.nil?
|
433
|
+
end
|
434
|
+
end
|
435
|
+
end
|
436
|
+
end
|
437
|
+
end
|