arcadia 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +20 -14
- data/conf/arcadia.conf +5 -3
- data/conf/arcadia.init.rb +1 -0
- data/conf/arcadia.res.rb +27 -0
- data/conf/theme-dark.conf +5 -2
- data/ext/ae-dir-projects/ae-dir-projects.rb +8 -2
- data/ext/ae-editor/ae-editor.conf +9 -45
- data/ext/ae-editor/ae-editor.rb +650 -240
- data/ext/ae-editor/langs/coderay.tokens +11 -3
- data/ext/ae-editor/langs/java.lang +1 -1
- data/ext/ae-editor/langs/ruby.lang +1 -1
- data/ext/ae-rad/ae-rad-palette.rb +1 -1
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +13 -5
- data/ext/ae-search-in-files/ae-search-in-files.conf +1 -1
- data/ext/ae-search-in-files/ae-search-in-files.rb +10 -16
- data/ext/ae-search-in-files/ext/ack-in-files/ack-in-files.conf +1 -1
- data/ext/ae-search-in-files/ext/ack-in-files/ack-in-files.rb +7 -12
- data/lib/a-commons.rb +458 -251
- data/lib/a-contracts.rb +25 -10
- data/lib/a-core.rb +185 -77
- data/lib/a-tkcommons.rb +224 -77
- metadata +6 -4
data/lib/a-contracts.rb
CHANGED
@@ -23,20 +23,21 @@ class ArcadiaEvent < Event
|
|
23
23
|
|
24
24
|
end
|
25
25
|
|
26
|
-
class
|
26
|
+
class ArcadiaSysEvent < ArcadiaEvent
|
27
27
|
end
|
28
28
|
|
29
|
+
|
29
30
|
# +------------------------------------------+
|
30
31
|
# Extention Event (raised only by Arcadia)
|
31
32
|
# do not raise!
|
32
33
|
# Every extensions listen on these events
|
33
34
|
# +------------------------------------------+
|
34
35
|
|
35
|
-
class BuildEvent <
|
36
|
+
class BuildEvent < ArcadiaSysEvent
|
36
37
|
attr_accessor :name
|
37
38
|
end
|
38
39
|
|
39
|
-
class InitializeEvent <
|
40
|
+
class InitializeEvent < ArcadiaSysEvent
|
40
41
|
end
|
41
42
|
|
42
43
|
|
@@ -44,15 +45,28 @@ end
|
|
44
45
|
# before process FinalizeEvent during quiet face.
|
45
46
|
# If listener(Extension) set can_exit property to false then
|
46
47
|
# arcadia abort the quiet face.
|
47
|
-
class ExitQueryEvent <
|
48
|
+
class ExitQueryEvent < ArcadiaSysEvent
|
48
49
|
attr_accessor :can_exit
|
49
50
|
end
|
50
51
|
|
51
|
-
class
|
52
|
+
class QuitEvent < ArcadiaSysEvent
|
53
|
+
end
|
54
|
+
|
55
|
+
class FinalizeEvent < ArcadiaSysEvent
|
56
|
+
end
|
57
|
+
|
58
|
+
# used only by ArcadiaExtPlus
|
59
|
+
class ClearCacheInstanceEvent < ArcadiaSysEvent
|
52
60
|
end
|
53
61
|
|
62
|
+
class DestroyInstanceEvent < ArcadiaSysEvent
|
63
|
+
end
|
54
64
|
|
55
|
-
class
|
65
|
+
class ActivateInstanceEvent < ArcadiaSysEvent
|
66
|
+
attr_accessor :name
|
67
|
+
end
|
68
|
+
|
69
|
+
class NeedRubyGemWizardEvent < ArcadiaSysEvent
|
56
70
|
class Result < Result
|
57
71
|
attr_accessor :installed
|
58
72
|
end
|
@@ -64,23 +78,24 @@ class NeedRubyGemWizardEvent < ArcadiaEvent
|
|
64
78
|
attr_accessor :gem_events
|
65
79
|
end
|
66
80
|
|
67
|
-
class ArcadiaProblemEvent <
|
81
|
+
class ArcadiaProblemEvent < ArcadiaSysEvent
|
68
82
|
DEPENDENCE_MISSING_TYPE = "DEPENDENCE_MISSING_TYPE"
|
69
83
|
RUNTIME_ERROR_TYPE = "RUNTIME_ERROR_TYPE"
|
70
84
|
attr_accessor :type, :level, :title, :detail
|
71
85
|
end
|
72
86
|
|
87
|
+
# +------------------------------------------+
|
73
88
|
|
74
89
|
# +------------------------------------------+
|
75
90
|
# Generic Layout Event
|
76
91
|
#
|
77
92
|
# +------------------------------------------+
|
78
|
-
class LayoutRaisingFrameEvent <
|
93
|
+
class LayoutRaisingFrameEvent < ArcadiaSysEvent
|
79
94
|
attr_accessor :extension_name
|
80
95
|
attr_accessor :frame_name
|
81
96
|
end
|
82
97
|
|
83
|
-
class LayoutChangedFrameEvent <
|
98
|
+
class LayoutChangedFrameEvent < ArcadiaSysEvent
|
84
99
|
end
|
85
100
|
|
86
101
|
# +---------------------------------------------+
|
@@ -321,7 +336,7 @@ class DialogEvent < ArcadiaEvent
|
|
321
336
|
class Result < Result
|
322
337
|
attr_accessor :value
|
323
338
|
end
|
324
|
-
attr_accessor :title, :msg, :type, :level
|
339
|
+
attr_accessor :title, :msg, :type, :level, :exception
|
325
340
|
end
|
326
341
|
|
327
342
|
#class QuestionDialogEvent < DialogEvent
|
data/lib/a-core.rb
CHANGED
@@ -23,7 +23,7 @@ class Arcadia < TkApplication
|
|
23
23
|
super(
|
24
24
|
ApplicationParams.new(
|
25
25
|
'arcadia',
|
26
|
-
'0.
|
26
|
+
'0.11.0',
|
27
27
|
'conf/arcadia.conf',
|
28
28
|
'conf/arcadia.pers'
|
29
29
|
)
|
@@ -43,7 +43,7 @@ class Arcadia < TkApplication
|
|
43
43
|
ArcadiaActionDispatcher.new(self)
|
44
44
|
ArcadiaGemsWizard.new(self)
|
45
45
|
MonitorLastUsedDir.new
|
46
|
-
FocusEventManager.new
|
46
|
+
@focus_event_manager = FocusEventManager.new
|
47
47
|
#self.load_local_config(false)
|
48
48
|
ObjectSpace.define_finalizer($arcadia, self.class.method(:finalize).to_proc)
|
49
49
|
#_title = "Arcadia Ruby ide :: [Platform = #{RUBY_PLATFORM}] [Ruby version = #{RUBY_VERSION}] [TclTk version = #{tcltk_info.level}]"
|
@@ -73,8 +73,6 @@ class Arcadia < TkApplication
|
|
73
73
|
)
|
74
74
|
#.place('x'=>0,'y'=>0,'relwidth'=>1,'relheight'=>1)
|
75
75
|
|
76
|
-
|
77
|
-
|
78
76
|
@mf_root.show_statusbar('status')
|
79
77
|
Arcadia.new_statusbar_item("Platform").text=RUBY_PLATFORM
|
80
78
|
self['toolbar']= ArcadiaMainToolbar.new(self, @mf_root.add_toolbar)
|
@@ -177,7 +175,15 @@ class Arcadia < TkApplication
|
|
177
175
|
def register(_ext)
|
178
176
|
@exts_i << _ext
|
179
177
|
end
|
178
|
+
|
179
|
+
def unregister(_ext)
|
180
|
+
@exts_i.delete(_ext)
|
181
|
+
end
|
180
182
|
|
183
|
+
def last_focused_text_widget
|
184
|
+
@focus_event_manager.last_focus_widget
|
185
|
+
end
|
186
|
+
|
181
187
|
def show_hide_toolbar
|
182
188
|
if @is_toolbar_show
|
183
189
|
@mf_root.show_toolbar(0,false)
|
@@ -203,12 +209,12 @@ class Arcadia < TkApplication
|
|
203
209
|
def ext_source_must_be_loaded?(_name)
|
204
210
|
ret = ext_active?(_name)
|
205
211
|
if !ret
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
+
@exts_dip.each{|key,val|
|
213
|
+
if val == _name
|
214
|
+
ret = ret || ext_active?(key)
|
215
|
+
end
|
216
|
+
break if ret
|
217
|
+
}
|
212
218
|
end
|
213
219
|
ret
|
214
220
|
end
|
@@ -257,11 +263,11 @@ class Arcadia < TkApplication
|
|
257
263
|
end
|
258
264
|
|
259
265
|
def Arcadia.gem_available?(_gem)
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
266
|
+
if Gem.respond_to?(:available?)
|
267
|
+
return Gem.available?(_gem)
|
268
|
+
else
|
269
|
+
return !Gem.source_index.find_name(_gem).empty?
|
270
|
+
end
|
265
271
|
end
|
266
272
|
|
267
273
|
def check_gems_dependences(_ext)
|
@@ -321,12 +327,18 @@ class Arcadia < TkApplication
|
|
321
327
|
}
|
322
328
|
begin
|
323
329
|
_build_event = Arcadia.process_event(BuildEvent.new(self))
|
324
|
-
rescue Exception
|
330
|
+
rescue Exception => e
|
325
331
|
ret = false
|
326
332
|
msg = "During build event processing(#{$!.class.to_s}) : #{$!} at : #{$@.to_s}"
|
327
|
-
ans =
|
328
|
-
|
329
|
-
|
333
|
+
ans = Arcadia.dialog(self,
|
334
|
+
'type'=>'abort_retry_ignore',
|
335
|
+
'title' => "(Arcadia) During build event processing",
|
336
|
+
'msg'=>msg,
|
337
|
+
'exception'=>e,
|
338
|
+
'level'=>'error')
|
339
|
+
# ans = Tk.messageBox('icon' => 'error', 'type' => 'abortretryignore',
|
340
|
+
# 'title' => "(Arcadia) Build face", 'parent' => @root,
|
341
|
+
# 'message' => msg)
|
330
342
|
if ans == 'abort'
|
331
343
|
raise
|
332
344
|
exit
|
@@ -342,6 +354,17 @@ class Arcadia < TkApplication
|
|
342
354
|
_build_event = Arcadia.process_event(InitializeEvent.new(self))
|
343
355
|
end
|
344
356
|
|
357
|
+
def do_make_clones
|
358
|
+
Array.new.concat(@exts_i).each{|ext|
|
359
|
+
if ext.kind_of?(ArcadiaExtPlus)
|
360
|
+
a = ext.conf_array("#{ext.name}.clones")
|
361
|
+
a.each{|clone_name|
|
362
|
+
ext.clone(clone_name)
|
363
|
+
}
|
364
|
+
end
|
365
|
+
}
|
366
|
+
end
|
367
|
+
|
345
368
|
def load_maximized
|
346
369
|
lm = self['conf']['layout.maximized']
|
347
370
|
if lm
|
@@ -369,12 +392,18 @@ class Arcadia < TkApplication
|
|
369
392
|
require "#{Dir.pwd}/#{source}"
|
370
393
|
end
|
371
394
|
@exts_loaded << _extension
|
372
|
-
rescue Exception,LoadError
|
395
|
+
rescue Exception,LoadError => e
|
373
396
|
ret = false
|
374
397
|
msg = "Loading \"#{_extension}\" (#{$!.class.to_s}) : #{$!} at : #{$@.to_s}"
|
375
|
-
ans =
|
376
|
-
|
377
|
-
|
398
|
+
ans = Arcadia.dialog(self,
|
399
|
+
'type'=>'abort_retry_ignore',
|
400
|
+
'title' => "(Arcadia) Extensions '#{_extension}'",
|
401
|
+
'msg'=>msg,
|
402
|
+
'exception'=>e,
|
403
|
+
'level'=>'error')
|
404
|
+
# ans = Tk.messageBox('icon' => 'error', 'type' => 'abortretryignore',
|
405
|
+
# 'title' => "(Arcadia) Extensions '#{_extension}'", 'parent' => @root,
|
406
|
+
# 'message' => msg)
|
378
407
|
if ans == 'abort'
|
379
408
|
raise
|
380
409
|
exit
|
@@ -401,12 +430,18 @@ class Arcadia < TkApplication
|
|
401
430
|
end
|
402
431
|
publish(_extension, klass.new(self, _extension))
|
403
432
|
end
|
404
|
-
rescue Exception,LoadError
|
433
|
+
rescue Exception,LoadError => e
|
405
434
|
ret = false
|
406
|
-
msg = "Loading \"#{_extension}\" (#{$!.class.to_s}) : #{$!} at : #{$@.to_s}"
|
407
|
-
ans =
|
408
|
-
|
409
|
-
|
435
|
+
msg = "Loading \"#{_extension}\" (#{$!.class.to_s}) : #{$!} at : #{$@.to_s}"
|
436
|
+
ans = Arcadia.dialog(self,
|
437
|
+
'type'=>'abort_retry_ignore',
|
438
|
+
'title' => "(Arcadia) Extensions '#{_extension}'",
|
439
|
+
'msg'=>msg,
|
440
|
+
'exception'=>e,
|
441
|
+
'level'=>'error')
|
442
|
+
# ans = Tk.messageBox('icon' => 'error', 'type' => 'abortretryignore',
|
443
|
+
# 'title' => "(Arcadia) Extensions '#{_extension}'", 'parent' => @root,
|
444
|
+
# 'message' => msg)
|
410
445
|
if ans == 'abort'
|
411
446
|
raise
|
412
447
|
exit
|
@@ -422,11 +457,17 @@ class Arcadia < TkApplication
|
|
422
457
|
def ext_method(_extension, _method)
|
423
458
|
begin
|
424
459
|
self[_extension].send(_method)
|
425
|
-
rescue Exception
|
460
|
+
rescue Exception => e
|
426
461
|
msg = _method.to_s+' "'+_extension.to_s+'"'+" ("+$!.class.to_s+") "+" : "+$! + "\n at : "+$@.to_s
|
427
|
-
ans =
|
428
|
-
|
429
|
-
|
462
|
+
ans = Arcadia.dialog(self,
|
463
|
+
'type'=>'abort_retry_ignore',
|
464
|
+
'title' => "(Arcadia) Extensions",
|
465
|
+
'msg'=>msg,
|
466
|
+
'exception'=>e,
|
467
|
+
'level'=>'error')
|
468
|
+
# ans = Tk.messageBox('icon' => 'warning', 'type' => 'abortretryignore',
|
469
|
+
# 'title' => '(Arcadia) Extensions', 'parent' => @root,
|
470
|
+
# 'message' => msg)
|
430
471
|
if ans == 'abort'
|
431
472
|
raise
|
432
473
|
exit
|
@@ -487,7 +528,12 @@ class Arcadia < TkApplication
|
|
487
528
|
|
488
529
|
rescue Exception
|
489
530
|
msg = "Loading layout: (#{$!.class.to_s} : #{$!.to_s} at : #{$@.to_s})"
|
490
|
-
if Arcadia.dialog(self,
|
531
|
+
if Arcadia.dialog(self,
|
532
|
+
'type'=>'ok_cancel',
|
533
|
+
'level'=>'error',
|
534
|
+
'title' => '(Arcadia) Layout',
|
535
|
+
'exception' => $!,
|
536
|
+
'msg'=>msg)=='cancel'
|
491
537
|
raise
|
492
538
|
exit
|
493
539
|
else
|
@@ -514,12 +560,12 @@ class Arcadia < TkApplication
|
|
514
560
|
end
|
515
561
|
|
516
562
|
def load_sysdefaultproperty
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
563
|
+
Tk.tk_call "eval","option add *background #{self['conf']['background']}"
|
564
|
+
Tk.tk_call "eval","option add *foreground #{self['conf']['foreground']}"
|
565
|
+
Tk.tk_call "eval","option add *activebackground #{self['conf']['activebackground']}"
|
566
|
+
Tk.tk_call "eval","option add *activeforeground #{self['conf']['activeforeground']}"
|
567
|
+
Tk.tk_call "eval","option add *highlightcolor #{self['conf']['background']}"
|
568
|
+
Tk.tk_call "eval","option add *relief #{self['conf']['relief']}"
|
523
569
|
|
524
570
|
if !Arcadia.is_windows? && File.basename(Arcadia.ruby) != 'ruby'
|
525
571
|
begin
|
@@ -579,6 +625,7 @@ class Arcadia < TkApplication
|
|
579
625
|
load_user_control(self['toolbar'],"","e")
|
580
626
|
load_user_control(self['menubar'],"","e")
|
581
627
|
load_runners
|
628
|
+
do_make_clones
|
582
629
|
do_initialize
|
583
630
|
#@layout.build_invert_menu
|
584
631
|
end
|
@@ -686,6 +733,21 @@ class Arcadia < TkApplication
|
|
686
733
|
|
687
734
|
end
|
688
735
|
|
736
|
+
def register_key_binding(_self_target, k, v)
|
737
|
+
value = v.strip
|
738
|
+
key_dits = k.split('[')
|
739
|
+
return if k.length == 0
|
740
|
+
key_event=key_dits[0]
|
741
|
+
if key_dits[1]
|
742
|
+
key_sym=key_dits[1][0..-2]
|
743
|
+
end
|
744
|
+
@root.bind_append(key_event){|e|
|
745
|
+
if key_sym == e.keysym
|
746
|
+
Arcadia.process_event(_self_target.instance_eval(value))
|
747
|
+
end
|
748
|
+
}
|
749
|
+
end
|
750
|
+
|
689
751
|
def load_key_binding(_ext='')
|
690
752
|
return unless _ext && ext_active?(_ext)
|
691
753
|
if _ext.length > 0
|
@@ -701,18 +763,7 @@ class Arcadia < TkApplication
|
|
701
763
|
end
|
702
764
|
keybs=Arcadia.conf_group(suf)
|
703
765
|
keybs.each{|k,v|
|
704
|
-
|
705
|
-
key_dits = k.split('[')
|
706
|
-
next if k.length == 0
|
707
|
-
key_event=key_dits[0]
|
708
|
-
if key_dits[1]
|
709
|
-
key_sym=key_dits[1][0..-2]
|
710
|
-
end
|
711
|
-
@root.bind_append(key_event){|e|
|
712
|
-
if key_sym == e.keysym
|
713
|
-
Arcadia.process_event(_self_on_eval.instance_eval(value))
|
714
|
-
end
|
715
|
-
}
|
766
|
+
register_key_binding(_self_on_eval, k, v)
|
716
767
|
}
|
717
768
|
end
|
718
769
|
|
@@ -767,6 +818,7 @@ class Arcadia < TkApplication
|
|
767
818
|
'type'=>'ok_cancel',
|
768
819
|
'title' => "(Arcadia) #{_user_control.class::SUF}",
|
769
820
|
'msg'=>msg,
|
821
|
+
'exception'=>$!,
|
770
822
|
'level'=>'error')=='cancel'
|
771
823
|
raise
|
772
824
|
exit
|
@@ -964,7 +1016,26 @@ class Arcadia < TkApplication
|
|
964
1016
|
def Arcadia.conf_group(_path, _refresh=false)
|
965
1017
|
Configurable.properties_group(_path, Arcadia.instance['conf'], 'conf', _refresh)
|
966
1018
|
end
|
967
|
-
|
1019
|
+
|
1020
|
+
def Arcadia.conf_group_copy(_path_source, _path_target, _suff = 'conf')
|
1021
|
+
_target = conf_group(_path_source)
|
1022
|
+
_postfix = _path_target.sub(_path_source,"")
|
1023
|
+
_target.each{|k,v|
|
1024
|
+
if ["frames.labels","frames.names","name"].include?(k)
|
1025
|
+
v_a = v.split(',')
|
1026
|
+
new_val = ''
|
1027
|
+
v_a.each{|value|
|
1028
|
+
if new_val.length > 0
|
1029
|
+
new_val = "#{new_val},"
|
1030
|
+
end
|
1031
|
+
new_val = "#{new_val}#{value}#{_postfix}"
|
1032
|
+
}
|
1033
|
+
v = new_val
|
1034
|
+
end
|
1035
|
+
@@instance['conf']["#{_path_target}.#{k}"]=v
|
1036
|
+
}
|
1037
|
+
end
|
1038
|
+
|
968
1039
|
def Arcadia.persistent(_property, _value=nil, _immediate=false)
|
969
1040
|
if @@instance
|
970
1041
|
if _value.nil?
|
@@ -1157,9 +1228,12 @@ class Arcadia < TkApplication
|
|
1157
1228
|
end
|
1158
1229
|
|
1159
1230
|
def Arcadia.runtime_error(_e, _title="Runtime Error")
|
1160
|
-
ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::RUNTIME_ERROR_TYPE,"title"=>"#{_title}
|
1231
|
+
ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::RUNTIME_ERROR_TYPE,"title"=>"#{_title} : [#{_e.class}] #{_e.message} at :", "detail"=>_e.backtrace).go!
|
1161
1232
|
end
|
1162
1233
|
|
1234
|
+
def Arcadia.runtime_error_msg(_msg, _title="Runtime Error")
|
1235
|
+
ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::RUNTIME_ERROR_TYPE,"title"=>"#{_title} at :", "detail"=>_msg).go!
|
1236
|
+
end
|
1163
1237
|
end
|
1164
1238
|
|
1165
1239
|
class ArcadiaUserControl
|
@@ -1841,6 +1915,7 @@ class ArcadiaProblemsShower
|
|
1841
1915
|
@initialized = true
|
1842
1916
|
if @problems.count > 0
|
1843
1917
|
show_problems
|
1918
|
+
@ff.show
|
1844
1919
|
end
|
1845
1920
|
end
|
1846
1921
|
|
@@ -1871,7 +1946,7 @@ class ArcadiaProblemsShower
|
|
1871
1946
|
def initialize_gui
|
1872
1947
|
# float_frame
|
1873
1948
|
args = {'width'=>600, 'height'=>300, 'x'=>400, 'y'=>100}
|
1874
|
-
@ff = @arcadia.layout.
|
1949
|
+
@ff = @arcadia.layout.add_float_frame(args).hide
|
1875
1950
|
@ff.title("Arcadia problems")
|
1876
1951
|
|
1877
1952
|
#tree
|
@@ -2249,16 +2324,29 @@ class ArcadiaDialogManager
|
|
2249
2324
|
end
|
2250
2325
|
tktype = type.gsub('_','').downcase
|
2251
2326
|
|
2327
|
+
if _event.msg && _event.msg.length > 500
|
2328
|
+
msg = _event.msg[0..500]+' ...'
|
2329
|
+
else
|
2330
|
+
msg = _event.msg
|
2331
|
+
end
|
2332
|
+
|
2252
2333
|
tkdialog = Tk::BWidget::MessageDlg.new(
|
2253
2334
|
'icon' => icon,
|
2254
2335
|
'bg' => Arcadia.conf('background'),
|
2255
2336
|
'fg' => Arcadia.conf('foreground'),
|
2256
2337
|
'type' => tktype,
|
2257
2338
|
'title' => _event.title,
|
2258
|
-
'message' =>
|
2339
|
+
'message' => msg)
|
2259
2340
|
|
2260
2341
|
tkdialog.configure('font'=>'courier 6')
|
2261
2342
|
res = tkdialog.create
|
2343
|
+
if _event.level == 'error'
|
2344
|
+
if _event.exception != nil
|
2345
|
+
Arcadia.runtime_error(_event.exception, _event.title)
|
2346
|
+
else
|
2347
|
+
Arcadia.runtime_error_msg(_event.msg, _event.title)
|
2348
|
+
end
|
2349
|
+
end
|
2262
2350
|
_event.add_result(self, 'value'=>res_array[res.to_i])
|
2263
2351
|
end
|
2264
2352
|
|
@@ -2301,7 +2389,11 @@ class ArcadiaLayout
|
|
2301
2389
|
@panels = Hash.new
|
2302
2390
|
@panels['_domain_root_']= Hash.new
|
2303
2391
|
@panels['_domain_root_']['root']= _frame
|
2304
|
-
@panels['_domain_root_']['sons'] =
|
2392
|
+
@panels['_domain_root_']['sons'] = Hash.new
|
2393
|
+
|
2394
|
+
@panels['nil'] = Hash.new
|
2395
|
+
@panels['nil']['root'] = TkTitledFrameAdapter.new(self.root)
|
2396
|
+
|
2305
2397
|
@autotab = _autotab
|
2306
2398
|
@headed = false
|
2307
2399
|
@wrappers=Hash.new
|
@@ -2597,6 +2689,9 @@ class ArcadiaLayout
|
|
2597
2689
|
saved_root_splitted_frames = @panels[_domain]['root_splitted_frames']
|
2598
2690
|
_saved = Hash.new
|
2599
2691
|
_saved.update(@panels[_domain]['sons'])
|
2692
|
+
_saved.each_key{|name|
|
2693
|
+
@panels['nil']['root'].change_adapters(name, @panels[_domain]['root'].transient_frame_adapter[name])
|
2694
|
+
}
|
2600
2695
|
geometry = TkWinfo.geometry(@panels[_domain]['root'])
|
2601
2696
|
width = geometry.split('x')[0].to_i/2
|
2602
2697
|
_saved.each{|name,ffw|
|
@@ -2609,7 +2704,8 @@ class ArcadiaLayout
|
|
2609
2704
|
build_titled_frame(domain_name(_row.to_i,_col.to_i+1))
|
2610
2705
|
_saved.each{|name,ffw|
|
2611
2706
|
ffw.domain = _domain
|
2612
|
-
register_panel(ffw, ffw.hinner_frame)
|
2707
|
+
register_panel(ffw, ffw.hinner_frame)
|
2708
|
+
@panels[_domain]['root'].change_adapters(name, @panels['nil']['root'].transient_frame_adapter[name])
|
2613
2709
|
}
|
2614
2710
|
if saved_root_splitted_frames
|
2615
2711
|
@panels[_domain]['root_splitted_frames']=saved_root_splitted_frames
|
@@ -2621,6 +2717,9 @@ class ArcadiaLayout
|
|
2621
2717
|
saved_root_splitted_frames = @panels[_domain]['root_splitted_frames']
|
2622
2718
|
_saved = Hash.new
|
2623
2719
|
_saved.update(@panels[_domain]['sons'])
|
2720
|
+
_saved.each_key{|name|
|
2721
|
+
@panels['nil']['root'].change_adapters(name, @panels[_domain]['root'].transient_frame_adapter[name])
|
2722
|
+
}
|
2624
2723
|
geometry = TkWinfo.geometry(@panels[_domain]['root'])
|
2625
2724
|
height = geometry.split('+')[0].split('x')[1].to_i/2
|
2626
2725
|
_saved.each{|name,ffw|
|
@@ -2633,7 +2732,8 @@ class ArcadiaLayout
|
|
2633
2732
|
build_titled_frame(domain_name(_row.to_i+1,_col.to_i))
|
2634
2733
|
_saved.each{|name,ffw|
|
2635
2734
|
ffw.domain = _domain
|
2636
|
-
register_panel(ffw, ffw.hinner_frame)
|
2735
|
+
register_panel(ffw, ffw.hinner_frame)
|
2736
|
+
@panels[_domain]['root'].change_adapters(name, @panels['nil']['root'].transient_frame_adapter[name])
|
2637
2737
|
}
|
2638
2738
|
if saved_root_splitted_frames
|
2639
2739
|
@panels[_domain]['root_splitted_frames']=saved_root_splitted_frames
|
@@ -2840,6 +2940,9 @@ class ArcadiaLayout
|
|
2840
2940
|
else
|
2841
2941
|
other_source_save = Hash.new
|
2842
2942
|
other_source_save.update(@panels[other_domain]['sons']) if @panels[other_domain]
|
2943
|
+
other_source_save.each_key{|name|
|
2944
|
+
@panels['nil']['root'].change_adapters(name, @panels[other_domain]['root'].transient_frame_adapter[name])
|
2945
|
+
}
|
2843
2946
|
other_source_save.each{|name,ffw|
|
2844
2947
|
unregister_panel(ffw, false, false)
|
2845
2948
|
}
|
@@ -2851,6 +2954,7 @@ class ArcadiaLayout
|
|
2851
2954
|
other_source_save.each{|name,ffw|
|
2852
2955
|
ffw.domain = other_domain
|
2853
2956
|
register_panel(ffw, ffw.hinner_frame)
|
2957
|
+
@panels[other_domain]['root'].change_adapters(name, @panels['nil']['root'].transient_frame_adapter[name])
|
2854
2958
|
}
|
2855
2959
|
parent_splitted_adapter = find_splitted_frame(@panels[other_domain]['root'])
|
2856
2960
|
if parent_splitted_adapter
|
@@ -2874,14 +2978,14 @@ class ArcadiaLayout
|
|
2874
2978
|
|
2875
2979
|
def add_commons_menu_items(_domain, _menu)
|
2876
2980
|
_menu.insert('end', :separator)
|
2877
|
-
_menu.insert('end'
|
2981
|
+
_menu.insert('end', :command,
|
2878
2982
|
:label=>"add column",
|
2879
2983
|
:image=>Arcadia.image_res(ADD_GIF),
|
2880
2984
|
:compound=>'left',
|
2881
2985
|
:command=>proc{add_cols_runtime(_domain)},
|
2882
2986
|
:hidemargin => true
|
2883
2987
|
)
|
2884
|
-
_menu.insert('end'
|
2988
|
+
_menu.insert('end', :command,
|
2885
2989
|
:label=>"add row",
|
2886
2990
|
:image=>Arcadia.image_res(ADD_GIF),
|
2887
2991
|
:compound=>'left',
|
@@ -2889,7 +2993,7 @@ class ArcadiaLayout
|
|
2889
2993
|
:hidemargin => true
|
2890
2994
|
)
|
2891
2995
|
if @panels.keys.length > 2
|
2892
|
-
_menu.insert('end'
|
2996
|
+
_menu.insert('end', :command,
|
2893
2997
|
:label=>"close",
|
2894
2998
|
:image=>Arcadia.image_res(CLOSE_FRAME_GIF),
|
2895
2999
|
:compound=>'left',
|
@@ -2977,12 +3081,12 @@ class ArcadiaLayout
|
|
2977
3081
|
register_panel(ffw2, ffw2.hinner_frame)
|
2978
3082
|
#@panels[_target_domain]['root'].top_text(tt2)
|
2979
3083
|
#@panels[source_domain]['root'].top_text(tt1)
|
2980
|
-
@panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name))
|
2981
|
-
@panels[source_domain]['root'].save_caption(ffw1.name, @panels[_target_domain]['root'].last_caption(ffw1.name))
|
3084
|
+
@panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name), @panels[source_domain]['root'].last_caption_image(ffw2.name))
|
3085
|
+
@panels[source_domain]['root'].save_caption(ffw1.name, @panels[_target_domain]['root'].last_caption(ffw1.name), @panels[_target_domain]['root'].last_caption_image(ffw1.name))
|
2982
3086
|
@panels[_target_domain]['root'].restore_caption(ffw2.name)
|
2983
3087
|
@panels[source_domain]['root'].restore_caption(ffw1.name)
|
2984
|
-
@panels[_target_domain]['root'].
|
2985
|
-
@panels[source_domain]['root'].
|
3088
|
+
@panels[_target_domain]['root'].change_adapters(ffw2.name, @panels[source_domain]['root'].forge_transient_adapter(ffw2.name))
|
3089
|
+
@panels[source_domain]['root'].change_adapters(ffw1.name, @panels[_target_domain]['root'].forge_transient_adapter(ffw1.name))
|
2986
3090
|
elsif source_has_domain && @panels[source_domain]['sons'].length >= 1
|
2987
3091
|
ffw2 = @panels[source_domain]['sons'][_source_name]
|
2988
3092
|
unregister_panel(ffw2, false, false)
|
@@ -2990,13 +3094,16 @@ class ArcadiaLayout
|
|
2990
3094
|
register_panel(ffw2, ffw2.hinner_frame)
|
2991
3095
|
#@panels[_target_domain]['root'].top_text(tt2)
|
2992
3096
|
#@panels[source_domain]['root'].top_text('')
|
2993
|
-
@panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name))
|
3097
|
+
@panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name), @panels[source_domain]['root'].last_caption_image(ffw2.name))
|
2994
3098
|
@panels[_target_domain]['root'].restore_caption(ffw2.name)
|
2995
|
-
@panels[_target_domain]['root'].
|
3099
|
+
@panels[_target_domain]['root'].change_adapters(ffw2.name, @panels[source_domain]['root'].forge_transient_adapter(ffw2.name))
|
2996
3100
|
elsif !source_has_domain
|
2997
3101
|
ffw2 = @wrappers[_source_name]
|
2998
3102
|
ffw2.domain = _target_domain
|
2999
3103
|
register_panel(ffw2, ffw2.hinner_frame)
|
3104
|
+
if @panels['nil']['root'].transient_frame_adapter[ffw2.name]
|
3105
|
+
@panels[ffw2.domain]['root'].change_adapters(ffw2.name, @panels['nil']['root'].transient_frame_adapter[ffw2.name])
|
3106
|
+
end
|
3000
3107
|
#@panels[_target_domain]['root'].top_text('')
|
3001
3108
|
end
|
3002
3109
|
# refresh -----
|
@@ -3074,7 +3181,6 @@ class ArcadiaLayout
|
|
3074
3181
|
|
3075
3182
|
end
|
3076
3183
|
|
3077
|
-
|
3078
3184
|
def build_invert_menu(refresh_commons_items=false)
|
3079
3185
|
@panels.keys.each{|dom|
|
3080
3186
|
if dom != '_domain_root_' && @panels[dom] && @panels[dom]['root']
|
@@ -3124,7 +3230,7 @@ class ArcadiaLayout
|
|
3124
3230
|
root_frame = pan['root'].frame
|
3125
3231
|
pan['root'].title(_title)
|
3126
3232
|
pan['root'].restore_caption(_name)
|
3127
|
-
pan['root'].
|
3233
|
+
pan['root'].change_adapters_name(_name)
|
3128
3234
|
if !root_frame.instance_of?(TkFrameAdapter) && num==0
|
3129
3235
|
if _adapter
|
3130
3236
|
adapter = _adapter
|
@@ -3155,8 +3261,8 @@ class ArcadiaLayout
|
|
3155
3261
|
'raisecmd'=>proc{
|
3156
3262
|
pan['root'].title(api.title)
|
3157
3263
|
pan['root'].restore_caption(api.name)
|
3158
|
-
pan['root'].
|
3159
|
-
|
3264
|
+
pan['root'].change_adapters_name(api.name)
|
3265
|
+
Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>pan['sons'][api.name].extension_name, 'frame_name'=>pan['sons'][api.name].name))
|
3160
3266
|
# changed
|
3161
3267
|
# notify_observers('RAISE', api.name)
|
3162
3268
|
}
|
@@ -3177,12 +3283,12 @@ class ArcadiaLayout
|
|
3177
3283
|
'raisecmd'=>proc{
|
3178
3284
|
pan['root'].title(_title)
|
3179
3285
|
pan['root'].restore_caption(_name)
|
3180
|
-
pan['root'].
|
3286
|
+
pan['root'].change_adapters_name(_name)
|
3181
3287
|
Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>_ffw.extension_name, 'frame_name'=>_ffw.name))
|
3182
3288
|
# changed
|
3183
3289
|
# notify_observers('RAISE', _name)
|
3184
3290
|
}
|
3185
|
-
|
3291
|
+
)
|
3186
3292
|
if _adapter
|
3187
3293
|
adapter = _adapter
|
3188
3294
|
else
|
@@ -3201,7 +3307,7 @@ class ArcadiaLayout
|
|
3201
3307
|
else
|
3202
3308
|
_ffw.domain = nil
|
3203
3309
|
process_frame(_ffw)
|
3204
|
-
|
3310
|
+
return TkFrameAdapter.new(self.root)
|
3205
3311
|
#
|
3206
3312
|
# Arcadia.dialog(self,
|
3207
3313
|
# 'type'=>'ok',
|
@@ -3221,6 +3327,7 @@ class ArcadiaLayout
|
|
3221
3327
|
_name = _ffw.name
|
3222
3328
|
@panels[_domain_name]['sons'][_name].hinner_frame.detach_frame
|
3223
3329
|
if delete_wrapper
|
3330
|
+
@wrappers[_name].root.clear_transient_adapters(_name)
|
3224
3331
|
@wrappers.delete(_name).hinner_frame.destroy
|
3225
3332
|
else
|
3226
3333
|
@wrappers[_name].domain=nil
|
@@ -3235,7 +3342,7 @@ class ArcadiaLayout
|
|
3235
3342
|
w.attach_frame(@panels[_domain_name]['root'].frame)
|
3236
3343
|
@panels[_domain_name]['root'].title(t)
|
3237
3344
|
@panels[_domain_name]['root'].restore_caption(n)
|
3238
|
-
@panels[_domain_name]['root'].
|
3345
|
+
@panels[_domain_name]['root'].change_adapters_name(n)
|
3239
3346
|
|
3240
3347
|
@panels[_domain_name]['notebook'].destroy
|
3241
3348
|
@panels[_domain_name]['notebook']=nil
|
@@ -3248,7 +3355,7 @@ class ArcadiaLayout
|
|
3248
3355
|
#p "unregister #{_name} ------> 5"
|
3249
3356
|
elsif @panels[_domain_name]['sons'].length == 0
|
3250
3357
|
@panels[_domain_name]['root'].title('')
|
3251
|
-
@panels[_domain_name]['root'].
|
3358
|
+
@panels[_domain_name]['root'].top_text_clear
|
3252
3359
|
end
|
3253
3360
|
build_invert_menu if refresh_menu
|
3254
3361
|
end
|
@@ -3279,7 +3386,7 @@ class ArcadiaLayout
|
|
3279
3386
|
@panels[_domain_name]['root'].frame
|
3280
3387
|
end
|
3281
3388
|
|
3282
|
-
def
|
3389
|
+
def add_float_frame(_args=nil)
|
3283
3390
|
if _args.nil?
|
3284
3391
|
_args = {'x'=>10, 'y'=>10, 'width'=>100, 'height'=>100}
|
3285
3392
|
end
|
@@ -3456,6 +3563,7 @@ end
|
|
3456
3563
|
require 'tk/clipboard'
|
3457
3564
|
|
3458
3565
|
class FocusEventManager
|
3566
|
+
attr_reader :last_focus_widget
|
3459
3567
|
def initialize
|
3460
3568
|
Arcadia.attach_listener(self, FocusEvent)
|
3461
3569
|
Arcadia.attach_listener(self, InputEvent)
|