arcadia 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +126 -123
- data/arcadia.rb +770 -756
- data/base/a-contracts.rb +130 -93
- data/base/a-ext.rb +280 -280
- data/base/a-libs.rb +5 -11
- data/base/a-utils.rb +235 -44
- data/conf/arcadia.conf +20 -16
- data/conf/arcadia.init.rb +0 -0
- data/conf/arcadia.res.rb +74 -0
- data/ext/ae-complete-code/ae-complete-code.conf +0 -0
- data/ext/ae-complete-code/ae-complete-code.rb +80 -79
- data/ext/ae-debug/ae-debug.conf +0 -0
- data/ext/ae-debug/ae-debug.rb +2 -6
- data/ext/ae-debug/debug1.57.rb +0 -0
- data/ext/ae-doc-code/ae-doc-code.conf +15 -0
- data/ext/ae-doc-code/ae-doc-code.rb +289 -0
- data/ext/ae-editor/ae-editor.conf +17 -8
- data/ext/ae-editor/ae-editor.rb +738 -396
- 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 +2 -2
- data/ext/ae-file-history/ae-file-history.rb +286 -290
- data/ext/ae-inspector/ae-inspector.conf +0 -0
- data/ext/ae-inspector/ae-inspector.rb +0 -0
- data/ext/ae-output-event/ae-output-event.conf +2 -2
- data/ext/ae-output/ae-output.conf +2 -2
- data/ext/ae-output/ae-output.rb +173 -178
- data/ext/ae-palette/ae-palette.conf +0 -0
- data/ext/ae-palette/ae-palette.rb +0 -0
- data/ext/ae-shell/ae-shell.conf +0 -0
- data/ext/ae-shell/ae-shell.rb +54 -54
- data/lib/tk/al-tk.rb +3076 -3082
- data/lib/tk/al-tk.res.rb +0 -0
- data/lib/tk/al-tkarcadia.rb +0 -0
- data/lib/tk/al-tkcustom.rb +0 -0
- data/lib/tkext/al-bwidget.rb +0 -0
- data/lib/tkext/al-iwidgets.rb +0 -0
- data/lib/tkext/al-tile.rb +0 -0
- data/lib/tkext/al-tktable.rb +0 -0
- data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +276 -0
- data/tcl/BWidget-1.8.0/BWman/BWidget.html +228 -0
- data/tcl/BWidget-1.8.0/BWman/Button.html +273 -0
- data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +264 -0
- data/tcl/BWidget-1.8.0/BWman/ComboBox.html +402 -0
- data/tcl/BWidget-1.8.0/BWman/Dialog.html +314 -0
- data/tcl/BWidget-1.8.0/BWman/DragSite.html +139 -0
- data/tcl/BWidget-1.8.0/BWman/DropSite.html +254 -0
- data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +248 -0
- data/tcl/BWidget-1.8.0/BWman/Entry.html +341 -0
- data/tcl/BWidget-1.8.0/BWman/Label.html +331 -0
- data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +194 -0
- data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +144 -0
- data/tcl/BWidget-1.8.0/BWman/ListBox.html +678 -0
- data/tcl/BWidget-1.8.0/BWman/MainFrame.html +283 -0
- data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +218 -0
- data/tcl/BWidget-1.8.0/BWman/NoteBook.html +374 -0
- data/tcl/BWidget-1.8.0/BWman/PagesManager.html +180 -0
- data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +142 -0
- data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +153 -0
- data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +214 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +145 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollView.html +130 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +191 -0
- data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +116 -0
- data/tcl/BWidget-1.8.0/BWman/SelectColor.html +164 -0
- data/tcl/BWidget-1.8.0/BWman/SelectFont.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/Separator.html +77 -0
- data/tcl/BWidget-1.8.0/BWman/SpinBox.html +250 -0
- data/tcl/BWidget-1.8.0/BWman/StatusBar.html +147 -0
- data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +107 -0
- data/tcl/BWidget-1.8.0/BWman/Tree.html +947 -0
- data/tcl/BWidget-1.8.0/BWman/Widget.html +502 -0
- data/tcl/BWidget-1.8.0/BWman/contents.html +84 -0
- data/tcl/BWidget-1.8.0/BWman/index.html +7 -0
- data/tcl/BWidget-1.8.0/BWman/navtree.html +41 -0
- data/tcl/BWidget-1.8.0/BWman/options.htm +458 -0
- data/tcl/BWidget-1.8.0/CHANGES.txt +266 -0
- data/tcl/BWidget-1.8.0/ChangeLog +1641 -0
- data/tcl/BWidget-1.8.0/LICENSE.txt +41 -0
- data/tcl/BWidget-1.8.0/README.txt +127 -0
- data/tcl/BWidget-1.8.0/arrow.tcl +551 -0
- data/tcl/BWidget-1.8.0/bitmap.tcl +94 -0
- data/tcl/BWidget-1.8.0/button.tcl +324 -0
- data/tcl/BWidget-1.8.0/buttonbox.tcl +403 -0
- data/tcl/BWidget-1.8.0/color.tcl +493 -0
- data/tcl/BWidget-1.8.0/combobox.tcl +809 -0
- data/tcl/BWidget-1.8.0/demo/basic.tcl +199 -0
- data/tcl/BWidget-1.8.0/demo/bwidget.xbm +46 -0
- data/tcl/BWidget-1.8.0/demo/demo.tcl +212 -0
- data/tcl/BWidget-1.8.0/demo/dnd.tcl +42 -0
- data/tcl/BWidget-1.8.0/demo/manager.tcl +141 -0
- data/tcl/BWidget-1.8.0/demo/select.tcl +59 -0
- data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +214 -0
- data/tcl/BWidget-1.8.0/demo/tree.tcl +260 -0
- data/tcl/BWidget-1.8.0/demo/x1.xbm +2258 -0
- data/tcl/BWidget-1.8.0/dialog.tcl +345 -0
- data/tcl/BWidget-1.8.0/dragsite.tcl +197 -0
- data/tcl/BWidget-1.8.0/dropsite.tcl +455 -0
- data/tcl/BWidget-1.8.0/dynhelp.tcl +625 -0
- data/tcl/BWidget-1.8.0/entry.tcl +469 -0
- data/tcl/BWidget-1.8.0/font.tcl +566 -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 +5 -0
- data/tcl/BWidget-1.8.0/images/new.gif +0 -0
- data/tcl/BWidget-1.8.0/images/opcopy.xbm +5 -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 +5 -0
- data/tcl/BWidget-1.8.0/images/opmove.xbm +5 -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 +5 -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 +9 -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 +40 -0
- data/tcl/BWidget-1.8.0/label.tcl +271 -0
- data/tcl/BWidget-1.8.0/labelentry.tcl +100 -0
- data/tcl/BWidget-1.8.0/labelframe.tcl +160 -0
- data/tcl/BWidget-1.8.0/lang/da.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/de.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/en.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/es.rc +53 -0
- data/tcl/BWidget-1.8.0/lang/fr.rc +52 -0
- data/tcl/BWidget-1.8.0/listbox.tcl +1638 -0
- data/tcl/BWidget-1.8.0/mainframe.tcl +711 -0
- data/tcl/BWidget-1.8.0/messagedlg.tcl +128 -0
- data/tcl/BWidget-1.8.0/notebook.tcl +1164 -0
- data/tcl/BWidget-1.8.0/pagesmgr.tcl +294 -0
- data/tcl/BWidget-1.8.0/panedw.tcl +381 -0
- data/tcl/BWidget-1.8.0/panelframe.tcl +246 -0
- data/tcl/BWidget-1.8.0/passwddlg.tcl +178 -0
- data/tcl/BWidget-1.8.0/pkgIndex.tcl +47 -0
- data/tcl/BWidget-1.8.0/progressbar.tcl +208 -0
- data/tcl/BWidget-1.8.0/progressdlg.tcl +87 -0
- data/tcl/BWidget-1.8.0/scrollframe.tcl +226 -0
- data/tcl/BWidget-1.8.0/scrollview.tcl +254 -0
- data/tcl/BWidget-1.8.0/scrollw.tcl +280 -0
- data/tcl/BWidget-1.8.0/separator.tcl +75 -0
- data/tcl/BWidget-1.8.0/spinbox.tcl +331 -0
- data/tcl/BWidget-1.8.0/statusbar.tcl +422 -0
- data/tcl/BWidget-1.8.0/tests/entry.test +173 -0
- data/tcl/BWidget-1.8.0/titleframe.tcl +170 -0
- data/tcl/BWidget-1.8.0/tree.tcl +2228 -0
- data/tcl/BWidget-1.8.0/utils.tcl +645 -0
- data/tcl/BWidget-1.8.0/widget.tcl +1576 -0
- data/tcl/BWidget-1.8.0/wizard.tcl +1028 -0
- data/tcl/BWidget-1.8.0/xpm2image.tcl +115 -0
- metadata +141 -5
File without changes
|
File without changes
|
@@ -1,290 +1,286 @@
|
|
1
|
-
#
|
2
|
-
# ae-file-history.rb - Arcadia Ruby ide
|
3
|
-
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
-
#
|
5
|
-
require "base/a-ext"
|
6
|
-
|
7
|
-
|
8
|
-
class TreeNode
|
9
|
-
attr_reader :sons
|
10
|
-
attr_reader :parent
|
11
|
-
attr_reader :kind
|
12
|
-
attr_reader :rif, :label, :helptext
|
13
|
-
attr_writer :rif, :label, :helptext
|
14
|
-
def initialize(parent=nil, kind='KClass')
|
15
|
-
@sons = Array.new
|
16
|
-
@parent = parent
|
17
|
-
@kind = kind
|
18
|
-
@label = ''
|
19
|
-
if @parent !=nil
|
20
|
-
@parent.sons << self
|
21
|
-
end
|
22
|
-
yield(self) if block_given?
|
23
|
-
end
|
24
|
-
|
25
|
-
def <=> (other)
|
26
|
-
self.label.strip <=> other.label.strip
|
27
|
-
end
|
28
|
-
|
29
|
-
def path
|
30
|
-
_path = @label
|
31
|
-
if @parent != nil
|
32
|
-
_path = @parent.path+_path
|
33
|
-
end
|
34
|
-
return _path
|
35
|
-
end
|
36
|
-
|
37
|
-
def dir(_path)
|
38
|
-
node = nil
|
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
|
-
node= _tree.dir(res)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
break if node != nil
|
47
|
-
}
|
48
|
-
if node == nil
|
49
|
-
node = TreeNode.new(self,'KDir') do |_node|
|
50
|
-
_node.label=_path
|
51
|
-
_node.rif= self.path+_path
|
52
|
-
end
|
53
|
-
end
|
54
|
-
return node
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
class FileH < ArcadiaExt
|
61
|
-
attr_reader :htree
|
62
|
-
|
63
|
-
def before_build
|
64
|
-
end
|
65
|
-
|
66
|
-
def build
|
67
|
-
@h_stack = Array.new
|
68
|
-
do_select_item = proc{|_self|
|
69
|
-
if _self.selection_get[0].length >0
|
70
|
-
_selected = ""
|
71
|
-
_self.selection_get[0].each{|_block|
|
72
|
-
_selected = _selected + _block.to_s + "\s"
|
73
|
-
}
|
74
|
-
_selected = _selected.strip
|
75
|
-
else
|
76
|
-
_selected = _self.selection_get[0]
|
77
|
-
end
|
78
|
-
_dir, _file = _selected.split('@@@')
|
79
|
-
if _file
|
80
|
-
_file = File.expand_path( _file , _dir )
|
81
|
-
else
|
82
|
-
_file = Tk.getOpenFile('initialdir'=>_dir)
|
83
|
-
end
|
84
|
-
if _file
|
85
|
-
EditorContract.instance.open_file(
|
86
|
-
end
|
87
|
-
}
|
88
|
-
_background = conf('color.background')
|
89
|
-
_foreground = conf('color.foreground')
|
90
|
-
@font = conf('font')
|
91
|
-
@font_b = conf('font.bold')
|
92
|
-
|
93
|
-
@htree = Tk::BWidget::Tree.new(self.frame){
|
94
|
-
relief 'flat'
|
95
|
-
showlines false
|
96
|
-
deltay 18
|
97
|
-
background _background
|
98
|
-
crossfill _foreground
|
99
|
-
#dragenabled true
|
100
|
-
selectcommand proc{ do_select_item.call(self) }
|
101
|
-
place('relwidth' => 1,'relx' => 0,'x' => '0','y' => '0','relheight' => '1')
|
102
|
-
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
def
|
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
|
-
|
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
|
-
end
|
288
|
-
end
|
289
|
-
end
|
290
|
-
end
|
1
|
+
#
|
2
|
+
# ae-file-history.rb - Arcadia Ruby ide
|
3
|
+
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
+
#
|
5
|
+
require "base/a-ext"
|
6
|
+
|
7
|
+
|
8
|
+
class TreeNode
|
9
|
+
attr_reader :sons
|
10
|
+
attr_reader :parent
|
11
|
+
attr_reader :kind
|
12
|
+
attr_reader :rif, :label, :helptext
|
13
|
+
attr_writer :rif, :label, :helptext
|
14
|
+
def initialize(parent=nil, kind='KClass')
|
15
|
+
@sons = Array.new
|
16
|
+
@parent = parent
|
17
|
+
@kind = kind
|
18
|
+
@label = ''
|
19
|
+
if @parent !=nil
|
20
|
+
@parent.sons << self
|
21
|
+
end
|
22
|
+
yield(self) if block_given?
|
23
|
+
end
|
24
|
+
|
25
|
+
def <=> (other)
|
26
|
+
self.label.strip <=> other.label.strip
|
27
|
+
end
|
28
|
+
|
29
|
+
def path
|
30
|
+
_path = @label
|
31
|
+
if @parent != nil
|
32
|
+
_path = @parent.path+_path
|
33
|
+
end
|
34
|
+
return _path
|
35
|
+
end
|
36
|
+
|
37
|
+
def dir(_path)
|
38
|
+
node = nil
|
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
|
+
node= _tree.dir(res)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
break if node != nil
|
47
|
+
}
|
48
|
+
if node == nil
|
49
|
+
node = TreeNode.new(self,'KDir') do |_node|
|
50
|
+
_node.label=_path
|
51
|
+
_node.rif= self.path+_path
|
52
|
+
end
|
53
|
+
end
|
54
|
+
return node
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
class FileH < ArcadiaExt
|
61
|
+
attr_reader :htree
|
62
|
+
|
63
|
+
def before_build
|
64
|
+
end
|
65
|
+
|
66
|
+
def build
|
67
|
+
@h_stack = Array.new
|
68
|
+
do_select_item = proc{|_self|
|
69
|
+
if _self.selection_get[0].length >0
|
70
|
+
_selected = ""
|
71
|
+
_self.selection_get[0].each{|_block|
|
72
|
+
_selected = _selected + _block.to_s + "\s"
|
73
|
+
}
|
74
|
+
_selected = _selected.strip
|
75
|
+
else
|
76
|
+
_selected = _self.selection_get[0]
|
77
|
+
end
|
78
|
+
_dir, _file = _selected.split('@@@')
|
79
|
+
if _file
|
80
|
+
_file = File.expand_path( _file , _dir )
|
81
|
+
else
|
82
|
+
_file = Tk.getOpenFile('initialdir'=>_dir)
|
83
|
+
end
|
84
|
+
if _file
|
85
|
+
EditorContract.instance.open_file(self,'file'=>_file)
|
86
|
+
end
|
87
|
+
}
|
88
|
+
_background = conf('color.background')
|
89
|
+
_foreground = conf('color.foreground')
|
90
|
+
@font = conf('font')
|
91
|
+
@font_b = conf('font.bold')
|
92
|
+
|
93
|
+
@htree = Tk::BWidget::Tree.new(self.frame){
|
94
|
+
relief 'flat'
|
95
|
+
showlines false
|
96
|
+
deltay 18
|
97
|
+
background _background
|
98
|
+
crossfill _foreground
|
99
|
+
#dragenabled true
|
100
|
+
selectcommand proc{ do_select_item.call(self) }
|
101
|
+
place('relwidth' => 1,'relx' => 0,'x' => '0','y' => '0','relheight' => '1')
|
102
|
+
}
|
103
|
+
_scrollcommand = proc{|*args| @htree.yview(*args)}
|
104
|
+
_scrollbar = TkScrollbar.new(self.frame){|s|
|
105
|
+
width 8
|
106
|
+
command _scrollcommand
|
107
|
+
}.pack('side'=>'right', 'fill'=>'y')
|
108
|
+
@htree.yscrollcommand proc{|first,last| _scrollbar.set(first,last)}
|
109
|
+
|
110
|
+
self.build_tree
|
111
|
+
end
|
112
|
+
|
113
|
+
def after_build
|
114
|
+
ArcadiaContractListener.new(self, EditorContract, :do_editor_event)
|
115
|
+
end
|
116
|
+
|
117
|
+
def history_file
|
118
|
+
if !defined?(@arcadia_history_file)
|
119
|
+
@arcadia_history_file = @arcadia.local_dir+'/'+conf('file.name')
|
120
|
+
end
|
121
|
+
return @arcadia_history_file
|
122
|
+
end
|
123
|
+
|
124
|
+
def do_editor_event(_event)
|
125
|
+
case _event.signature
|
126
|
+
when EditorContract::FILE_AFTER_OPEN
|
127
|
+
if _event.context.file
|
128
|
+
self.add2history(_event.context.file)
|
129
|
+
add_to_tree(_event.context.file)
|
130
|
+
end
|
131
|
+
when EditorContract::FILE_AFTER_CLOSE
|
132
|
+
if _event.context.file
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def root
|
138
|
+
if !defined?(@root)
|
139
|
+
@root = TreeNode.new(nil, 'KRoot'){|_node|
|
140
|
+
_node.rif= 'root'
|
141
|
+
_node.label=''
|
142
|
+
}
|
143
|
+
end
|
144
|
+
return @root
|
145
|
+
end
|
146
|
+
|
147
|
+
def build_tree
|
148
|
+
file_dir = Hash.new
|
149
|
+
nodes = Array.new
|
150
|
+
if File.exist?(history_file)
|
151
|
+
f = File::open(history_file,'r')
|
152
|
+
f_open = $arcadia['pers']['editor.files.open'].split("|") if $arcadia['pers']['editor.files.open']
|
153
|
+
begin
|
154
|
+
_lines = f.readlines.collect!{| line | line.chomp+"\n" }.to_s
|
155
|
+
_lines.sort.each{|_line|
|
156
|
+
_file = _line.split(';')[0]
|
157
|
+
if FileTest::exist?(_file)
|
158
|
+
dir,fil =File.split(File.expand_path(_file))
|
159
|
+
file_dir[dir] = Array.new if file_dir[dir] == nil
|
160
|
+
file_dir[dir] << fil if !file_dir[dir].include?(fil)
|
161
|
+
end
|
162
|
+
}
|
163
|
+
ensure
|
164
|
+
f.close unless f.nil?
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
file_dir.keys.sort.each{|_dir|
|
169
|
+
node = root.dir(_dir)
|
170
|
+
file_dir[_dir].each{|file|
|
171
|
+
TreeNode.new(node, 'KFile'){|_node|
|
172
|
+
_node.rif= _dir+'@@@'+file
|
173
|
+
_node.label=file
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
@image_kdir = TkPhotoImage.new('dat' => BOOK_GIF)
|
179
|
+
@image_kfile_rb = TkPhotoImage.new('dat' => RUBY_DOCUMENT_GIF)
|
180
|
+
@image_kfile = TkPhotoImage.new('dat' => DOCUMENT_GIF)
|
181
|
+
|
182
|
+
build_tree_from_node(root)
|
183
|
+
end
|
184
|
+
|
185
|
+
def add_to_tree(_file)
|
186
|
+
_d, _f = File.split(File.expand_path(_file))
|
187
|
+
_foreground = conf('color.foreground')
|
188
|
+
node = root.dir(_d)
|
189
|
+
if !@htree.exist?(node.rif)
|
190
|
+
@htree.insert('end', 'root' ,node.rif, {
|
191
|
+
'text' => _d ,
|
192
|
+
'helptext' => _d,
|
193
|
+
'deltax'=>-1,
|
194
|
+
'fill' => _foreground,
|
195
|
+
'font'=>@font,
|
196
|
+
'image'=> image('KDir')
|
197
|
+
}
|
198
|
+
)
|
199
|
+
end
|
200
|
+
_file_node_rif = _d+'@@@'+_f
|
201
|
+
if !@htree.exist?(_file_node_rif)
|
202
|
+
@htree.insert('end', node.rif ,_file_node_rif, {
|
203
|
+
'text' => _f ,
|
204
|
+
'helptext' => _f,
|
205
|
+
'deltax'=>-1,
|
206
|
+
'fill' => _foreground,
|
207
|
+
'font'=>@font_b,
|
208
|
+
'image'=> image('KFile',_f)
|
209
|
+
}
|
210
|
+
)
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
def image(_kind, _label='.rb')
|
216
|
+
if _kind == 'KDir'
|
217
|
+
return @image_kdir
|
218
|
+
elsif _kind == 'KFile' && _label.include?('.rb')
|
219
|
+
return @image_kfile_rb
|
220
|
+
else
|
221
|
+
return @image_kfile
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
def build_tree_from_node(_node)
|
226
|
+
_foreground = conf('color.foreground')
|
227
|
+
_sorted_sons = _node.sons.sort
|
228
|
+
for inode in 0.._sorted_sons.length - 1
|
229
|
+
_son = _sorted_sons[inode]
|
230
|
+
@htree.insert('end', _son.parent.rif ,_son.rif, {
|
231
|
+
'text' => _son.label ,
|
232
|
+
'fill' => _foreground,
|
233
|
+
'helptext' => _son.helptext,
|
234
|
+
'deltax'=>-1,
|
235
|
+
'font'=>@font,
|
236
|
+
'image'=> image(_son.kind, _son.label)
|
237
|
+
}
|
238
|
+
)
|
239
|
+
build_tree_from_node(_son)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
|
244
|
+
def add2history(_filename, _text_index='1.0')
|
245
|
+
if _filename
|
246
|
+
_filename = _filename.downcase.sub(Dir::pwd.downcase+'/',"")
|
247
|
+
_filename = File.expand_path(_filename)
|
248
|
+
_filename_index = _filename+";"+_text_index
|
249
|
+
|
250
|
+
if File.exist?(history_file)
|
251
|
+
f = File::open(history_file,'r')
|
252
|
+
begin
|
253
|
+
_lines = f.readlines.collect!{| line | line.chomp}
|
254
|
+
ensure
|
255
|
+
f.close unless f.nil?
|
256
|
+
end
|
257
|
+
f = File.new(history_file, "w")
|
258
|
+
begin
|
259
|
+
if f
|
260
|
+
_l= conf('length').to_i
|
261
|
+
f.syswrite(_filename_index+"\n")
|
262
|
+
_lines[0.._l-1].each{|_line|
|
263
|
+
_lfile = _line.split(';')
|
264
|
+
if _lfile
|
265
|
+
f.syswrite(_line+"\n") if (_lfile[0] != _filename)&&(_line.length > 0)
|
266
|
+
end
|
267
|
+
}
|
268
|
+
end
|
269
|
+
ensure
|
270
|
+
f.close unless f.nil?
|
271
|
+
end
|
272
|
+
else
|
273
|
+
dir,fil =File.split(File.expand_path(history_file))
|
274
|
+
if !File.exist?(dir)
|
275
|
+
Dir.mkdir(dir)
|
276
|
+
end
|
277
|
+
f = File.new(history_file, "w+")
|
278
|
+
begin
|
279
|
+
f.syswrite(_filename+"\n") if f
|
280
|
+
ensure
|
281
|
+
f.close unless f.nil?
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|