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
@@ -15,14 +15,14 @@ tab-replace-width-space=2
|
|
15
15
|
#win::tabs.font={Courier New} 9
|
16
16
|
##tabs.side=bottom
|
17
17
|
tabs.side=top
|
18
|
-
|
18
|
+
complete-code=yes
|
19
19
|
# editor
|
20
20
|
#font=courier 11
|
21
21
|
#font.bold=courier 11 bold
|
22
22
|
#freebsd::font=courier 12
|
23
23
|
#freebsd::font.bold=courier 12 bold
|
24
|
-
win::font={Courier New} 9
|
25
|
-
win::font.bold={Courier New} 9 bold
|
24
|
+
#win::font={Courier New} 9
|
25
|
+
#win::font.bold={Courier New} 9 bold
|
26
26
|
#+--------------------------------------------------
|
27
27
|
#color.background=#000000
|
28
28
|
#color.foreground=white
|
@@ -107,7 +107,7 @@ hightlight.debug.relief=>>>hightlight.16.relief
|
|
107
107
|
#line_number_panel.color.foreground=#333333
|
108
108
|
#
|
109
109
|
#
|
110
|
-
tree explorer
|
110
|
+
# tree explorer
|
111
111
|
#explorer_panel.tree.color.background=#ffffff
|
112
112
|
#explorer_panel.tree.color.foreground=white
|
113
113
|
##explorer_panel.tabs.side=bottom
|
data/ext/ae-editor/ae-editor.rb
CHANGED
@@ -7,7 +7,6 @@ require 'tk'
|
|
7
7
|
require 'tktext'
|
8
8
|
require 'lib/a-tkcommons'
|
9
9
|
|
10
|
-
|
11
10
|
class TreeNode
|
12
11
|
attr_reader :sons
|
13
12
|
attr_reader :parent
|
@@ -86,7 +85,11 @@ class AgEditor
|
|
86
85
|
side $arcadia['conf']['editor.explorer_panel.tabs.side']
|
87
86
|
pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
|
88
87
|
}
|
89
|
-
@nb_tab_exp = @nb.insert('end','exp' ,
|
88
|
+
@nb_tab_exp = @nb.insert('end','exp' ,
|
89
|
+
'text'=>'Source Tree',
|
90
|
+
'background'=> Arcadia.style("tabpanel.background"),
|
91
|
+
'foreground'=> Arcadia.style("tabpanel.foreground")
|
92
|
+
)
|
90
93
|
@nb.raise('exp')
|
91
94
|
_tree_goto = proc{|_self|
|
92
95
|
_line = _self.selection_get[0]
|
@@ -183,9 +186,9 @@ class AgEditor
|
|
183
186
|
'bordermode'=>'outside'
|
184
187
|
)
|
185
188
|
}
|
186
|
-
|
189
|
+
# @text.configure('font', @font);
|
187
190
|
|
188
|
-
do_tag_configure_global('debug')
|
191
|
+
#do_tag_configure_global('debug')
|
189
192
|
@text.tag_configure('eval','foreground' => 'yellow', 'background' =>'red','borderwidth'=>1, 'relief'=>'raised')
|
190
193
|
@text.tag_configure('errline','borderwidth'=>1, 'relief'=>'groove')
|
191
194
|
#@text.tag_configure('debug', 'background' =>'#b9c6d9', 'borderwidth'=>1 ,'relief'=>'raise')
|
@@ -194,8 +197,12 @@ class AgEditor
|
|
194
197
|
end
|
195
198
|
|
196
199
|
def create_temp_file
|
197
|
-
|
198
|
-
|
200
|
+
if @file
|
201
|
+
_file = @file+'~~'
|
202
|
+
else
|
203
|
+
_file = 'buffer~~'
|
204
|
+
end
|
205
|
+
f = File.new(_file, "w")
|
199
206
|
begin
|
200
207
|
if f
|
201
208
|
f.syswrite(text_value)
|
@@ -206,29 +213,73 @@ class AgEditor
|
|
206
213
|
_file
|
207
214
|
end
|
208
215
|
|
216
|
+
def initialize_complete_code
|
217
|
+
complete_code = proc{
|
218
|
+
if @do_complete
|
219
|
+
line, col = @text.index('insert').split('.')
|
220
|
+
_file = create_temp_file
|
221
|
+
#EditorContract.instance.complete_code(self, 'file'=>_file, 'line'=>line.to_s, 'col'=>col.to_s)
|
222
|
+
begin
|
223
|
+
event = Arcadia.process_event(CompleteCodeEvent.new(self, 'file'=>_file, 'row'=>line.to_s, 'col'=>col.to_s))
|
224
|
+
ensure
|
225
|
+
File.delete(_file) if File.exist?(_file)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
@controller.raise_complete_code(event) if @do_complete
|
229
|
+
}
|
230
|
+
|
231
|
+
@text.bind_append("Control-KeyPress"){|e|
|
232
|
+
case e.keysym
|
233
|
+
when 'space'
|
234
|
+
@do_complete = true
|
235
|
+
complete_code.call
|
236
|
+
end
|
237
|
+
}
|
238
|
+
|
239
|
+
@text.bind_append("KeyPress"){|e|
|
240
|
+
@do_complete = false
|
241
|
+
}
|
242
|
+
|
243
|
+
@text.bind_append("KeyRelease"){|e|
|
244
|
+
case e.keysym
|
245
|
+
when 'period'
|
246
|
+
@do_complete = true
|
247
|
+
complete_code.call
|
248
|
+
end
|
249
|
+
}
|
250
|
+
end
|
251
|
+
|
209
252
|
def initialize_text_binding
|
210
253
|
@v_scroll.command(proc{|*args|
|
211
254
|
@text.yview *args
|
212
255
|
})
|
213
256
|
@text.yscrollcommand(proc{|first,last| @v_scroll.set(first,last)
|
257
|
+
#Arcadia.console(self, 'msg'=>"eseguo ---> do_line_update")
|
214
258
|
self.do_line_update()
|
215
259
|
})
|
216
260
|
@text.tag_bind('selected', 'Enter', proc{@text.tag_remove('selected','1.0','end')})
|
217
261
|
|
218
262
|
@text.bind("Enter", proc{check_file_last_access_time})
|
219
263
|
|
220
|
-
|
264
|
+
# complete_code = proc{
|
265
|
+
# if @do_complete
|
266
|
+
# line, col = @text.index('insert').split('.')
|
267
|
+
# _file = create_temp_file
|
268
|
+
# #EditorContract.instance.complete_code(self, 'file'=>_file, 'line'=>line.to_s, 'col'=>col.to_s)
|
269
|
+
# begin
|
270
|
+
# event = Arcadia.process_event(CompleteCodeEvent.new(self, 'file'=>_file, 'row'=>line.to_s, 'col'=>col.to_s))
|
271
|
+
# ensure
|
272
|
+
# File.delete(_file) if File.exist?(_file)
|
273
|
+
# end
|
274
|
+
# end
|
275
|
+
# @controller.raise_complete_code(event) if @do_complete
|
276
|
+
# }
|
277
|
+
|
278
|
+
@text.bind_append("Control-KeyPress"){|e|
|
221
279
|
case e.keysym
|
222
|
-
when 'space'
|
223
|
-
|
224
|
-
|
225
|
-
#EditorContract.instance.complete_code(self, 'file'=>_file, 'line'=>line.to_s, 'col'=>col.to_s)
|
226
|
-
begin
|
227
|
-
event = Arcadia.process_event(CompleteCodeEvent.new(self, 'file'=>_file, 'row'=>line.to_s, 'col'=>col.to_s))
|
228
|
-
ensure
|
229
|
-
File.delete(_file) if File.exist?(_file)
|
230
|
-
end
|
231
|
-
@controller.raise_complete_code(event)
|
280
|
+
# when 'space'
|
281
|
+
# @do_complete = true
|
282
|
+
# complete_code.call
|
232
283
|
when 'z'
|
233
284
|
_b = @text.index('insert').split('.')[0].to_i
|
234
285
|
@text.edit_undo
|
@@ -327,7 +378,8 @@ class AgEditor
|
|
327
378
|
end
|
328
379
|
}
|
329
380
|
|
330
|
-
@text.
|
381
|
+
@text.bind_append("KeyPress"){|e|
|
382
|
+
#@do_complete = false
|
331
383
|
case e.keysym
|
332
384
|
#when 'Return'
|
333
385
|
when 'BackSpace'
|
@@ -380,8 +432,13 @@ class AgEditor
|
|
380
432
|
check_modify
|
381
433
|
}
|
382
434
|
|
383
|
-
@text.
|
435
|
+
@text.bind_append("KeyRelease"){|e|
|
384
436
|
case e.keysym
|
437
|
+
# when 'period'
|
438
|
+
# @do_complete = true
|
439
|
+
# #Thread.new do
|
440
|
+
# complete_code.call
|
441
|
+
# #end
|
385
442
|
when 'Control_L','Return', 'Control_V', 'BackSpace', 'Delete'
|
386
443
|
do_line_update
|
387
444
|
end
|
@@ -453,12 +510,6 @@ class AgEditor
|
|
453
510
|
cursor nil
|
454
511
|
insertwidth 0
|
455
512
|
font Arcadia.conf('edit.font')
|
456
|
-
#background Arcadia.conf('panel.background')
|
457
|
-
#foreground Arcadia.conf('panel.foreground')
|
458
|
-
#background $arcadia['conf']['editor.line_number_panel.color.background']
|
459
|
-
#foreground $arcadia['conf']['editor.line_number_panel.color.foreground']
|
460
|
-
#highlightcolor $arcadia['conf']['editor.line_number_panel.color.background']
|
461
|
-
#highlightthickness 0
|
462
513
|
place(
|
463
514
|
'x'=>0,
|
464
515
|
'y'=>0,
|
@@ -467,26 +518,32 @@ class AgEditor
|
|
467
518
|
'bordermode'=>'outside'
|
468
519
|
)
|
469
520
|
}
|
470
|
-
delta = @font_metrics_bold[2][1]-@font_metrics[2][1]
|
471
|
-
@text_line_num.tag_configure('
|
521
|
+
delta = (@font_metrics_bold[2][1]-@font_metrics[2][1])
|
522
|
+
@text_line_num.tag_configure('normal_case', 'justify'=>'right')
|
523
|
+
@text_line_num.tag_configure('bold_case', 'spacing3'=>delta, 'justify'=>'right')
|
472
524
|
@text_line_num.tag_configure('breakpoint', 'background'=>'red','foreground'=>'yellow','borderwidth'=>1, 'relief'=>'raised')
|
473
|
-
@text_line_num.tag_configure('
|
474
|
-
'background'
|
475
|
-
'foreground'
|
525
|
+
@text_line_num.tag_configure('current',
|
526
|
+
'background'=>Arcadia.conf("activebackground"),
|
527
|
+
'foreground'=>Arcadia.conf("activeforeground"),
|
476
528
|
'relief'=>'flat'
|
477
529
|
)
|
478
|
-
|
530
|
+
|
531
|
+
@text_line_num.bind("Double-ButtonPress-1",
|
532
|
+
proc{|x,y|
|
533
|
+
_index = @text_line_num.index("@#{x},#{y}")
|
534
|
+
_line = @text_line_num.get(_index+' linestart',_index+' lineend').strip
|
535
|
+
toggle_breakpoint(_index)
|
536
|
+
}, "%x %y")
|
537
|
+
|
538
|
+
@text_line_num.bind("ButtonPress-1", proc{|x,y|
|
479
539
|
_index = @text_line_num.index("@#{x},#{y}")
|
480
540
|
_line = @text_line_num.get(_index+' linestart',_index+' lineend').strip
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
@controller.breakpoint_add(@file, _line)
|
488
|
-
end
|
489
|
-
},
|
541
|
+
@text_line_num_current_index = _index
|
542
|
+
@text_line_num_current_line = _line
|
543
|
+
@text_line_num.tag_remove('current',"0.1","end")
|
544
|
+
@text_line_num.tag_add('current',_index+' linestart',_index+' lineend')
|
545
|
+
@text_line_num.tag_raise('breakpoint')
|
546
|
+
},
|
490
547
|
"%x %y")
|
491
548
|
|
492
549
|
#@text_line_num.configure('font', @font);
|
@@ -496,9 +553,109 @@ class AgEditor
|
|
496
553
|
'borderwidth'=>2,
|
497
554
|
'relief'=>'raised'
|
498
555
|
)
|
556
|
+
|
557
|
+
#--- menu
|
558
|
+
_pop_up = TkMenu.new(
|
559
|
+
:parent=>@text_line_num,
|
560
|
+
:tearoff=>0,
|
561
|
+
:title => 'Menu'
|
562
|
+
)
|
563
|
+
_pop_up.configure(Arcadia.style('menu'))
|
564
|
+
#Arcadia.instance.main_menu.update_style(@pop_up)
|
565
|
+
_title_item = _pop_up.insert('end',
|
566
|
+
:command,
|
567
|
+
:label=>'...',
|
568
|
+
:state=>'disabled',
|
569
|
+
:background=>Arcadia.conf('titlelabel.background'),
|
570
|
+
:hidemargin => true
|
571
|
+
)
|
572
|
+
|
573
|
+
_pop_up.insert('end',
|
574
|
+
:command,
|
575
|
+
:label=>'Toggle breakpoint',
|
576
|
+
:hidemargin => false,
|
577
|
+
:command=> proc{
|
578
|
+
if defined?(@text_line_num_current_index)
|
579
|
+
toggle_breakpoint(@text_line_num_current_index)
|
580
|
+
end
|
581
|
+
}
|
582
|
+
)
|
583
|
+
|
584
|
+
@text_line_num.bind("Button-3",
|
585
|
+
proc{|*x|
|
586
|
+
_x = TkWinfo.pointerx(@text_line_num)
|
587
|
+
_y = TkWinfo.pointery(@text_line_num)
|
588
|
+
_pop_up.entryconfigure(0,'label'=>"line #{@text_line_num_current_line}")
|
589
|
+
|
590
|
+
_pop_up.popup(_x,_y)
|
591
|
+
})
|
592
|
+
|
593
|
+
end
|
594
|
+
|
595
|
+
def file_line_to_text_line_num_line(_line)
|
596
|
+
rel_line = nil
|
597
|
+
line_begin = @text_line_num.get('1.0','1.end').strip.to_i
|
598
|
+
line_end = @text_line_num.index('end').split('.')[0].to_i+line_begin
|
599
|
+
if _line.to_i >= line_begin && _line.to_i <= line_end
|
600
|
+
rel_line = _line.to_i - line_begin +1
|
601
|
+
end
|
602
|
+
rel_line
|
603
|
+
end
|
604
|
+
|
605
|
+
def add_tag_breakpoint(_line)
|
606
|
+
rel_line = file_line_to_text_line_num_line(_line)
|
607
|
+
if rel_line
|
608
|
+
i1 = "#{rel_line}.0"
|
609
|
+
i2 = i1+' + 2 chars'
|
610
|
+
@text_line_num.tag_add('breakpoint',i1,i2)
|
611
|
+
end
|
612
|
+
end
|
613
|
+
|
614
|
+
def remove_tag_breakpoint(_line)
|
615
|
+
rel_line = file_line_to_text_line_num_line(_line)
|
616
|
+
if rel_line
|
617
|
+
i1 = "#{rel_line}.0"
|
618
|
+
i2 = i1+' lineend'
|
619
|
+
@text_line_num.tag_remove('breakpoint',i1,i2)
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
# def add_tag_breakpoint(_index=nil)
|
626
|
+
# _i1 = _index+' linestart'
|
627
|
+
# _i2 = _i1+' + 2 chars'
|
628
|
+
# @text_line_num.tag_add('breakpoint',_i1,_i2)
|
629
|
+
# end
|
630
|
+
|
631
|
+
# def remove_tag_breakpoint(_index=nil)
|
632
|
+
# _i1 = _index+' linestart'
|
633
|
+
# _i2 = _index+' lineend'
|
634
|
+
# #p "Editor: _i1:#{_i1} _i2:#{_i2}"
|
635
|
+
# @text_line_num.tag_remove('breakpoint',_i1,_i2)
|
636
|
+
# end
|
637
|
+
|
638
|
+
def toggle_breakpoint(_index=nil)
|
639
|
+
if !_index.nil?
|
640
|
+
_line = @text_line_num.get(_index+' linestart',_index+' lineend').strip
|
641
|
+
_i1 = _index+' linestart'
|
642
|
+
_i2 = _i1+' + 2 chars'
|
643
|
+
|
644
|
+
if @controller.breakpoint_lines_on_file(@file).include?(_line)
|
645
|
+
#remove_tag_breakpoint(_index)
|
646
|
+
@controller.breakpoint_del(@file, _line)
|
647
|
+
else
|
648
|
+
@text_line_num.tag_remove('current',_i1,_i2)
|
649
|
+
#add_tag_breakpoint(_index)
|
650
|
+
@controller.breakpoint_add(@file, _line)
|
651
|
+
end
|
652
|
+
end
|
499
653
|
end
|
500
654
|
|
501
655
|
def initialize_highlight
|
656
|
+
@is_line_bold = Hash.new
|
657
|
+
@is_tag_bold = Hash.new
|
658
|
+
do_tag_configure_global('debug')
|
502
659
|
if @lang_hash.nil?
|
503
660
|
@highlighting = false
|
504
661
|
return
|
@@ -511,9 +668,8 @@ class AgEditor
|
|
511
668
|
@last_line_end = 0
|
512
669
|
@last_zone_begin=0;
|
513
670
|
@last_zone_end=0;
|
514
|
-
|
515
|
-
|
516
|
-
|
671
|
+
#@is_line_bold = Hash.new
|
672
|
+
#@is_tag_bold = Hash.new
|
517
673
|
@h_classes = @lang_hash['classes'].split(',')
|
518
674
|
@h_re = Hash.new
|
519
675
|
@op_to_end_line = Array.new
|
@@ -547,6 +703,8 @@ class AgEditor
|
|
547
703
|
if @lang_hash['hightlight.'+_name+'.style']== 'bold'
|
548
704
|
h['font']=@font_bold
|
549
705
|
@is_tag_bold[_name]= true
|
706
|
+
else
|
707
|
+
@is_tag_bold[_name]= false
|
550
708
|
end
|
551
709
|
if @lang_hash['hightlight.'+_name+'.relief']
|
552
710
|
h['relief']=@lang_hash['hightlight.'+_name+'.relief']
|
@@ -569,6 +727,8 @@ class AgEditor
|
|
569
727
|
if $arcadia['conf']['editor.hightlight.'+_name+'.style']== 'bold'
|
570
728
|
h['font']=@font_bold
|
571
729
|
@is_tag_bold[_name]= true
|
730
|
+
else
|
731
|
+
@is_tag_bold[_name]= false
|
572
732
|
end
|
573
733
|
if $arcadia['conf']['editor.hightlight.'+_name+'.relief']
|
574
734
|
h['relief']=$arcadia['conf']['editor.hightlight.'+_name+'.relief']
|
@@ -1084,12 +1244,12 @@ class AgEditor
|
|
1084
1244
|
if @op_only_first.include?(_tag) && _txt
|
1085
1245
|
#eliminino la prima riga a partire dal risultato
|
1086
1246
|
_p = _txt.index("\n")+1
|
1087
|
-
|
1247
|
+
if _p
|
1088
1248
|
_txt = _txt[_p..-1]
|
1089
1249
|
_offset = _offset + _p
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1250
|
+
else
|
1251
|
+
m = nil
|
1252
|
+
end
|
1093
1253
|
end
|
1094
1254
|
m = _re.match(_txt)
|
1095
1255
|
|
@@ -1347,17 +1507,21 @@ class AgEditor
|
|
1347
1507
|
|
1348
1508
|
def do_line_update
|
1349
1509
|
#re num in @text_line_num the portion of visibled screen of @text
|
1510
|
+
#Arcadia.console(self, 'msg'=>"do_line_update loading ..")
|
1350
1511
|
return if @loading
|
1512
|
+
#Arcadia.console(self, 'msg'=>"do_line_update")
|
1351
1513
|
if @text_line_num
|
1352
|
-
|
1514
|
+
line_begin_index = @text.index('@0,0')
|
1515
|
+
line_begin = line_begin_index.split('.')[0].to_i
|
1353
1516
|
line_end = @text.index('@0,'+TkWinfo.height(@text).to_s).split('.')[0].to_i + 1
|
1517
|
+
wrap_on = @text.cget("wrap") != 'none'
|
1354
1518
|
# breakpoint
|
1355
1519
|
b = @controller.breakpoint_lines_on_file(@file)
|
1356
1520
|
if @highlighting
|
1357
1521
|
_zone_begin = ((line_begin) / @highlight_zone_length).to_i + 1
|
1358
1522
|
_zone_end = ((line_end) / @highlight_zone_length).to_i + 1
|
1359
1523
|
#Arcadia.new_msg(self, "for lines #{line_begin}..#{line_end} \n
|
1360
|
-
|
1524
|
+
_zone_begin=#{_zone_begin} ; _zone_end=#{_zone_end}")
|
1361
1525
|
(_zone_begin >=@last_zone_begin)?_zone_begin.upto(_zone_end+1){|_zone|
|
1362
1526
|
highlight_zone(_zone)
|
1363
1527
|
}:_zone_end.downto(_zone_begin-1){|_zone|
|
@@ -1368,21 +1532,77 @@ class AgEditor
|
|
1368
1532
|
@last_zone_begin = _zone_begin
|
1369
1533
|
@last_zone_end = _zone_end
|
1370
1534
|
end
|
1371
|
-
|
1535
|
+
|
1372
1536
|
@text_line_num.delete('1.0','end')
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1537
|
+
|
1538
|
+
_rx, _ry, _widht, _heigth = @text.bbox(line_begin_index);
|
1539
|
+
# _rx2, _ry2, _widht2, _heigth2 = @text.bbox(line_begin_index+" +1 lines");
|
1540
|
+
# if _rx2
|
1541
|
+
# _coef = _ry2-_ry-_heigth
|
1542
|
+
# end
|
1543
|
+
# if _ry < 0
|
1544
|
+
# nline = (line_begin + 1).to_s.rjust(line_end.to_s.length+2)
|
1545
|
+
# @text_line_num.tag_configure('start_case', 'spacing1'=>(_heigth+_ry))
|
1546
|
+
# @text_line_num.insert('end', "#{nline}\n",'normal_case','start_case')
|
1547
|
+
# real_line_begin = line_begin + 2
|
1548
|
+
# else
|
1549
|
+
# real_line_begin = line_begin
|
1550
|
+
# end
|
1551
|
+
|
1552
|
+
if _ry < 0
|
1553
|
+
real_line_end = line_end + 1
|
1554
|
+
# x = (_heigth+_ry)/_heigth
|
1555
|
+
# @text_line_num.yview_scroll(-(_heigth+_ry),"pixels")
|
1556
|
+
|
1557
|
+
else
|
1558
|
+
real_line_end = line_end
|
1559
|
+
end
|
1560
|
+
|
1561
|
+
_tags = Array.new
|
1562
|
+
for j in line_begin...real_line_end
|
1563
|
+
nline = j.to_s.rjust(line_end.to_s.length+2)
|
1376
1564
|
_index = @text_line_num.index('end')
|
1565
|
+
_tags.clear
|
1377
1566
|
if @highlighting && @is_line_bold[j]
|
1378
|
-
|
1567
|
+
_tags << 'bold_case'
|
1379
1568
|
else
|
1380
|
-
|
1569
|
+
_tags << 'normal_case'
|
1381
1570
|
end
|
1571
|
+
|
1572
|
+
if wrap_on
|
1573
|
+
w_rx_b, w_ry_b, w_widht_b, w_heigth_b = @text.bbox("#{(j).to_s}.0");
|
1574
|
+
w_rx_e, w_ry_e, w_widht_e, w_heigth_e = @text.bbox("#{(j).to_s}.0 lineend");
|
1575
|
+
if w_ry_e && w_ry_b
|
1576
|
+
delta = w_ry_e - w_ry_b
|
1577
|
+
if delta > 1
|
1578
|
+
_tag = "wrap_case_#{j}"
|
1579
|
+
@text_line_num.tag_configure(_tag, 'spacing3'=>delta)
|
1580
|
+
_tags << _tag
|
1581
|
+
end
|
1582
|
+
end
|
1583
|
+
end
|
1584
|
+
|
1585
|
+
@text_line_num.insert(_index, "#{nline}\n",_tags)
|
1586
|
+
# if @highlighting && @is_line_bold[j]
|
1587
|
+
# @text_line_num.insert('end', "#{nline}\n",'bold_case')
|
1588
|
+
# else
|
1589
|
+
# @text_line_num.insert('end', "#{nline}\n",'normal_case')
|
1590
|
+
# end
|
1382
1591
|
if b.include?(j.to_s)
|
1383
|
-
|
1592
|
+
add_tag_breakpoint(j)
|
1593
|
+
#add_tag_breakpoint(_index)
|
1594
|
+
#p "aggiungo tag break on line #{j} on index ->#{_index}"
|
1595
|
+
#add_tag_breakpoint(_index+' -1 lines')
|
1384
1596
|
end
|
1385
1597
|
end
|
1598
|
+
if _ry < 0
|
1599
|
+
#Arcadia.console(self, 'msg'=>"scrollo -> #{-(_heigth+_ry)}")
|
1600
|
+
#Arcadia.console(self, 'msg'=>"_coef -> #{_coef}")
|
1601
|
+
|
1602
|
+
# @text_line_num.yview_scroll((_heigth+_ry),"pixels")
|
1603
|
+
# @text_line_num.yview_scroll((-_ry+3),"pixels")
|
1604
|
+
@text_line_num.yview_scroll(_ry.abs+3,"pixels")
|
1605
|
+
end
|
1386
1606
|
end
|
1387
1607
|
end
|
1388
1608
|
|
@@ -1551,8 +1771,9 @@ class AgEditor
|
|
1551
1771
|
# else
|
1552
1772
|
# @lang = nil
|
1553
1773
|
# end
|
1774
|
+
is_ruby = _ext=='rb'||_ext=='rbw'
|
1554
1775
|
@lang_hash = languages_hash(_ext)
|
1555
|
-
if !_ext.nil? &&
|
1776
|
+
if !_ext.nil? && is_ruby
|
1556
1777
|
@fm = AGTkVSplittedFrames.new(@page_frame,_w1)
|
1557
1778
|
@fm1 = AGTkVSplittedFrames.new(@fm.right_frame,_w2)
|
1558
1779
|
initialize_tree(@fm.left_frame)
|
@@ -1564,6 +1785,7 @@ class AgEditor
|
|
1564
1785
|
initialize_highlight
|
1565
1786
|
initialize_line_number(@fm1.left_frame)
|
1566
1787
|
initialize_text_binding
|
1788
|
+
initialize_complete_code if is_ruby
|
1567
1789
|
end
|
1568
1790
|
|
1569
1791
|
def file_extension(_filename=nil)
|
@@ -1623,6 +1845,7 @@ class AgMultiEditorView
|
|
1623
1845
|
@enb = Tk::BWidget::NoteBook.new(parent,Arcadia.style('tabpanel')){
|
1624
1846
|
tabbevelsize 0
|
1625
1847
|
internalborderwidth 2
|
1848
|
+
# arcradius 4
|
1626
1849
|
# activeforeground 'red'
|
1627
1850
|
# activebackground 'yellow'
|
1628
1851
|
#borderwidth 1
|
@@ -1639,9 +1862,9 @@ class AgMultiEditor < ArcadiaExt
|
|
1639
1862
|
attr_reader :breakpoints
|
1640
1863
|
attr_reader :splitted_frame
|
1641
1864
|
def on_before_build(_event)
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1865
|
+
@breakpoints =Array.new
|
1866
|
+
@tabs_file =Hash.new
|
1867
|
+
@tabs_editor =Hash.new
|
1645
1868
|
Arcadia.attach_listener(self, BufferEvent)
|
1646
1869
|
Arcadia.attach_listener(self, DebugEvent)
|
1647
1870
|
Arcadia.attach_listener(self, RunRubyFileEvent)
|
@@ -1666,15 +1889,13 @@ class AgMultiEditor < ArcadiaExt
|
|
1666
1889
|
|
1667
1890
|
def on_build(_event)
|
1668
1891
|
@main_frame = AgMultiEditorView.new(self.frame.hinner_frame)
|
1669
|
-
@tabs_file =Hash.new
|
1670
|
-
@tabs_editor =Hash.new
|
1671
|
-
@breakpoints =Array.new
|
1672
1892
|
create_find
|
1673
1893
|
pop_up_menu
|
1674
1894
|
end
|
1675
1895
|
|
1676
1896
|
def on_after_build(_event)
|
1677
1897
|
self.open_last_files
|
1898
|
+
#self.load_persistent_breakpoints
|
1678
1899
|
end
|
1679
1900
|
|
1680
1901
|
def pop_up_menu
|
@@ -1766,7 +1987,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1766
1987
|
# end
|
1767
1988
|
|
1768
1989
|
def on_before_step_debug(_event)
|
1769
|
-
|
1990
|
+
debug_reset
|
1770
1991
|
end
|
1771
1992
|
|
1772
1993
|
def on_after_debug(_event)
|
@@ -1780,17 +2001,28 @@ class AgMultiEditor < ArcadiaExt
|
|
1780
2001
|
@last_e.mark_debug(@last_index) if @last_e
|
1781
2002
|
end
|
1782
2003
|
when SetBreakpointEvent
|
1783
|
-
|
2004
|
+
if _event.active == 1
|
2005
|
+
@breakpoints << {:file=>_event.file,:line=>_event.row}
|
2006
|
+
_e = @tabs_editor[tab_file_name(_event.file)]
|
2007
|
+
_e.add_tag_breakpoint(_event.row) if _e
|
2008
|
+
#_e.add_tag_breakpoint("#{_event.row}.0") if _e
|
2009
|
+
end
|
1784
2010
|
when UnsetBreakpointEvent
|
2011
|
+
#p "ae-editor : UnsetBreakpointEvent file : #{_event.file}"
|
2012
|
+
#p "ae-editor : UnsetBreakpointEvent _event.row : #{_event.row}"
|
1785
2013
|
@breakpoints.delete_if{|b| (b[:file]==_event.file && b[:line]==_event.row)}
|
2014
|
+
_e = @tabs_editor[tab_file_name(_event.file)]
|
2015
|
+
_e.remove_tag_breakpoint(_event.row) if _e
|
1786
2016
|
end
|
1787
2017
|
end
|
1788
2018
|
|
1789
2019
|
def on_debug_step_info(_event)
|
1790
2020
|
#Arcadia.new_debug_msg(self, "file: #{_event.file}:#{_event.row}")
|
2021
|
+
#Arcadia.console(self, :msg=> "ae-editor -> DebugStepInfoEvent")
|
1791
2022
|
if _event.file
|
1792
2023
|
self.open_file_in_debug(_event.file, _event.row)
|
1793
2024
|
end
|
2025
|
+
Tk.update
|
1794
2026
|
end
|
1795
2027
|
|
1796
2028
|
# def on_before_buffer(_event)
|
@@ -1804,19 +2036,19 @@ class AgMultiEditor < ArcadiaExt
|
|
1804
2036
|
self.open_buffer
|
1805
2037
|
when OpenBufferEvent
|
1806
2038
|
if _event.file
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
2039
|
+
if _event.row
|
2040
|
+
_index = _event.row.to_s+'.0'
|
2041
|
+
end
|
2042
|
+
self.open_file(_event.file, _index)
|
1811
2043
|
elsif _event.text
|
1812
2044
|
if _event.title
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
2045
|
+
_tab_name = self.tab_name(_event.title)
|
2046
|
+
self.open_buffer(_tab_name, _event.title)
|
2047
|
+
_e = @tabs_editor[_tab_name]
|
2048
|
+
_e.text_insert('end',_event.text)
|
2049
|
+
_e.reset
|
2050
|
+
_e.refresh
|
2051
|
+
#add_reverse_item(_e)
|
1820
2052
|
end
|
1821
2053
|
else
|
1822
2054
|
_event.file = Tk.getOpenFile
|
@@ -1824,7 +2056,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1824
2056
|
end
|
1825
2057
|
when CloseBufferEvent
|
1826
2058
|
if _event.file
|
1827
|
-
|
2059
|
+
self.close_file(_event.file)
|
1828
2060
|
end
|
1829
2061
|
when SaveAsBufferEvent
|
1830
2062
|
if _event.file == nil
|
@@ -1851,6 +2083,19 @@ class AgMultiEditor < ArcadiaExt
|
|
1851
2083
|
end
|
1852
2084
|
end
|
1853
2085
|
|
2086
|
+
# def load_persistent_breakpoints
|
2087
|
+
# b = Arcadia.persistent('editor.debug_breakpoints')
|
2088
|
+
# if b
|
2089
|
+
# _files_list =b.split("|")
|
2090
|
+
# _files_list.each do |value|
|
2091
|
+
# _file,_line = value.split('@@@')
|
2092
|
+
# if _file && _line
|
2093
|
+
# breakpoint_add(_file,_line)
|
2094
|
+
# end
|
2095
|
+
# end
|
2096
|
+
# end
|
2097
|
+
# end
|
2098
|
+
|
1854
2099
|
def xy_insert
|
1855
2100
|
_text = self.raised.text
|
1856
2101
|
_index_now = _text.index('insert')
|
@@ -1888,54 +2133,107 @@ class AgMultiEditor < ArcadiaExt
|
|
1888
2133
|
_xroot = _x - TkWinfo.rootx(@arcadia.layout.root)
|
1889
2134
|
_yroot = _y - TkWinfo.rooty(@arcadia.layout.root)
|
1890
2135
|
|
1891
|
-
|
2136
|
+
_max_height = TkWinfo.screenheight(@arcadia.layout.root) - _y - 5
|
1892
2137
|
|
1893
2138
|
@raised_listbox = TkListbox.new(@arcadia.layout.root, {
|
1894
|
-
|
2139
|
+
:takefocus=>true,
|
1895
2140
|
:selectbackground=>Arcadia.conf('hightlight.1.background'),
|
1896
2141
|
:selectforeground=>Arcadia.conf('hightlight.1.foreground'),
|
1897
2142
|
:activestyle=>'none'}.update(Arcadia.style('listbox'))
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
_temp_width = _font.measure(_key) + _font.measure('X')*3
|
1908
|
-
_width = _temp_width if _temp_width > _width
|
1909
|
-
}
|
1910
|
-
_height = (candidates.length+1)*_char_height
|
1911
|
-
_height = _max_height if _height > _max_height
|
1912
|
-
@raised_listbox.place('x'=>_xroot,'y'=>_yroot, 'width'=>_width, 'height'=>_height)
|
2143
|
+
)
|
2144
|
+
v_scroll = TkScrollbar.new(@raised_listbox,{
|
2145
|
+
'orient'=>'vertical'}.update(Arcadia.style('scrollbar'))
|
2146
|
+
).pack('side' => 'right', 'fill' => 'y')
|
2147
|
+
|
2148
|
+
v_scroll.command(proc{|*args|
|
2149
|
+
@raised_listbox.yview *args
|
2150
|
+
})
|
2151
|
+
@raised_listbox.yscrollcommand(proc{|first,last| v_scroll.set(first,last) })
|
1913
2152
|
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
2153
|
+
_font = TkFont.new(conf('edit.font'))
|
2154
|
+
_char_height = _font.metrics[2][1]
|
2155
|
+
_width = 0
|
2156
|
+
_docs_entries = Hash.new
|
2157
|
+
_update_list = proc{|_in|
|
2158
|
+
@raised_listbox.delete('0','end')
|
2159
|
+
candidates.each{|value|
|
2160
|
+
_key, _doc = value.split
|
2161
|
+
if _in.nil? || _in.strip.length == 0 || _key[0.._in.length-1] == _in
|
2162
|
+
_docs_entries[_key]= _doc
|
2163
|
+
@raised_listbox.insert('end', _key)
|
2164
|
+
_temp_width = _font.measure(_key) + _font.measure('X')*3
|
2165
|
+
_width = _temp_width if _temp_width > _width
|
2166
|
+
end
|
2167
|
+
}
|
2168
|
+
Tk.event_generate(@raised_listbox, "1") if TkWinfo.mapped?(@raised_listbox)
|
2169
|
+
}
|
2170
|
+
_update_list.call
|
2171
|
+
_width = _width + 15
|
2172
|
+
#_height = (candidates.length+1)*_char_height
|
2173
|
+
_height = 15*_char_height
|
2174
|
+
_height = _max_height if _height > _max_height
|
2175
|
+
|
2176
|
+
_buffer = _text.get(_begin_index, 'insert')
|
2177
|
+
_buffer_ini_length = _buffer.length
|
2178
|
+
# i2 = _begin_index
|
2179
|
+
# i1 = _text.index("#{i2} -1 chars")
|
2180
|
+
# xchar = _text.get(i1, i2)
|
2181
|
+
# while xchar != '.' && xchar != "\s" && xchar != "\n"
|
2182
|
+
# _buffer = xchar + _buffer
|
2183
|
+
# i2 = i1
|
2184
|
+
# i1 = _text.index("#{i2} -1 chars")
|
2185
|
+
# xchar = _text.get(i1, i2)
|
2186
|
+
# end
|
2187
|
+
@raised_listbox.place('x'=>_xroot,'y'=>_yroot, 'width'=>_width, 'height'=>_height)
|
2188
|
+
@raised_listbox.focus
|
2189
|
+
@raised_listbox.activate(0)
|
2190
|
+
@raised_listbox.grab("set")
|
2191
|
+
Tk.event_generate(@raised_listbox, "1")
|
2192
|
+
_insert_selected_value = proc{
|
2193
|
+
_value = @raised_listbox.get('active')
|
2194
|
+
_text.delete(_begin_index,'insert')
|
2195
|
+
_text.insert('insert',_value)
|
2196
|
+
@raised_listbox.grab("release")
|
2197
|
+
@raised_listbox.destroy
|
2198
|
+
_text.focus
|
2199
|
+
#_menu.destroy
|
2200
|
+
Tk.callback_break
|
2201
|
+
}
|
2202
|
+
@raised_listbox.bind_append("Double-ButtonPress-1"){|e|
|
2203
|
+
_insert_selected_value.call
|
2204
|
+
}
|
2205
|
+
@raised_listbox.bind_append('KeyPress'){|e|
|
2206
|
+
case e.keysym
|
2207
|
+
when 'Escape'
|
2208
|
+
@raised_listbox.grab("release")
|
2209
|
+
@raised_listbox.destroy
|
2210
|
+
_text.focus
|
2211
|
+
#_menu.destroy
|
2212
|
+
Tk.callback_break
|
2213
|
+
when 'Return'
|
2214
|
+
_insert_selected_value.call
|
2215
|
+
when 'F1'
|
2216
|
+
_key = @raised_listbox.get('active')
|
2217
|
+
_x, _y = xy_insert
|
2218
|
+
Arcadia.process_event(DocCodeEvent.new(self, 'doc_entry'=>_docs_entries[_key], 'xdoc'=>_x, 'ydoc'=>_y))
|
2219
|
+
#EditorContract.instance.doc_code(self, 'doc_entry'=>_docs_entries[_key], 'xdoc'=>_x, 'ydoc'=>_y)
|
2220
|
+
when 'a'..'z'
|
2221
|
+
_text.insert('insert',e.keysym)
|
2222
|
+
_buffer = _buffer + e.keysym
|
2223
|
+
_update_list.call(_buffer)
|
2224
|
+
when 'BackSpace'
|
2225
|
+
if _buffer.length > _buffer_ini_length
|
2226
|
+
_text.delete("#{_begin_index} + #{_buffer.length-1} chars" ,'insert')
|
2227
|
+
_buffer = _buffer[0..-2]
|
2228
|
+
Tk.update
|
2229
|
+
_update_list.call(_buffer)
|
2230
|
+
end
|
2231
|
+
end
|
2232
|
+
}
|
2233
|
+
elsif candidates.length == 1 && candidates[0].length>0
|
2234
|
+
_text.delete(_begin_index,'insert');
|
2235
|
+
_text.insert('insert',candidates[0].split[0])
|
2236
|
+
end
|
1939
2237
|
end
|
1940
2238
|
end
|
1941
2239
|
|
@@ -1952,10 +2250,21 @@ class AgMultiEditor < ArcadiaExt
|
|
1952
2250
|
def on_finalize(_event)
|
1953
2251
|
_files =''
|
1954
2252
|
@tabs_editor.each_value{|editor|
|
1955
|
-
|
2253
|
+
if editor.file != nil
|
2254
|
+
_files=_files+'|' if _files.strip.length > 0
|
2255
|
+
_files=_files + editor.file
|
2256
|
+
end
|
1956
2257
|
close_editor(editor)
|
1957
2258
|
}
|
1958
|
-
|
2259
|
+
Arcadia.persistent('editor.files.open', _files)
|
2260
|
+
# _breakpoints = '';
|
2261
|
+
# @breakpoints.each{|point|
|
2262
|
+
# if point[:file] != nil
|
2263
|
+
# _breakpoints=_breakpoints+'|' if _breakpoints.strip.length > 0
|
2264
|
+
# _breakpoints=_breakpoints + "#{point[:file]}@@@#{point[:line]}"
|
2265
|
+
# end
|
2266
|
+
# }
|
2267
|
+
# Arcadia.persistent('editor.debug_breakpoints', _breakpoints)
|
1959
2268
|
end
|
1960
2269
|
|
1961
2270
|
def raised
|
@@ -1973,15 +2282,11 @@ class AgMultiEditor < ArcadiaExt
|
|
1973
2282
|
end
|
1974
2283
|
|
1975
2284
|
def breakpoint_add(_file,_line)
|
1976
|
-
Arcadia.process_event(SetBreakpointEvent.new(self, 'file'=>_file, 'row'=>_line))
|
1977
|
-
#EditorContract.instance.breakpoint_created(self, 'file'=>_file, 'line'=>_line)
|
1978
|
-
#@breakpoints << {:file=>_file,:line=>_line}
|
2285
|
+
Arcadia.process_event(SetBreakpointEvent.new(self, 'file'=>_file, 'row'=>_line, 'active'=>1))
|
1979
2286
|
end
|
1980
2287
|
|
1981
2288
|
def breakpoint_del(_file,_line)
|
1982
2289
|
Arcadia.process_event(UnsetBreakpointEvent.new(self, 'file'=>_file, 'row'=>_line))
|
1983
|
-
#EditorContract.instance.breakpoint_deleted(self, 'file'=>_file, 'line'=>_line)
|
1984
|
-
#@breakpoints.delete_if{|b| (b[:file]==_file && b[:line]==_line)}
|
1985
2290
|
end
|
1986
2291
|
|
1987
2292
|
def breakpoint_lines_on_file(_file)
|
@@ -2149,6 +2454,7 @@ class AgMultiEditor < ArcadiaExt
|
|
2149
2454
|
if !_editor_exist
|
2150
2455
|
@editors_in_debug << @last_e
|
2151
2456
|
# workaround for hightlight
|
2457
|
+
#p "add editor for close #{_filename}"
|
2152
2458
|
@last_e.do_line_update
|
2153
2459
|
end
|
2154
2460
|
end
|
@@ -2183,7 +2489,7 @@ class AgMultiEditor < ArcadiaExt
|
|
2183
2489
|
_basefilename = File.basename(_filename)
|
2184
2490
|
#_basename = _basefilename.split('.')[0]+'_'+_basefilename.split('.')[1]
|
2185
2491
|
|
2186
|
-
_name = self.
|
2492
|
+
_name = self.tab_file_name(_filename)
|
2187
2493
|
_index = @main_frame.enb.index(_name)
|
2188
2494
|
if _index == -1
|
2189
2495
|
_index = @main_frame.enb.index(name_read_only(_name))
|
@@ -2253,10 +2559,14 @@ class AgMultiEditor < ArcadiaExt
|
|
2253
2559
|
end
|
2254
2560
|
_tab = @main_frame.enb.insert('end', _buffer_name ,
|
2255
2561
|
'text'=> _title,
|
2562
|
+
'background'=> Arcadia.style("tabpanel.background"),
|
2563
|
+
'foreground'=> Arcadia.style("tabpanel.foreground"),
|
2256
2564
|
'raisecmd'=>proc{do_buffer_raise(_buffer_name, _title)}
|
2257
2565
|
)
|
2258
2566
|
_e = AgEditor.new(self, _tab)
|
2259
|
-
_e.
|
2567
|
+
ext = _e.file_extension(_title)
|
2568
|
+
ext='rb' if ext.nil?
|
2569
|
+
_e.init_editing(ext, w1)
|
2260
2570
|
#@tabs_file[_buffer_name]= nil
|
2261
2571
|
@tabs_editor[_buffer_name]=_e
|
2262
2572
|
end
|
@@ -2327,11 +2637,11 @@ class Findview < TkFloatTitledFrame
|
|
2327
2637
|
#stop_resizing
|
2328
2638
|
y0 = 10
|
2329
2639
|
d = 23
|
2330
|
-
|
2640
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2331
2641
|
text 'Find what:'
|
2332
2642
|
place('x' => 8,'y' => y0,'height' => 19)
|
2333
|
-
|
2334
|
-
|
2643
|
+
}
|
2644
|
+
y0 = y0 + d
|
2335
2645
|
@e_what = Tk::BWidget::ComboBox.new(self.frame, Arcadia.style('combobox')){
|
2336
2646
|
editable true
|
2337
2647
|
justify 'left'
|
@@ -2346,12 +2656,12 @@ class Findview < TkFloatTitledFrame
|
|
2346
2656
|
|
2347
2657
|
@e_what_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_what_entry))})
|
2348
2658
|
|
2349
|
-
|
2350
|
-
|
2659
|
+
y0 = y0 + d
|
2660
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2351
2661
|
text 'Replace with:'
|
2352
2662
|
place('x' => 8,'y' => y0,'height' => 19)
|
2353
|
-
|
2354
|
-
|
2663
|
+
}
|
2664
|
+
y0 = y0 + d
|
2355
2665
|
|
2356
2666
|
@e_with = Tk::BWidget::ComboBox.new(self.frame, Arcadia.style('combobox')){
|
2357
2667
|
editable true
|
@@ -2385,7 +2695,7 @@ class Findview < TkFloatTitledFrame
|
|
2385
2695
|
|
2386
2696
|
y0 = y0 + d
|
2387
2697
|
y0 = y0 + d
|
2388
|
-
|
2698
|
+
@buttons_frame = TkFrame.new(self.frame, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom')
|
2389
2699
|
|
2390
2700
|
@b_replace_all = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2391
2701
|
state 'disabled'
|
@@ -2662,11 +2972,11 @@ class GoToLine < TkFloatTitledFrame
|
|
2662
2972
|
#stop_resizing
|
2663
2973
|
y0 = 10
|
2664
2974
|
d = 23
|
2665
|
-
|
2975
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2666
2976
|
text 'Go to line:'
|
2667
2977
|
place('x' => 8,'y' => y0,'height' => 19)
|
2668
|
-
|
2669
|
-
|
2978
|
+
}
|
2979
|
+
y0 = y0 + d
|
2670
2980
|
@e_line = TkEntry.new(self.frame, Arcadia.style('edit')){
|
2671
2981
|
justify 'left'
|
2672
2982
|
#relief 'ridge'
|
@@ -2676,7 +2986,7 @@ class GoToLine < TkFloatTitledFrame
|
|
2676
2986
|
|
2677
2987
|
y0 = y0 + d
|
2678
2988
|
y0 = y0 + d
|
2679
|
-
|
2989
|
+
@buttons_frame = TkFrame.new(self.frame, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom')
|
2680
2990
|
|
2681
2991
|
@b_go = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2682
2992
|
compound 'none'
|