arcadia 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +132 -134
- data/bin/arcadia +13 -0
- data/conf/arcadia.conf +196 -3
- data/conf/arcadia.init.rb +27 -6
- data/conf/arcadia.res.rb +10 -0
- data/ext/ae-complete-code/ae-complete-code.rb +76 -82
- data/ext/ae-doc-code/ae-doc-code.rb +295 -291
- data/ext/ae-editor/ae-editor.conf +88 -67
- data/ext/ae-editor/ae-editor.rb +400 -202
- data/ext/ae-editor/langs/conf.lang +16 -5
- data/ext/ae-editor/langs/lang.lang.bind +1 -1
- data/ext/ae-editor/langs/rb.lang +77 -41
- data/ext/ae-editor/langs/rbw.lang.bind +1 -1
- data/ext/ae-event-log/ae-event-log.rb +46 -45
- data/ext/ae-file-history/ae-file-history.conf +1 -1
- data/ext/ae-file-history/ae-file-history.rb +373 -298
- data/ext/ae-output/ae-output.conf +2 -0
- data/ext/ae-output/ae-output.rb +200 -202
- data/ext/ae-rad/ae-rad-inspector.rb +64 -70
- data/ext/ae-rad/ae-rad-palette.rb +14 -14
- data/ext/ae-rad/ae-rad.conf +2 -0
- data/ext/ae-rad/lib/tk/al-tk.rb +2991 -2987
- data/ext/ae-rad/lib/tk/al-tkarcadia.rb +26 -26
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +8 -8
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +1566 -1465
- data/ext/ae-search-in-files/ae-search-in-files.rb +294 -284
- data/ext/ae-shell/ae-shell.rb +20 -11
- data/{base → lib}/a-commons.rb +291 -80
- data/{base → lib}/a-contracts.rb +40 -18
- data/{arcadia.rb → lib/a-core.rb} +238 -148
- data/{base → lib}/a-tkcommons.rb +81 -63
- metadata +64 -65
- data/ext/ae-action-dispatcher/ae-action-dispatcher.conf +0 -6
- data/ext/ae-action-dispatcher/ae-action-dispatcher.rb +0 -22
- data/ext/ae-inspector/ae-inspector.conf +0 -7
- data/ext/ae-inspector/ae-inspector.rb +0 -1519
- data/ext/ae-palette/ae-palette.conf +0 -7
- data/ext/ae-palette/ae-palette.rb +0 -265
@@ -10,17 +10,17 @@ tabs=0.5c left
|
|
10
10
|
tab-replace-width-space=2
|
11
11
|
|
12
12
|
#tabs
|
13
|
-
tabs.font=courier 11
|
14
|
-
freebsd::tabs.font=courier 12
|
15
|
-
win::tabs.font={Courier New} 9
|
16
|
-
|
13
|
+
#tabs.font=courier 11
|
14
|
+
#freebsd::tabs.font=courier 12
|
15
|
+
#win::tabs.font={Courier New} 9
|
16
|
+
##tabs.side=bottom
|
17
17
|
tabs.side=top
|
18
18
|
|
19
19
|
# editor
|
20
|
-
font=courier 11
|
21
|
-
font.bold=courier 11 bold
|
22
|
-
freebsd::font=courier 12
|
23
|
-
freebsd::font.bold=courier 12 bold
|
20
|
+
#font=courier 11
|
21
|
+
#font.bold=courier 11 bold
|
22
|
+
#freebsd::font=courier 12
|
23
|
+
#freebsd::font.bold=courier 12 bold
|
24
24
|
win::font={Courier New} 9
|
25
25
|
win::font.bold={Courier New} 9 bold
|
26
26
|
#+--------------------------------------------------
|
@@ -39,43 +39,62 @@ win::font.bold={Courier New} 9 bold
|
|
39
39
|
#hightlight.goto.color.background=yellow
|
40
40
|
#+--------------------------------------------------
|
41
41
|
#+--------------------------------------------------
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
hightlight.
|
46
|
-
hightlight.
|
47
|
-
hightlight.
|
48
|
-
hightlight.
|
49
|
-
hightlight.
|
50
|
-
hightlight.
|
51
|
-
hightlight.
|
52
|
-
hightlight.
|
53
|
-
hightlight.
|
54
|
-
hightlight.
|
55
|
-
hightlight.
|
56
|
-
hightlight.
|
57
|
-
hightlight.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
hightlight.
|
65
|
-
hightlight.
|
66
|
-
hightlight.
|
67
|
-
hightlight.
|
68
|
-
hightlight.
|
69
|
-
#hightlight.
|
70
|
-
hightlight.
|
71
|
-
hightlight.
|
72
|
-
hightlight.
|
73
|
-
hightlight.
|
74
|
-
hightlight.
|
75
|
-
hightlight.
|
76
|
-
hightlight.
|
77
|
-
hightlight.
|
78
|
-
hightlight.
|
42
|
+
hightlight.sel.foreground=>>>hightlight.1.foreground
|
43
|
+
hightlight.sel.background=>>>hightlight.1.background
|
44
|
+
hightlight.sel.borderwidth=>>>hightlight.1.borderwidth
|
45
|
+
hightlight.sel.relief=>>>hightlight.1.relief
|
46
|
+
hightlight.selected.background=>>>hightlight.2.background
|
47
|
+
hightlight.tabs.foreground=>>>hightlight.3.foreground
|
48
|
+
hightlight.tabs.background=>>>hightlight.3.background
|
49
|
+
hightlight.tabs.borderwidth=>>>hightlight.3.borderwidth
|
50
|
+
hightlight.tabs.relief=>>>hightlight.3.relief
|
51
|
+
hightlight.spaces.foreground=>>>hightlight.4.foreground
|
52
|
+
hightlight.spaces.background=>>>hightlight.4.background
|
53
|
+
hightlight.spaces.borderwidth=>>>hightlight.4.borderwidth
|
54
|
+
hightlight.spaces.relief=>>>hightlight.4.relief
|
55
|
+
#hightlight.debug.foreground=>>>hightlight.16.foreground
|
56
|
+
hightlight.debug.background=>>>hightlight.16.background
|
57
|
+
hightlight.debug.borderwidth=>>>hightlight.16.borderwidth
|
58
|
+
hightlight.debug.relief=>>>hightlight.16.relief
|
59
|
+
|
60
|
+
|
61
|
+
#color.background=#FFFFFF
|
62
|
+
#color.foreground=#7F7F7F
|
63
|
+
#color.insertbackground=#ff8000
|
64
|
+
#hightlight.keyword.foreground=#00007F
|
65
|
+
#hightlight.keyword.style=bold
|
66
|
+
#hightlight.method_name.foreground=#007F7F
|
67
|
+
#hightlight.method_name.style=bold
|
68
|
+
#hightlight.class_name.foreground=#0000FF
|
69
|
+
#hightlight.class_name.style=bold
|
70
|
+
#hightlight.module_name.foreground=#0000FF
|
71
|
+
#hightlight.module_name.style=bold
|
72
|
+
#hightlight.instance_variable.color.foreground=#7F7F7F
|
73
|
+
#hightlight.instance_variable.style=bold
|
74
|
+
#hightlight.comment.color.foreground=#007F00
|
75
|
+
#hightlight.string.color.foreground=#7F007F
|
76
|
+
#hightlight.number.color.foreground=#007F7F
|
77
|
+
##hightlight.capitalize.color.foreground=#0000FF
|
78
|
+
#hightlight.operator.foreground=#000000
|
79
|
+
#hightlight.operator.style=bold
|
80
|
+
#hightlight.sel.foreground=black
|
81
|
+
#hightlight.sel.background=#68f914
|
82
|
+
#hightlight.sel.borderwidth=1
|
83
|
+
#hightlight.sel.relief=raised
|
84
|
+
#hightlight.debug.foreground=black
|
85
|
+
#hightlight.debug.background=#b3c1d9
|
86
|
+
#hightlight.debug.borderwidth=2
|
87
|
+
#hightlight.debug.relief=groove
|
88
|
+
##hightlight.goto.color.foreground=blue
|
89
|
+
#hightlight.selected.background=yellow
|
90
|
+
#hightlight.tabs.foreground=black
|
91
|
+
#hightlight.tabs.background=#b1cfba
|
92
|
+
#hightlight.tabs.borderwidth=1
|
93
|
+
#hightlight.tabs.relief=raised
|
94
|
+
#hightlight.spaces.foreground=black
|
95
|
+
#hightlight.spaces.background=#d9f42b
|
96
|
+
#hightlight.spaces.borderwidth=1
|
97
|
+
#hightlight.spaces.relief=raised
|
79
98
|
#+--------------------------------------------------
|
80
99
|
|
81
100
|
|
@@ -83,28 +102,30 @@ hightlight.spaces.relief=raised
|
|
83
102
|
#line_number_panel.color.background=#6e6e6e
|
84
103
|
#line_number_panel.color.foreground=white
|
85
104
|
|
86
|
-
line_number_panel.color.background=#e1e1e1
|
87
|
-
|
88
|
-
line_number_panel.color.foreground=#333333
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
explorer_panel.tree.color.background=#ffffff
|
93
|
-
explorer_panel.tree.color.foreground=white
|
94
|
-
|
105
|
+
#line_number_panel.color.background=#e1e1e1
|
106
|
+
##line_number_panel.color.background=#FFFFFF
|
107
|
+
#line_number_panel.color.foreground=#333333
|
108
|
+
#
|
109
|
+
#
|
110
|
+
tree explorer
|
111
|
+
#explorer_panel.tree.color.background=#ffffff
|
112
|
+
#explorer_panel.tree.color.foreground=white
|
113
|
+
##explorer_panel.tabs.side=bottom
|
95
114
|
explorer_panel.tabs.side=top
|
96
|
-
|
97
|
-
explorer_panel.tree.font=courier 11
|
98
|
-
freebsd::explorer_panel.tree.font=courier 12
|
99
|
-
win::explorer_panel.tree.font={Courier New} 9
|
100
|
-
explorer_panel.tree.class.color.foreground=#a42019
|
101
|
-
explorer_panel.tree.class.font=times 10 bold
|
102
|
-
win::explorer_panel.tree.class.font=times 10 bold
|
103
|
-
explorer_panel.tree.def.color.foreground=blue
|
104
|
-
explorer_panel.tree.def.font=times 10
|
105
|
-
win::explorer_panel.tree.def.font=times 10
|
106
|
-
explorer_panel.tree.module.color.foreground=#1b691e
|
107
|
-
explorer_panel.tree.module.font=times 8 bold
|
108
|
-
win::explorer_panel.tree.module.font={Courier New} 9 bold
|
115
|
+
#
|
116
|
+
#explorer_panel.tree.font=courier 11
|
117
|
+
#freebsd::explorer_panel.tree.font=courier 12
|
118
|
+
#win::explorer_panel.tree.font={Courier New} 9
|
119
|
+
#explorer_panel.tree.class.color.foreground=#a42019
|
120
|
+
#explorer_panel.tree.class.font=times 10 bold
|
121
|
+
#win::explorer_panel.tree.class.font=times 10 bold
|
122
|
+
#explorer_panel.tree.def.color.foreground=blue
|
123
|
+
#explorer_panel.tree.def.font=times 10
|
124
|
+
#win::explorer_panel.tree.def.font=times 10
|
125
|
+
#explorer_panel.tree.module.color.foreground=#1b691e
|
126
|
+
#explorer_panel.tree.module.font=times 8 bold
|
127
|
+
#win::explorer_panel.tree.module.font={Courier New} 9 bold
|
109
128
|
|
110
129
|
#:::::::::::::::: Editor group ::::::::::::::::::::::<end>
|
130
|
+
popup.bind.shortcut=Button-3
|
131
|
+
arm::popup.bind.shortcut=F4
|
data/ext/ae-editor/ae-editor.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
require 'tk'
|
7
7
|
require 'tktext'
|
8
|
-
require '
|
8
|
+
require 'lib/a-tkcommons'
|
9
9
|
|
10
10
|
|
11
11
|
class TreeNode
|
@@ -29,6 +29,15 @@ class TreeNode
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
#class TkArcadiaText < TkText
|
33
|
+
#
|
34
|
+
# def insert(insert, chars,*tags)
|
35
|
+
# super(insert, chars,*tags)
|
36
|
+
# self.modified=true
|
37
|
+
# # event_generate("<Modified>")
|
38
|
+
# end
|
39
|
+
#end
|
40
|
+
|
32
41
|
class AgEditor
|
33
42
|
include Configurable
|
34
43
|
attr_reader :file
|
@@ -39,26 +48,42 @@ class AgEditor
|
|
39
48
|
@controller = _controller
|
40
49
|
@page_frame = _page_frame
|
41
50
|
@set_mod = false
|
42
|
-
@font = @controller.conf('font')
|
43
|
-
@font_bold = @controller.conf('font.bold')
|
51
|
+
# @font = @controller.conf('font')
|
52
|
+
# @font_bold = @controller.conf('font.bold')
|
53
|
+
@font = Arcadia.conf('edit.font')
|
54
|
+
@font_bold = "#{Arcadia.conf('edit.font')} bold"
|
44
55
|
@font_metrics = TkFont.new(@font).metrics
|
45
56
|
@font_metrics_bold = TkFont.new(@font_bold).metrics
|
46
57
|
@highlighting = false
|
47
58
|
@classbrowsing = false
|
48
59
|
@find = @controller.get_find
|
49
60
|
@read_only=false
|
61
|
+
@loading=false
|
50
62
|
end
|
51
|
-
|
63
|
+
|
64
|
+
def hide_exp
|
65
|
+
@fm.hide_left if @fm
|
66
|
+
end
|
67
|
+
|
68
|
+
def is_exp_hide?
|
69
|
+
if @fm.nil?
|
70
|
+
return true
|
71
|
+
else
|
72
|
+
@fm.is_left_hide?
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
52
76
|
def initialize_tree(_frame)
|
53
77
|
@classbrowsing = true
|
54
|
-
|
78
|
+
|
79
|
+
@nb = Tk::BWidget::NoteBook.new(_frame, Arcadia.style('tabpanel')){
|
80
|
+
# activeforeground 'red'
|
81
|
+
# activebackground 'yellow'
|
82
|
+
# borderwidth 1
|
83
|
+
# font $arcadia['conf']['editor.tabs.font']
|
55
84
|
tabbevelsize 0
|
56
85
|
internalborderwidth 0
|
57
|
-
activeforeground 'red'
|
58
|
-
activebackground 'yellow'
|
59
|
-
borderwidth 1
|
60
86
|
side $arcadia['conf']['editor.explorer_panel.tabs.side']
|
61
|
-
font $arcadia['conf']['editor.tabs.font']
|
62
87
|
pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
|
63
88
|
}
|
64
89
|
@nb_tab_exp = @nb.insert('end','exp' ,'text'=>'Source Tree' )
|
@@ -69,7 +94,8 @@ class AgEditor
|
|
69
94
|
_hinner_text = @tree_exp.itemcget(_line,'text').strip
|
70
95
|
_editor_line = @text.get(_index, _index+ ' lineend')
|
71
96
|
if !_editor_line.include?(_hinner_text)
|
72
|
-
Arcadia.
|
97
|
+
Arcadia.console(self, 'msg'=>"... rebuild tree \n")
|
98
|
+
#Arcadia.new_msg(self, "... rebuild tree \n")
|
73
99
|
if @tree_thread && @tree_thread.alive?
|
74
100
|
@tree_thread.exit
|
75
101
|
end
|
@@ -84,9 +110,11 @@ class AgEditor
|
|
84
110
|
@text.tag_remove('selected','1.0','end')
|
85
111
|
@text.tag_add('selected',_line.to_s+'.0',(_line+1).to_s+'.0')
|
86
112
|
}
|
87
|
-
@tree_exp = Tk::BWidget::Tree.new(@nb_tab_exp){
|
88
|
-
background '
|
89
|
-
relief '
|
113
|
+
@tree_exp = Tk::BWidget::Tree.new(@nb_tab_exp, Arcadia.style('treepanel')){
|
114
|
+
#background Arcadia.conf('edit.background')
|
115
|
+
#relief Arcadia.conf('edit.relief')
|
116
|
+
#highlightbackground Arcadia.conf('edit.highlightbackground')
|
117
|
+
#borderwidth Arcadia.conf('edit.borderwidth')
|
90
118
|
showlines false
|
91
119
|
deltay 18
|
92
120
|
dragenabled true
|
@@ -95,7 +123,7 @@ class AgEditor
|
|
95
123
|
}
|
96
124
|
|
97
125
|
_c_explo = proc{|*args| @tree_exp.yview(*args)}
|
98
|
-
_s_explo = TkScrollbar.new(@nb_tab_exp){|s|
|
126
|
+
_s_explo = TkScrollbar.new(@nb_tab_exp, Arcadia.style('scrollbar')){|s|
|
99
127
|
width 8
|
100
128
|
command _c_explo
|
101
129
|
}.pack('side'=>'right', 'fill'=>'y')
|
@@ -108,6 +136,8 @@ class AgEditor
|
|
108
136
|
:parent=>@tree_exp,
|
109
137
|
:title => 'Menu tree'
|
110
138
|
)
|
139
|
+
@pop_up_tree.configure(Arcadia.style('menu'))
|
140
|
+
#Arcadia.instance.main_menu.update_style(@pop_up_tree)
|
111
141
|
@pop_up_tree.insert('end',
|
112
142
|
:command,
|
113
143
|
:label=>'Rebuild',
|
@@ -125,20 +155,19 @@ class AgEditor
|
|
125
155
|
|
126
156
|
|
127
157
|
def initialize_text(_frame)
|
128
|
-
@v_scroll = TkScrollbar.new(_frame,
|
129
|
-
'orient'=>'vertical'
|
130
|
-
'relief'=>'flat'
|
158
|
+
@v_scroll = TkScrollbar.new(_frame,{
|
159
|
+
'orient'=>'vertical'}.update(Arcadia.style('scrollbar'))
|
131
160
|
).pack('side' => 'right', 'fill' => 'y')
|
132
|
-
@text = TkText.new(@fm1.right_frame){|j|
|
161
|
+
@text = TkText.new(@fm1.right_frame, Arcadia.style('edit')){|j|
|
133
162
|
wrap 'none'
|
134
|
-
|
163
|
+
# relief 'flat'
|
135
164
|
undo true
|
136
165
|
insertofftime 200
|
137
166
|
insertontime 200
|
138
|
-
insertbackground $arcadia['conf']['editor.color.insertbackground']
|
139
|
-
background $arcadia['conf']['editor.color.background']
|
140
|
-
foreground $arcadia['conf']['editor.color.foreground']
|
141
|
-
highlightcolor $arcadia['conf']['editor.color.background']
|
167
|
+
# insertbackground $arcadia['conf']['editor.color.insertbackground']
|
168
|
+
# background $arcadia['conf']['editor.color.background']
|
169
|
+
# foreground $arcadia['conf']['editor.color.foreground']
|
170
|
+
# highlightcolor $arcadia['conf']['editor.color.background']
|
142
171
|
highlightthickness 0
|
143
172
|
insertwidth 3
|
144
173
|
exportselection true
|
@@ -154,7 +183,7 @@ class AgEditor
|
|
154
183
|
'bordermode'=>'outside'
|
155
184
|
)
|
156
185
|
}
|
157
|
-
|
186
|
+
# @text.configure('font', @font);
|
158
187
|
|
159
188
|
do_tag_configure_global('debug')
|
160
189
|
@text.tag_configure('eval','foreground' => 'yellow', 'background' =>'red','borderwidth'=>1, 'relief'=>'raised')
|
@@ -187,10 +216,6 @@ class AgEditor
|
|
187
216
|
@text.tag_bind('selected', 'Enter', proc{@text.tag_remove('selected','1.0','end')})
|
188
217
|
|
189
218
|
@text.bind("Enter", proc{check_file_last_access_time})
|
190
|
-
# @text.bind("ButtonPress-1", proc{
|
191
|
-
# _code = $arcadia['rad'].palette.give_me_code
|
192
|
-
# @text.insert('insert', _code) if _code
|
193
|
-
# })
|
194
219
|
|
195
220
|
@text.bind("Control-KeyPress"){|e|
|
196
221
|
case e.keysym
|
@@ -349,22 +374,17 @@ class AgEditor
|
|
349
374
|
end
|
350
375
|
end
|
351
376
|
}
|
377
|
+
|
378
|
+
|
379
|
+
@text.bind("<Modified>"){|e|
|
380
|
+
check_modify
|
381
|
+
}
|
352
382
|
|
353
383
|
@text.bind("KeyRelease"){|e|
|
354
384
|
case e.keysym
|
355
385
|
when 'Control_L','Return', 'Control_V', 'BackSpace', 'Delete'
|
356
|
-
if modified?
|
357
|
-
set_modify
|
358
|
-
else
|
359
|
-
reset_modify
|
360
|
-
end
|
361
386
|
do_line_update
|
362
|
-
when 'Right','Left','Down', 'Up'
|
363
|
-
# do nil
|
364
|
-
else
|
365
|
-
check_modify
|
366
387
|
end
|
367
|
-
|
368
388
|
case e.keysym
|
369
389
|
when 'Return'
|
370
390
|
_index = @text.index('insert')
|
@@ -388,6 +408,7 @@ class AgEditor
|
|
388
408
|
rehighlightline(@text.index('insert').split('.')[0].to_i)
|
389
409
|
end
|
390
410
|
end
|
411
|
+
check_modify
|
391
412
|
}
|
392
413
|
|
393
414
|
|
@@ -416,12 +437,14 @@ class AgEditor
|
|
416
437
|
end
|
417
438
|
}
|
418
439
|
|
440
|
+
@text.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@text))})
|
441
|
+
|
419
442
|
end
|
420
443
|
|
421
444
|
def initialize_line_number(_frame)
|
422
|
-
@text_line_num = TkText.new(_frame){
|
445
|
+
@text_line_num = TkText.new(_frame, Arcadia.style('linepanel')){
|
423
446
|
wrap 'none'
|
424
|
-
relief 'flat'
|
447
|
+
#relief 'flat'
|
425
448
|
undo false
|
426
449
|
takefocus 0
|
427
450
|
insertofftime 0
|
@@ -429,11 +452,13 @@ class AgEditor
|
|
429
452
|
autoseparators true
|
430
453
|
cursor nil
|
431
454
|
insertwidth 0
|
432
|
-
|
433
|
-
#background
|
434
|
-
foreground
|
435
|
-
|
436
|
-
|
455
|
+
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
|
437
462
|
place(
|
438
463
|
'x'=>0,
|
439
464
|
'y'=>0,
|
@@ -464,7 +489,7 @@ class AgEditor
|
|
464
489
|
},
|
465
490
|
"%x %y")
|
466
491
|
|
467
|
-
|
492
|
+
#@text_line_num.configure('font', @font);
|
468
493
|
@text_line_num.tag_configure('line_num',
|
469
494
|
'foreground' => '#FFFFFF',
|
470
495
|
'background' =>'#0000a0',
|
@@ -513,11 +538,11 @@ class AgEditor
|
|
513
538
|
|
514
539
|
def do_tag_configure(_name)
|
515
540
|
h = Hash.new
|
516
|
-
if @lang_hash['hightlight.'+_name+'.
|
517
|
-
h['foreground']=@lang_hash['hightlight.'+_name+'.
|
541
|
+
if @lang_hash['hightlight.'+_name+'.foreground']
|
542
|
+
h['foreground']=@lang_hash['hightlight.'+_name+'.foreground']
|
518
543
|
end
|
519
|
-
if @lang_hash['hightlight.'+_name+'.
|
520
|
-
h['background']=@lang_hash['hightlight.'+_name+'.
|
544
|
+
if @lang_hash['hightlight.'+_name+'.background']
|
545
|
+
h['background']=@lang_hash['hightlight.'+_name+'.background']
|
521
546
|
end
|
522
547
|
if @lang_hash['hightlight.'+_name+'.style']== 'bold'
|
523
548
|
h['font']=@font_bold
|
@@ -535,11 +560,11 @@ class AgEditor
|
|
535
560
|
|
536
561
|
def do_tag_configure_global(_name)
|
537
562
|
h = Hash.new
|
538
|
-
if $arcadia['conf']['editor.hightlight.'+_name+'.
|
539
|
-
h['foreground']=$arcadia['conf']['editor.hightlight.'+_name+'.
|
563
|
+
if $arcadia['conf']['editor.hightlight.'+_name+'.foreground']
|
564
|
+
h['foreground']=$arcadia['conf']['editor.hightlight.'+_name+'.foreground']
|
540
565
|
end
|
541
|
-
if $arcadia['conf']['editor.hightlight.'+_name+'.
|
542
|
-
h['background']=$arcadia['conf']['editor.hightlight.'+_name+'.
|
566
|
+
if $arcadia['conf']['editor.hightlight.'+_name+'.background']
|
567
|
+
h['background']=$arcadia['conf']['editor.hightlight.'+_name+'.background']
|
543
568
|
end
|
544
569
|
if $arcadia['conf']['editor.hightlight.'+_name+'.style']== 'bold'
|
545
570
|
h['font']=@font_bold
|
@@ -557,9 +582,21 @@ class AgEditor
|
|
557
582
|
def pop_up_menu
|
558
583
|
@pop_up = TkMenu.new(
|
559
584
|
:parent=>@text,
|
560
|
-
:tearoff=>
|
585
|
+
:tearoff=>0,
|
561
586
|
:title => 'Menu'
|
562
587
|
)
|
588
|
+
@pop_up.configure(Arcadia.style('menu'))
|
589
|
+
|
590
|
+
@pop_up.insert('end',
|
591
|
+
:command,
|
592
|
+
:state=>'disabled',
|
593
|
+
:background=>Arcadia.conf('titlelabel.background'),
|
594
|
+
:font => "#{Arcadia.conf('menu.font')} bold",
|
595
|
+
:hidemargin => true
|
596
|
+
)
|
597
|
+
|
598
|
+
|
599
|
+
#Arcadia.instance.main_menu.update_style(@pop_up)
|
563
600
|
@pop_up.insert('end',
|
564
601
|
:command,
|
565
602
|
:label=>'Save as',
|
@@ -573,6 +610,8 @@ class AgEditor
|
|
573
610
|
:command=> proc{save}
|
574
611
|
)
|
575
612
|
|
613
|
+
@pop_up.insert('end', :separator)
|
614
|
+
|
576
615
|
@pop_up.insert('end',
|
577
616
|
:command,
|
578
617
|
:label=>'Close',
|
@@ -594,6 +633,50 @@ class AgEditor
|
|
594
633
|
:command=> proc{@controller.close_all_editor(self)}
|
595
634
|
)
|
596
635
|
|
636
|
+
@pop_up.insert('end', :separator)
|
637
|
+
|
638
|
+
@pop_up.insert('end',
|
639
|
+
:command,
|
640
|
+
:label=>'Copy',
|
641
|
+
:hidemargin => false,
|
642
|
+
:command=> proc{
|
643
|
+
@text.event_generate("Control-KeyPress",:keysym=>'c')
|
644
|
+
@text.event_generate("Control-KeyRelease",:keysym=>'c')
|
645
|
+
}
|
646
|
+
)
|
647
|
+
|
648
|
+
@pop_up.insert('end',
|
649
|
+
:command,
|
650
|
+
:label=>'Cut',
|
651
|
+
:hidemargin => false,
|
652
|
+
:command=> proc{
|
653
|
+
@text.event_generate("Control-KeyPress",:keysym=>'x')
|
654
|
+
@text.event_generate("Control-KeyRelease",:keysym=>'x')
|
655
|
+
}
|
656
|
+
)
|
657
|
+
|
658
|
+
|
659
|
+
@pop_up.insert('end',
|
660
|
+
:command,
|
661
|
+
:label=>'Paste',
|
662
|
+
:hidemargin => false,
|
663
|
+
:command=> proc{
|
664
|
+
@text.event_generate("Control-KeyPress",:keysym=>'v')
|
665
|
+
@text.event_generate("Control-KeyRelease",:keysym=>'v')
|
666
|
+
}
|
667
|
+
)
|
668
|
+
|
669
|
+
|
670
|
+
@pop_up.insert('end',
|
671
|
+
:command,
|
672
|
+
:label=>'Undo',
|
673
|
+
:hidemargin => false,
|
674
|
+
:command=> proc{
|
675
|
+
@text.event_generate("Control-KeyPress",:keysym=>'z')
|
676
|
+
@text.event_generate("Control-KeyRelease",:keysym=>'z')
|
677
|
+
}
|
678
|
+
)
|
679
|
+
|
597
680
|
|
598
681
|
@pop_up.insert('end', :separator)
|
599
682
|
|
@@ -614,6 +697,44 @@ class AgEditor
|
|
614
697
|
}
|
615
698
|
)
|
616
699
|
|
700
|
+
@pop_up.insert('end',
|
701
|
+
:command,
|
702
|
+
:label=>'Data image',
|
703
|
+
:hidemargin => false,
|
704
|
+
:command=> proc{
|
705
|
+
file = Tk.getOpenFile
|
706
|
+
if file
|
707
|
+
require 'base64'
|
708
|
+
f = File.open(file,"rb")
|
709
|
+
data = f.read
|
710
|
+
f.close
|
711
|
+
encoded = Base64.encode64( data )
|
712
|
+
@text.insert('insert', File.basename(file).gsub('.gif','_gif').gsub('-','_').upcase + "=<<EOS\n")
|
713
|
+
@text.insert('insert', "#{encoded}")
|
714
|
+
@text.insert('insert', "EOS\n")
|
715
|
+
end
|
716
|
+
}
|
717
|
+
)
|
718
|
+
|
719
|
+
@pop_up.insert('end',
|
720
|
+
:command,
|
721
|
+
:label=>'View image from data',
|
722
|
+
:hidemargin => false,
|
723
|
+
:command=> proc{
|
724
|
+
_r = @text.tag_ranges('sel')
|
725
|
+
if _r.length>0
|
726
|
+
_data=@text.get(_r[0][0],_r[0][1])
|
727
|
+
if _data.length > 0
|
728
|
+
|
729
|
+
_b = TkButton.new(@text,
|
730
|
+
'command'=>proc{_b.destroy},
|
731
|
+
'image'=> TkPhotoImage.new('data' => _data),
|
732
|
+
'relief'=>'groove')
|
733
|
+
TkTextWindow.new(@text, _r[0][1], 'window'=> _b)
|
734
|
+
end
|
735
|
+
end
|
736
|
+
}
|
737
|
+
)
|
617
738
|
|
618
739
|
@pop_up.insert('end', :separator)
|
619
740
|
|
@@ -623,7 +744,7 @@ class AgEditor
|
|
623
744
|
:tearoff=>0,
|
624
745
|
:title => 'Debug'
|
625
746
|
)
|
626
|
-
|
747
|
+
_sub_debug.configure(Arcadia.style('menu'))
|
627
748
|
_sub_debug.insert('end',
|
628
749
|
:command,
|
629
750
|
:label=>'Eval selected',
|
@@ -654,7 +775,7 @@ class AgEditor
|
|
654
775
|
:tearoff=>0,
|
655
776
|
:title => 'Code'
|
656
777
|
)
|
657
|
-
|
778
|
+
_sub_code.configure(Arcadia.style('menu'))
|
658
779
|
_sub_code.insert('end',
|
659
780
|
:command,
|
660
781
|
:label=>'Set wrap',
|
@@ -721,14 +842,12 @@ class AgEditor
|
|
721
842
|
:menu=>_sub_code,
|
722
843
|
:hidemargin => false
|
723
844
|
)
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
@text.bind("Button-3",
|
845
|
+
|
846
|
+
@text.bind(@controller.conf('popup.bind.shortcut'),
|
729
847
|
proc{|x,y|
|
730
848
|
_x = TkWinfo.pointerx(@text)
|
731
849
|
_y = TkWinfo.pointery(@text)
|
850
|
+
@pop_up.entryconfigure(0, 'label'=>File.basename(@file)) if @file
|
732
851
|
@pop_up.popup(_x,_y)
|
733
852
|
},
|
734
853
|
"%x %y")
|
@@ -854,9 +973,9 @@ class AgEditor
|
|
854
973
|
@tree_exp.insert('end', _son.parent.rif ,_son.rif, {
|
855
974
|
'text' => _son.label ,
|
856
975
|
'helptext' => _son.helptext,
|
857
|
-
'font'=>$arcadia['conf']['editor.explorer_panel.tree.font'],
|
976
|
+
#'font'=>$arcadia['conf']['editor.explorer_panel.tree.font'],
|
858
977
|
'image'=> _image
|
859
|
-
}
|
978
|
+
}.update(Arcadia.style('treeitem'))
|
860
979
|
)
|
861
980
|
if (_label_match) && (_label_match.strip == _son.label.strip)
|
862
981
|
@selected = _son
|
@@ -1162,6 +1281,7 @@ class AgEditor
|
|
1162
1281
|
|
1163
1282
|
|
1164
1283
|
def highlightline(_row, _line, _check_mod = false)
|
1284
|
+
#p "highlightline #{_row} _line=#{_line}"
|
1165
1285
|
if _check_mod
|
1166
1286
|
check_modify
|
1167
1287
|
end
|
@@ -1175,6 +1295,7 @@ class AgEditor
|
|
1175
1295
|
_ibegin = _row.to_s+'.'+(m_c.begin(0)).to_s
|
1176
1296
|
_iend = _row.to_s+'.'+(_line.length - 1).to_s
|
1177
1297
|
@text.tag_add(c,_ibegin, _iend)
|
1298
|
+
#p "tag_add found #{c}"
|
1178
1299
|
_txt = m_c.pre_match
|
1179
1300
|
end
|
1180
1301
|
end
|
@@ -1197,6 +1318,9 @@ class AgEditor
|
|
1197
1318
|
def rehighlightline(_row)
|
1198
1319
|
_ibegin = _row.to_s+'.0'
|
1199
1320
|
_iend = (_row+1).to_s+'.0'
|
1321
|
+
#p "rehighlightline _ibegin=#{_ibegin}"
|
1322
|
+
#p "rehighlightline _iend=#{_iend}"
|
1323
|
+
#p "_line = #{@text.get(_ibegin, _iend)}"
|
1200
1324
|
@h_classes.each{|c| @text.tag_remove(c,_ibegin, _iend)}
|
1201
1325
|
_line = @text.get(_ibegin, _iend)
|
1202
1326
|
highlightline(_row, _line)
|
@@ -1217,42 +1341,49 @@ class AgEditor
|
|
1217
1341
|
return _row
|
1218
1342
|
end
|
1219
1343
|
|
1344
|
+
def zone_of_row(_row)
|
1345
|
+
((_row) / @highlight_zone_length).to_i + 1
|
1346
|
+
end
|
1347
|
+
|
1220
1348
|
def do_line_update
|
1221
1349
|
#re num in @text_line_num the portion of visibled screen of @text
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1350
|
+
return if @loading
|
1351
|
+
if @text_line_num
|
1352
|
+
line_begin = @text.index('@0,0').split('.')[0].to_i
|
1353
|
+
line_end = @text.index('@0,'+TkWinfo.height(@text).to_s).split('.')[0].to_i + 1
|
1354
|
+
# breakpoint
|
1355
|
+
b = @controller.breakpoint_lines_on_file(@file)
|
1356
|
+
if @highlighting
|
1357
|
+
_zone_begin = ((line_begin) / @highlight_zone_length).to_i + 1
|
1358
|
+
_zone_end = ((line_end) / @highlight_zone_length).to_i + 1
|
1359
|
+
#Arcadia.new_msg(self, "for lines #{line_begin}..#{line_end} \n
|
1360
|
+
_zone_begin=#{_zone_begin} ; _zone_end=#{_zone_end}")
|
1361
|
+
(_zone_begin >=@last_zone_begin)?_zone_begin.upto(_zone_end+1){|_zone|
|
1362
|
+
highlight_zone(_zone)
|
1363
|
+
}:_zone_end.downto(_zone_begin-1){|_zone|
|
1364
|
+
highlight_zone(_zone)
|
1365
|
+
}
|
1366
|
+
@last_line_begin = line_begin
|
1367
|
+
@last_line_end = line_end
|
1368
|
+
@last_zone_begin = _zone_begin
|
1369
|
+
@last_zone_end = _zone_end
|
1236
1370
|
end
|
1237
|
-
|
1238
|
-
|
1371
|
+
|
1372
|
+
@text_line_num.delete('1.0','end')
|
1373
|
+
for j in line_begin...line_end
|
1374
|
+
#nline = j.to_s.rjust(6)
|
1375
|
+
nline = j.to_s.rjust(7)
|
1376
|
+
_index = @text_line_num.index('end')
|
1377
|
+
if @highlighting && @is_line_bold[j]
|
1378
|
+
@text_line_num.insert('end', "#{nline}\n",'bold_case')
|
1379
|
+
else
|
1380
|
+
@text_line_num.insert('end', "#{nline}\n")
|
1381
|
+
end
|
1382
|
+
if b.include?(j.to_s)
|
1383
|
+
@text_line_num.tag_add('breakpoint',_index+' -1 lines',_index+' -1 lines lineend')
|
1384
|
+
end
|
1239
1385
|
end
|
1240
1386
|
end
|
1241
|
-
|
1242
|
-
if @highlighting
|
1243
|
-
_zone_begin = ((line_begin) / @highlight_zone_length).to_i + 1
|
1244
|
-
_zone_end = ((line_end) / @highlight_zone_length).to_i + 1
|
1245
|
-
(_zone_begin >=@last_zone_begin)?_zone_begin.upto(_zone_end+1){|_zone|
|
1246
|
-
highlight_zone(_zone)
|
1247
|
-
}:_zone_end.downto(_zone_begin-1){|_zone|
|
1248
|
-
highlight_zone(_zone)
|
1249
|
-
}
|
1250
|
-
@last_line_begin = line_begin
|
1251
|
-
@last_line_end = line_end
|
1252
|
-
@last_zone_begin = _zone_begin
|
1253
|
-
@last_zone_end = _zone_end
|
1254
|
-
end
|
1255
|
-
end
|
1256
1387
|
end
|
1257
1388
|
|
1258
1389
|
def highlight_zone_new(_zone)
|
@@ -1265,8 +1396,8 @@ class AgEditor
|
|
1265
1396
|
end
|
1266
1397
|
|
1267
1398
|
|
1268
|
-
def highlight_zone(_zone)
|
1269
|
-
if !@highlight_zone[_zone]
|
1399
|
+
def highlight_zone(_zone, _force_highlight=false)
|
1400
|
+
if !@highlight_zone[_zone] || _force_highlight
|
1270
1401
|
_b = @highlight_zone_length*(_zone - 1)
|
1271
1402
|
_e = @highlight_zone_length*(_zone) #+ 1
|
1272
1403
|
for j in _b..._e
|
@@ -1321,6 +1452,12 @@ class AgEditor
|
|
1321
1452
|
def save
|
1322
1453
|
if !@file
|
1323
1454
|
save_as
|
1455
|
+
elsif @read_only
|
1456
|
+
Arcadia.dialog(self,
|
1457
|
+
'type' => 'ok',
|
1458
|
+
'title' =>"#{@file}:read-only",
|
1459
|
+
'msg' =>"The file : #{@file} is read-only!",
|
1460
|
+
'level' =>'warning')
|
1324
1461
|
else
|
1325
1462
|
f = File.new(@file, "w")
|
1326
1463
|
begin
|
@@ -1371,34 +1508,62 @@ class AgEditor
|
|
1371
1508
|
end
|
1372
1509
|
end
|
1373
1510
|
end
|
1374
|
-
|
1375
|
-
def
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1511
|
+
|
1512
|
+
def languages_hash(_ext=nil)
|
1513
|
+
@@langs_hash = Hash.new if !defined?(@@langs_hash)
|
1514
|
+
return nil if _ext.nil?
|
1515
|
+
if @@langs_hash[_ext].nil?
|
1516
|
+
#_ext='' if _ext.nil?
|
1517
|
+
lang_file = File.dirname(__FILE__)+'/langs/'+_ext+'.lang'
|
1518
|
+
if File.exist?(lang_file)
|
1519
|
+
@@langs_hash[_ext] = properties_file2hash(lang_file)
|
1520
|
+
elsif File.exist?(lang_file+'.bind')
|
1521
|
+
b= properties_file2hash(lang_file+'.bind')
|
1522
|
+
if b
|
1523
|
+
if @@langs_hash[b['bind']].nil?
|
1524
|
+
lang_file_bind = File.dirname(__FILE__)+'/langs/'+b['bind']+".lang"
|
1525
|
+
if File.exist?(lang_file_bind)
|
1526
|
+
@@langs_hash[b['bind']]=properties_file2hash(lang_file_bind)
|
1527
|
+
@@langs_hash[_ext]=@@langs_hash[b['bind']]
|
1528
|
+
end
|
1529
|
+
else
|
1530
|
+
@@langs_hash[_ext]=@@langs_hash[b['bind']]
|
1531
|
+
end
|
1532
|
+
end
|
1386
1533
|
end
|
1387
|
-
|
1388
|
-
@lang = nil
|
1534
|
+
self.resolve_properties_link(@@langs_hash[_ext], Arcadia.instance['conf']) if @@langs_hash[_ext]
|
1389
1535
|
end
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1536
|
+
@@langs_hash[_ext]
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
def init_editing(_ext='rb', _w1=150, _w2=60)
|
1540
|
+
# find file lang
|
1541
|
+
# _ext='' if _ext.nil?
|
1542
|
+
# lang_file = File.dirname(__FILE__)+'/langs/'+_ext+'.lang'
|
1543
|
+
# if File.exist?(lang_file)
|
1544
|
+
# @lang_hash = properties_file2hash(lang_file)
|
1545
|
+
# elsif File.exist?(lang_file+'.bind')
|
1546
|
+
# b= properties_file2hash(lang_file+'.bind')
|
1547
|
+
# lang_file_bind = File.dirname(__FILE__)+'/langs/'+b['bind']
|
1548
|
+
# if b && File.exist?(lang_file_bind)
|
1549
|
+
# @lang_hash = properties_file2hash(lang_file_bind)
|
1550
|
+
# end
|
1551
|
+
# else
|
1552
|
+
# @lang = nil
|
1553
|
+
# end
|
1554
|
+
@lang_hash = languages_hash(_ext)
|
1555
|
+
if !_ext.nil? && (_ext=='rb'||_ext=='rbw')
|
1556
|
+
@fm = AGTkVSplittedFrames.new(@page_frame,_w1)
|
1557
|
+
@fm1 = AGTkVSplittedFrames.new(@fm.right_frame,_w2)
|
1393
1558
|
initialize_tree(@fm.left_frame)
|
1394
1559
|
else
|
1395
|
-
@fm1 = AGTkVSplittedFrames.new(@page_frame,
|
1560
|
+
@fm1 = AGTkVSplittedFrames.new(@page_frame,_w2)
|
1396
1561
|
end
|
1397
1562
|
@fm1.splitter_frame.configure('relief'=>'flat')
|
1398
1563
|
initialize_text(@fm1.right_frame)
|
1399
|
-
initialize_text_binding
|
1400
1564
|
initialize_highlight
|
1401
1565
|
initialize_line_number(@fm1.left_frame)
|
1566
|
+
initialize_text_binding
|
1402
1567
|
end
|
1403
1568
|
|
1404
1569
|
def file_extension(_filename=nil)
|
@@ -1410,27 +1575,32 @@ class AgEditor
|
|
1410
1575
|
|
1411
1576
|
def load_file(_filename = nil)
|
1412
1577
|
#if filename is nil then open a new tab
|
1413
|
-
@
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1578
|
+
@loading=true
|
1579
|
+
begin
|
1580
|
+
@file = _filename
|
1581
|
+
if _filename
|
1582
|
+
#init_editing(file_extension(_filename))
|
1583
|
+
File::open(_filename,'r'){ |file|
|
1584
|
+
@text.insert('end',file.readlines.collect!{| line | line.chomp+"\n" }.to_s)
|
1585
|
+
#@text.insert('end',file.read)
|
1586
|
+
}
|
1587
|
+
end
|
1588
|
+
set_read_only(!File.stat(_filename).writable?)
|
1589
|
+
reset
|
1590
|
+
refresh
|
1591
|
+
ensure
|
1592
|
+
@loading=false
|
1419
1593
|
end
|
1420
|
-
set_read_only(!File.stat(_filename).writable?)
|
1421
|
-
|
1422
|
-
reset
|
1423
|
-
refresh
|
1424
1594
|
end
|
1425
1595
|
|
1426
1596
|
def set_read_only(_value)
|
1427
1597
|
if @read_only != _value
|
1428
1598
|
@read_only = _value
|
1429
1599
|
if @read_only
|
1430
|
-
|
1600
|
+
#@text.configure('state'=>'disabled')
|
1431
1601
|
@controller.change_tab_set_read_only(@page_frame)
|
1432
1602
|
else
|
1433
|
-
|
1603
|
+
#@text.configure('state'=>'normal')
|
1434
1604
|
@controller.change_tab_reset_read_only(@page_frame)
|
1435
1605
|
end
|
1436
1606
|
end
|
@@ -1443,22 +1613,21 @@ class AgEditor
|
|
1443
1613
|
end
|
1444
1614
|
|
1445
1615
|
def refresh
|
1446
|
-
build_tree if @classbrowsing
|
1616
|
+
build_tree if @classbrowsing && !is_exp_hide?
|
1447
1617
|
end
|
1448
1618
|
end
|
1449
1619
|
|
1450
1620
|
class AgMultiEditorView
|
1451
1621
|
attr_reader :enb
|
1452
1622
|
def initialize(parent=nil)
|
1453
|
-
@enb = Tk::BWidget::NoteBook.new(parent){
|
1623
|
+
@enb = Tk::BWidget::NoteBook.new(parent,Arcadia.style('tabpanel')){
|
1454
1624
|
tabbevelsize 0
|
1455
1625
|
internalborderwidth 2
|
1456
|
-
activeforeground 'red'
|
1457
|
-
activebackground 'yellow'
|
1458
|
-
#
|
1459
|
-
|
1460
|
-
|
1461
|
-
font $arcadia['conf']['editor.tabs.font']
|
1626
|
+
# activeforeground 'red'
|
1627
|
+
# activebackground 'yellow'
|
1628
|
+
#borderwidth 1
|
1629
|
+
side Arcadia.conf('editor.tabs.side')
|
1630
|
+
font Arcadia.conf('editor.tabs.font')
|
1462
1631
|
pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
|
1463
1632
|
}
|
1464
1633
|
end
|
@@ -1473,10 +1642,10 @@ class AgMultiEditor < ArcadiaExt
|
|
1473
1642
|
#ArcadiaContractListener.new(self, DebugContract, :do_debug_event)
|
1474
1643
|
#ArcadiaContractListener.new(self, EditorContract, :do_editor_event)
|
1475
1644
|
#ArcadiaContractListener.new(self, MainContract, :do_main_event)
|
1476
|
-
Arcadia.
|
1477
|
-
Arcadia.
|
1478
|
-
Arcadia.
|
1479
|
-
Arcadia.
|
1645
|
+
Arcadia.attach_listener(self, BufferEvent)
|
1646
|
+
Arcadia.attach_listener(self, DebugEvent)
|
1647
|
+
Arcadia.attach_listener(self, RunRubyFileEvent)
|
1648
|
+
Arcadia.attach_listener(self, StartDebugEvent)
|
1480
1649
|
end
|
1481
1650
|
|
1482
1651
|
def on_before_run_ruby_file(_event)
|
@@ -1496,7 +1665,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1496
1665
|
end
|
1497
1666
|
|
1498
1667
|
def on_build(_event)
|
1499
|
-
@main_frame = AgMultiEditorView.new(self.frame)
|
1668
|
+
@main_frame = AgMultiEditorView.new(self.frame.hinner_frame)
|
1500
1669
|
@tabs_file =Hash.new
|
1501
1670
|
@tabs_editor =Hash.new
|
1502
1671
|
@breakpoints =Array.new
|
@@ -1514,18 +1683,21 @@ class AgMultiEditor < ArcadiaExt
|
|
1514
1683
|
:tearoff=>0,
|
1515
1684
|
:title => 'Menu'
|
1516
1685
|
)
|
1686
|
+
@pop_up.configure(Arcadia.style('menu'))
|
1687
|
+
#Arcadia.instance.main_menu.update_style(@pop_up)
|
1517
1688
|
@pop_up.insert('end',
|
1518
1689
|
:command,
|
1519
1690
|
:label=>'...',
|
1520
1691
|
:state=>'disabled',
|
1521
|
-
:background=>'
|
1522
|
-
:font => conf('font
|
1692
|
+
:background=>Arcadia.conf('titlelabel.background'),
|
1693
|
+
:font => "#{Arcadia.conf('menu.font')} bold",
|
1523
1694
|
:hidemargin => true
|
1524
1695
|
)
|
1696
|
+
|
1525
1697
|
@c = @pop_up.insert('end',
|
1526
1698
|
:command,
|
1527
1699
|
:label=>'Close',
|
1528
|
-
|
1700
|
+
#:font => conf('font'),
|
1529
1701
|
:hidemargin => false,
|
1530
1702
|
:command=> proc{
|
1531
1703
|
if @selected_tab_name_from_popup != nil
|
@@ -1537,7 +1709,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1537
1709
|
@c = @pop_up.insert('end',
|
1538
1710
|
:command,
|
1539
1711
|
:label=>'Close others',
|
1540
|
-
|
1712
|
+
#:font => conf('font'),
|
1541
1713
|
:hidemargin => false,
|
1542
1714
|
:command=> proc{
|
1543
1715
|
if @selected_tab_name_from_popup != nil
|
@@ -1549,7 +1721,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1549
1721
|
@c = @pop_up.insert('end',
|
1550
1722
|
:command,
|
1551
1723
|
:label=>'Close all',
|
1552
|
-
|
1724
|
+
#:font => conf('font'),
|
1553
1725
|
:hidemargin => false,
|
1554
1726
|
:command=> proc{
|
1555
1727
|
if @selected_tab_name_from_popup != nil
|
@@ -1558,7 +1730,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1558
1730
|
end
|
1559
1731
|
}
|
1560
1732
|
)
|
1561
|
-
|
1733
|
+
|
1562
1734
|
@main_frame.enb.tabbind("Button-3",
|
1563
1735
|
proc{|*x|
|
1564
1736
|
_x = TkWinfo.pointerx(@main_frame.enb)
|
@@ -1602,8 +1774,10 @@ class AgMultiEditor < ArcadiaExt
|
|
1602
1774
|
when StartDebugEvent
|
1603
1775
|
self.debug_begin
|
1604
1776
|
when StepDebugEvent
|
1605
|
-
if _event.command == :
|
1777
|
+
if _event.command == :quit_yes
|
1606
1778
|
self.debug_end
|
1779
|
+
elsif _event.command == :quit_no
|
1780
|
+
@last_e.mark_debug(@last_index) if @last_e
|
1607
1781
|
end
|
1608
1782
|
when SetBreakpointEvent
|
1609
1783
|
@breakpoints << {:file=>_event.file,:line=>_event.row}
|
@@ -1613,12 +1787,18 @@ class AgMultiEditor < ArcadiaExt
|
|
1613
1787
|
end
|
1614
1788
|
|
1615
1789
|
def on_debug_step_info(_event)
|
1790
|
+
#Arcadia.new_debug_msg(self, "file: #{_event.file}:#{_event.row}")
|
1616
1791
|
if _event.file
|
1617
1792
|
self.open_file_in_debug(_event.file, _event.row)
|
1618
1793
|
end
|
1619
1794
|
end
|
1620
1795
|
|
1796
|
+
# def on_before_buffer(_event)
|
1797
|
+
# Arcadia.new_error_msg(self, "on_before_buffer #{_event.class}")
|
1798
|
+
# end
|
1799
|
+
|
1621
1800
|
def on_buffer(_event)
|
1801
|
+
#Arcadia.new_error_msg(self, "on_buffer #{_event.class}")
|
1622
1802
|
case _event
|
1623
1803
|
when NewBufferEvent
|
1624
1804
|
self.open_buffer
|
@@ -1639,7 +1819,8 @@ class AgMultiEditor < ArcadiaExt
|
|
1639
1819
|
#add_reverse_item(_e)
|
1640
1820
|
end
|
1641
1821
|
else
|
1642
|
-
|
1822
|
+
_event.file = Tk.getOpenFile
|
1823
|
+
self.open_file(_event.file)
|
1643
1824
|
end
|
1644
1825
|
when CloseBufferEvent
|
1645
1826
|
if _event.file
|
@@ -1702,24 +1883,20 @@ class AgMultiEditor < ArcadiaExt
|
|
1702
1883
|
if candidates.length > 1
|
1703
1884
|
_rx, _ry, _widht, heigth = _text.bbox(_begin_index);
|
1704
1885
|
_x = _rx + TkWinfo.rootx(_text)
|
1705
|
-
_y = _ry + TkWinfo.rooty(_text) + TkFont.new(conf('font')).metrics[2][1]
|
1886
|
+
_y = _ry + TkWinfo.rooty(_text) + TkFont.new(conf('edit.font')).metrics[2][1]
|
1706
1887
|
|
1707
1888
|
_xroot = _x - TkWinfo.rootx(@arcadia.layout.root)
|
1708
1889
|
_yroot = _y - TkWinfo.rooty(@arcadia.layout.root)
|
1709
1890
|
|
1710
1891
|
_max_height = TkWinfo.screenheight(@arcadia.layout.root) - _y - 5
|
1711
1892
|
|
1712
|
-
@raised_listbox = TkListbox.new(@arcadia.layout.root,
|
1713
|
-
|
1714
|
-
:
|
1715
|
-
:
|
1716
|
-
:
|
1717
|
-
:selectforeground=>'red',
|
1718
|
-
:activestyle=>'none',
|
1719
|
-
:font => conf('font'),
|
1720
|
-
:borderwidth=>1
|
1893
|
+
@raised_listbox = TkListbox.new(@arcadia.layout.root, {
|
1894
|
+
:takefocus=>true,
|
1895
|
+
:selectbackground=>Arcadia.conf('hightlight.1.background'),
|
1896
|
+
:selectforeground=>Arcadia.conf('hightlight.1.foreground'),
|
1897
|
+
:activestyle=>'none'}.update(Arcadia.style('edit'))
|
1721
1898
|
)
|
1722
|
-
_font = TkFont.new(conf('font'))
|
1899
|
+
_font = TkFont.new(conf('edit.font'))
|
1723
1900
|
_char_height = _font.metrics[2][1]
|
1724
1901
|
_width = 0
|
1725
1902
|
_docs_entries = Hash.new
|
@@ -1772,7 +1949,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1772
1949
|
@find.hide
|
1773
1950
|
end
|
1774
1951
|
|
1775
|
-
def
|
1952
|
+
def on_finalize(_event)
|
1776
1953
|
_files =''
|
1777
1954
|
@tabs_editor.each_value{|editor|
|
1778
1955
|
_files=_files+'|'+ editor.file if editor.file != nil
|
@@ -1890,14 +2067,22 @@ class AgMultiEditor < ArcadiaExt
|
|
1890
2067
|
# return nil
|
1891
2068
|
# end
|
1892
2069
|
end
|
2070
|
+
|
2071
|
+
def name_read_only(_name)
|
2072
|
+
'[READ-ONLY] '+_name
|
2073
|
+
end
|
1893
2074
|
|
2075
|
+
def unname_read_only(_name)
|
2076
|
+
return _name.gsub("[READ-ONLY] ",'')
|
2077
|
+
end
|
2078
|
+
|
1894
2079
|
def change_tab_set_read_only(_tab)
|
1895
|
-
_new_name =
|
2080
|
+
_new_name = name_read_only(@main_frame.enb.itemcget(page_name(_tab), 'text'))
|
1896
2081
|
change_tab_title(_tab, _new_name)
|
1897
2082
|
end
|
1898
2083
|
|
1899
2084
|
def change_tab_reset_read_only(_tab)
|
1900
|
-
_new_name = @main_frame.enb.itemcget(page_name(_tab), 'text')
|
2085
|
+
_new_name = unname_read_only(@main_frame.enb.itemcget(page_name(_tab), 'text'))
|
1901
2086
|
if _new_name
|
1902
2087
|
change_tab_title(_tab, _new_name)
|
1903
2088
|
end
|
@@ -1943,6 +2128,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1943
2128
|
#debug_reset
|
1944
2129
|
@editors_in_debug.each{|e|
|
1945
2130
|
close_editor(e)
|
2131
|
+
p "close editor #{e.file}"
|
1946
2132
|
}
|
1947
2133
|
end
|
1948
2134
|
|
@@ -1957,11 +2143,14 @@ class AgMultiEditor < ArcadiaExt
|
|
1957
2143
|
if _filename && _line
|
1958
2144
|
@last_index = _line.to_s+'.0'
|
1959
2145
|
_editor_exist = editor_exist?(_filename)
|
1960
|
-
@last_e = open_file(_filename, @last_index, false)
|
2146
|
+
@last_e = open_file(_filename, @last_index, false, false)
|
2147
|
+
#@last_e.hide_exp
|
2148
|
+
@last_e.mark_debug(@last_index) if @last_e
|
1961
2149
|
if !_editor_exist
|
1962
2150
|
@editors_in_debug << @last_e
|
2151
|
+
# workaround for hightlight
|
2152
|
+
@last_e.do_line_update
|
1963
2153
|
end
|
1964
|
-
@last_e.mark_debug(@last_index) if @last_e
|
1965
2154
|
end
|
1966
2155
|
end
|
1967
2156
|
|
@@ -1982,7 +2171,7 @@ class AgMultiEditor < ArcadiaExt
|
|
1982
2171
|
end
|
1983
2172
|
end
|
1984
2173
|
if @arcadia.layout.headed?
|
1985
|
-
|
2174
|
+
frame.title(_new_caption)
|
1986
2175
|
#@arcadia.layout.domain(@arcadia['conf'][@name+'.frame'])['root'].top_text(_new_caption)
|
1987
2176
|
end
|
1988
2177
|
_title = @tabs_file[_name] != nil ? File.basename(@tabs_file[_name]) :_name
|
@@ -1994,8 +2183,11 @@ class AgMultiEditor < ArcadiaExt
|
|
1994
2183
|
_basefilename = File.basename(_filename)
|
1995
2184
|
#_basename = _basefilename.split('.')[0]+'_'+_basefilename.split('.')[1]
|
1996
2185
|
|
1997
|
-
|
1998
|
-
_index = @main_frame.enb.index(
|
2186
|
+
_name = self.tab_name(_filename)
|
2187
|
+
_index = @main_frame.enb.index(_name)
|
2188
|
+
if _index == -1
|
2189
|
+
_index = @main_frame.enb.index(name_read_only(_name))
|
2190
|
+
end
|
1999
2191
|
return _index != -1
|
2000
2192
|
end
|
2001
2193
|
|
@@ -2010,7 +2202,7 @@ class AgMultiEditor < ArcadiaExt
|
|
2010
2202
|
tab_name(_fstr)
|
2011
2203
|
end
|
2012
2204
|
|
2013
|
-
def open_file(_filename = nil, _text_index='1.0', _mark_selected=true)
|
2205
|
+
def open_file(_filename = nil, _text_index='1.0', _mark_selected=true, _exp=true)
|
2014
2206
|
return if _filename == nil || !File.exist?(_filename) || File.ftype(_filename) != 'file'
|
2015
2207
|
_basefilename = File.basename(_filename)
|
2016
2208
|
_tab_name = self.tab_file_name(_filename)
|
@@ -2020,8 +2212,13 @@ class AgMultiEditor < ArcadiaExt
|
|
2020
2212
|
if _exist_buffer
|
2021
2213
|
open_buffer(_tab_name)
|
2022
2214
|
else
|
2023
|
-
open_buffer(_tab_name, _basefilename)
|
2024
2215
|
@tabs_file[_tab_name]= _filename
|
2216
|
+
if _exp
|
2217
|
+
open_buffer(_tab_name, _basefilename)
|
2218
|
+
else
|
2219
|
+
open_buffer(_tab_name, _basefilename,0)
|
2220
|
+
end
|
2221
|
+
#@tabs_file[_tab_name]= _filename
|
2025
2222
|
@tabs_editor[_tab_name].load_file(_filename)
|
2026
2223
|
end
|
2027
2224
|
|
@@ -2034,7 +2231,7 @@ class AgMultiEditor < ArcadiaExt
|
|
2034
2231
|
end
|
2035
2232
|
|
2036
2233
|
|
2037
|
-
def open_buffer(_buffer_name = nil, _title = nil)
|
2234
|
+
def open_buffer(_buffer_name = nil, _title = nil, w1=150)
|
2038
2235
|
_index = @main_frame.enb.index(_buffer_name)
|
2039
2236
|
if _buffer_name == nil
|
2040
2237
|
_buffer_name = tab_name('new')
|
@@ -2059,8 +2256,8 @@ class AgMultiEditor < ArcadiaExt
|
|
2059
2256
|
'raisecmd'=>proc{do_buffer_raise(_buffer_name, _title)}
|
2060
2257
|
)
|
2061
2258
|
_e = AgEditor.new(self, _tab)
|
2062
|
-
_e.init_editing(_e.file_extension(_title))
|
2063
|
-
|
2259
|
+
_e.init_editing(_e.file_extension(_title), w1)
|
2260
|
+
#@tabs_file[_buffer_name]= nil
|
2064
2261
|
@tabs_editor[_buffer_name]=_e
|
2065
2262
|
end
|
2066
2263
|
@main_frame.enb.move(_buffer_name, 1)
|
@@ -2106,7 +2303,7 @@ class AgMultiEditor < ArcadiaExt
|
|
2106
2303
|
if !@main_frame.enb.pages.empty?
|
2107
2304
|
@main_frame.enb.raise(@main_frame.enb.pages[_index-1])
|
2108
2305
|
else
|
2109
|
-
|
2306
|
+
frame.title('')
|
2110
2307
|
end
|
2111
2308
|
end
|
2112
2309
|
|
@@ -2130,18 +2327,16 @@ class Findview < TkFloatTitledFrame
|
|
2130
2327
|
#stop_resizing
|
2131
2328
|
y0 = 10
|
2132
2329
|
d = 23
|
2133
|
-
TkLabel.new(self.frame){
|
2330
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2134
2331
|
text 'Find what:'
|
2135
2332
|
place('x' => 8,'y' => y0,'height' => 19)
|
2136
2333
|
}
|
2137
2334
|
y0 = y0 + d
|
2138
|
-
@e_what = Tk::BWidget::ComboBox.new(self.frame){
|
2335
|
+
@e_what = Tk::BWidget::ComboBox.new(self.frame, Arcadia.style('combobox')){
|
2139
2336
|
editable true
|
2140
2337
|
justify 'left'
|
2141
|
-
relief 'ridge'
|
2338
|
+
#relief 'ridge'
|
2142
2339
|
autocomplete 'true'
|
2143
|
-
#insertbackground '#FFFFFF'
|
2144
|
-
entrybg '#FFFFFF'
|
2145
2340
|
expand 'tab'
|
2146
2341
|
takefocus 'true'
|
2147
2342
|
#pack('padx'=>10, 'fill'=>'x')
|
@@ -2149,52 +2344,54 @@ class Findview < TkFloatTitledFrame
|
|
2149
2344
|
}
|
2150
2345
|
@e_what_entry = TkWinfo.children(@e_what)[0]
|
2151
2346
|
|
2347
|
+
@e_what_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_what_entry))})
|
2348
|
+
|
2152
2349
|
y0 = y0 + d
|
2153
|
-
TkLabel.new(self.frame){
|
2350
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2154
2351
|
text 'Replace with:'
|
2155
2352
|
place('x' => 8,'y' => y0,'height' => 19)
|
2156
2353
|
}
|
2157
2354
|
y0 = y0 + d
|
2158
2355
|
|
2159
|
-
@e_with = Tk::BWidget::ComboBox.new(self.frame){
|
2356
|
+
@e_with = Tk::BWidget::ComboBox.new(self.frame, Arcadia.style('combobox')){
|
2160
2357
|
editable true
|
2161
2358
|
justify 'left'
|
2162
|
-
relief 'ridge'
|
2163
2359
|
autocomplete 'true'
|
2164
|
-
#insertbackground '#FFFFFF'
|
2165
|
-
entrybg '#FFFFFF'
|
2166
2360
|
expand 'tab'
|
2167
2361
|
takefocus 'true'
|
2168
2362
|
#pack('padx'=>10, 'fill'=>'x')
|
2169
2363
|
place('relwidth' => 1, 'width'=>-16,'x' => 8,'y' => y0,'height' => 19)
|
2170
2364
|
}
|
2365
|
+
@e_with_entry = TkWinfo.children(@e_with)[0]
|
2366
|
+
|
2367
|
+
@e_with_entry.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_with_entry))})
|
2171
2368
|
|
2172
2369
|
y0 = y0 + d
|
2173
|
-
@cb_reg = TkCheckButton.new(self.frame){|_cb_reg|
|
2370
|
+
@cb_reg = TkCheckButton.new(self.frame, Arcadia.style('checkbox')){|_cb_reg|
|
2174
2371
|
text 'Use Regular Expression'
|
2175
2372
|
justify 'left'
|
2176
|
-
relief 'flat'
|
2373
|
+
#relief 'flat'
|
2177
2374
|
#pack('side'=>'left', 'anchor'=>'e')
|
2178
2375
|
place('x' => 8,'y' => y0,'height' => 22)
|
2179
2376
|
}
|
2180
2377
|
y0 = y0 + d
|
2181
|
-
@cb_back = TkCheckButton.new(self.frame){|_cb_reg|
|
2378
|
+
@cb_back = TkCheckButton.new(self.frame, Arcadia.style('checkbox')){|_cb_reg|
|
2182
2379
|
text 'Search backwards'
|
2183
2380
|
justify 'left'
|
2184
|
-
relief 'flat'
|
2381
|
+
#relief 'flat'
|
2185
2382
|
#pack('side'=>'left', 'anchor'=>'e')
|
2186
2383
|
place('x' => 8,'y' => y0,'height' => 22)
|
2187
2384
|
}
|
2188
2385
|
|
2189
2386
|
y0 = y0 + d
|
2190
2387
|
y0 = y0 + d
|
2191
|
-
@buttons_frame = TkFrame.new(self.frame).pack('fill'=>'x', 'side'=>'bottom')
|
2388
|
+
@buttons_frame = TkFrame.new(self.frame, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom')
|
2192
2389
|
|
2193
|
-
@b_replace_all = TkButton.new(@buttons_frame){|_b_go|
|
2390
|
+
@b_replace_all = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2194
2391
|
state 'disabled'
|
2195
2392
|
default 'disabled'
|
2196
2393
|
text 'Replace All'
|
2197
|
-
overrelief 'raised'
|
2394
|
+
#overrelief 'raised'
|
2198
2395
|
justify 'center'
|
2199
2396
|
#width 15
|
2200
2397
|
pack('side'=>'right','ipadx'=>5, 'padx'=>5)
|
@@ -2202,11 +2399,11 @@ class Findview < TkFloatTitledFrame
|
|
2202
2399
|
}
|
2203
2400
|
|
2204
2401
|
|
2205
|
-
@b_replace = TkButton.new(@buttons_frame){|_b_go|
|
2402
|
+
@b_replace = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2206
2403
|
state 'disabled'
|
2207
2404
|
default 'disabled'
|
2208
2405
|
text 'Replace'
|
2209
|
-
overrelief 'raised'
|
2406
|
+
#overrelief 'raised'
|
2210
2407
|
justify 'center'
|
2211
2408
|
#width 15
|
2212
2409
|
pack('side'=>'right','ipadx'=>5, 'padx'=>5)
|
@@ -2214,13 +2411,13 @@ class Findview < TkFloatTitledFrame
|
|
2214
2411
|
}
|
2215
2412
|
|
2216
2413
|
|
2217
|
-
@b_go = TkButton.new(@buttons_frame){|_b_go|
|
2414
|
+
@b_go = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2218
2415
|
compound 'none'
|
2219
2416
|
default 'disabled'
|
2220
2417
|
text 'Find Next'
|
2221
2418
|
#background '#ffffff'
|
2222
2419
|
#image TkPhotoImage.new('dat' => FIND_GIF)
|
2223
|
-
overrelief 'raised'
|
2420
|
+
#overrelief 'raised'
|
2224
2421
|
justify 'center'
|
2225
2422
|
#relief 'ridge'
|
2226
2423
|
#width 15
|
@@ -2465,27 +2662,28 @@ class GoToLine < TkFloatTitledFrame
|
|
2465
2662
|
#stop_resizing
|
2466
2663
|
y0 = 10
|
2467
2664
|
d = 23
|
2468
|
-
TkLabel.new(self.frame){
|
2665
|
+
TkLabel.new(self.frame, Arcadia.style('label')){
|
2469
2666
|
text 'Go to line:'
|
2470
2667
|
place('x' => 8,'y' => y0,'height' => 19)
|
2471
2668
|
}
|
2472
2669
|
y0 = y0 + d
|
2473
|
-
@e_line = TkEntry.new(self.frame){
|
2670
|
+
@e_line = TkEntry.new(self.frame, Arcadia.style('edit')){
|
2474
2671
|
justify 'left'
|
2475
|
-
relief 'ridge'
|
2672
|
+
#relief 'ridge'
|
2476
2673
|
place('relwidth' => 1, 'width'=>-16,'x' => 8,'y' => y0,'height' => 19)
|
2477
2674
|
}
|
2675
|
+
@e_line.bind_append("1",proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>@e_line))})
|
2478
2676
|
|
2479
2677
|
y0 = y0 + d
|
2480
2678
|
y0 = y0 + d
|
2481
|
-
@buttons_frame = TkFrame.new(self.frame).pack('fill'=>'x', 'side'=>'bottom')
|
2679
|
+
@buttons_frame = TkFrame.new(self.frame, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom')
|
2482
2680
|
|
2483
|
-
@b_go = TkButton.new(@buttons_frame){|_b_go|
|
2681
|
+
@b_go = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go|
|
2484
2682
|
compound 'none'
|
2485
2683
|
default 'disabled'
|
2486
2684
|
text 'Go'
|
2487
|
-
overrelief 'raised'
|
2488
|
-
justify 'center'
|
2685
|
+
#overrelief 'raised'
|
2686
|
+
#justify 'center'
|
2489
2687
|
pack('side'=>'right','ipadx'=>5, 'padx'=>5)
|
2490
2688
|
}
|
2491
2689
|
place('x'=>150,'y'=>150,'height'=> 120,'width'=> 100)
|