arcadia 0.9.0 → 0.9.1
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 +8 -8
- data/conf/arcadia.conf +9 -1
- data/conf/arcadia.res.rb +45 -11
- data/conf/theme-dark.conf +2 -1
- data/conf/theme-dark.res.rb +21 -4
- data/ext/ae-editor/ae-editor.conf +18 -74
- data/ext/ae-editor/ae-editor.rb +335 -159
- data/ext/ae-editor/lib/rbeautify.rb +222 -0
- data/ext/ae-rad/ae-rad-palette.rb +1 -1
- data/ext/ae-rad/ae-rad.conf +1 -1
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +21 -9
- data/lib/a-commons.rb +8 -3
- data/lib/a-contracts.rb +2 -0
- data/lib/a-core.rb +55 -272
- data/lib/a-tkcommons.rb +294 -188
- metadata +4 -3
data/lib/a-tkcommons.rb
CHANGED
@@ -256,33 +256,52 @@ class TkFrameAdapter < TkFrame
|
|
256
256
|
@frame.bind_remove("Unmap")
|
257
257
|
end
|
258
258
|
@frame = nil
|
259
|
-
self.
|
259
|
+
self.unmap
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
263
|
+
def unmap
|
264
|
+
if is_place?
|
265
|
+
self.unplace
|
266
|
+
elsif is_pack?
|
267
|
+
self.unpack
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
263
271
|
def attach_frame(_frame)
|
264
272
|
@frame = _frame
|
273
|
+
@frame_manager = TkWinfo.manager(@frame)
|
265
274
|
refresh
|
266
275
|
if @movable
|
267
|
-
@frame.bind_append("Configure",proc{
|
276
|
+
@frame.bind_append("Configure",proc{refresh})
|
268
277
|
@frame.bind_append("Map",proc{refresh})
|
269
|
-
@frame.bind_append("Unmap",proc{
|
278
|
+
@frame.bind_append("Unmap",proc{unmap if TkWinfo.mapped?(@frame)})
|
270
279
|
end
|
271
280
|
self
|
272
281
|
end
|
273
282
|
|
283
|
+
def is_place?
|
284
|
+
@frame_manager == 'place' || @frame_manager.nil? || @frame_manager == ''
|
285
|
+
end
|
286
|
+
|
287
|
+
def is_pack?
|
288
|
+
@frame_manager == 'pack'
|
289
|
+
end
|
274
290
|
|
275
291
|
def refresh(_x=0, _y=0)
|
276
|
-
|
292
|
+
if is_place?
|
293
|
+
place('in'=>@frame, 'x'=>_x, 'y'=>_y, 'relheight'=> 1, 'relwidth'=>1, 'bordermode'=>'outside')
|
294
|
+
elsif is_pack?
|
295
|
+
pack('in'=>@frame, 'fill'=>'both', 'expand'=>true)
|
296
|
+
end
|
277
297
|
end
|
278
298
|
|
279
299
|
end
|
280
300
|
|
281
|
-
|
282
301
|
class AGTkSplittedFrames < TkFrameAdapter
|
283
302
|
attr_reader :frame1
|
284
303
|
attr_reader :frame2
|
285
|
-
def initialize(parent=nil, frame=nil, length=10, slen=5, keys=nil)
|
304
|
+
def initialize(parent=nil, frame=nil, length=10, slen=5, user_control=true, keys=nil)
|
286
305
|
if keys.nil?
|
287
306
|
keys = Hash.new
|
288
307
|
end
|
@@ -290,6 +309,7 @@ class AGTkSplittedFrames < TkFrameAdapter
|
|
290
309
|
super(parent, keys)
|
291
310
|
@parent = parent
|
292
311
|
@slen = slen
|
312
|
+
@user_control = user_control
|
293
313
|
if frame
|
294
314
|
self.attach_frame(frame)
|
295
315
|
end
|
@@ -314,8 +334,8 @@ end
|
|
314
334
|
|
315
335
|
class AGTkVSplittedFrames < AGTkSplittedFrames
|
316
336
|
attr_reader :left_frame, :right_frame, :splitter_frame
|
317
|
-
def initialize(parent=nil, frame=nil, width=10, slen=5, perc=false, keys=nil)
|
318
|
-
super(parent, frame, width, slen, keys)
|
337
|
+
def initialize(parent=nil, frame=nil, width=10, slen=5, perc=false, user_control=true, keys=nil)
|
338
|
+
super(parent, frame, width, slen, user_control, keys)
|
319
339
|
@left_frame = TkFrame.new(self, Arcadia.style('panel'))
|
320
340
|
@frame1 = @left_frame
|
321
341
|
if perc
|
@@ -351,97 +371,44 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
|
|
351
371
|
'bordermode' => 'inside',
|
352
372
|
'width' => @slen
|
353
373
|
)
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
#
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
# @b_right.place('x'=>_x,'y'=>_y+25,'border'=>'outside')
|
390
|
-
# @b_left.raise
|
391
|
-
# @b_right.raise
|
392
|
-
# @@last_b_left = @b_left
|
393
|
-
# @@last_b_right = @b_right
|
394
|
-
# if @thread_unplace
|
395
|
-
# @thread_unplace.kill
|
396
|
-
# end
|
397
|
-
# @thread_unplace= Thread.new {
|
398
|
-
# sleep(5)
|
399
|
-
# @proc_unplace.call
|
400
|
-
# kill
|
401
|
-
# }
|
402
|
-
# end
|
403
|
-
# }
|
404
|
-
#
|
405
|
-
# @splitter_frame.bind_append(
|
406
|
-
# 'ButtonPress-1',
|
407
|
-
# proc{|x,y|
|
408
|
-
# @thread_place= Thread.new {
|
409
|
-
# @proc_place.call(x,y)
|
410
|
-
# }
|
411
|
-
# }, "%x %y")
|
412
|
-
#-----
|
413
|
-
#-----
|
414
|
-
_xbutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
415
|
-
background '#4966d7'
|
416
|
-
}
|
417
|
-
_xbutton.place(
|
418
|
-
'x' => 0,
|
419
|
-
'y' => 0,
|
420
|
-
'relwidth' => 1,
|
421
|
-
'bordermode' => 'outside',
|
422
|
-
'height' => 20
|
423
|
-
)
|
424
|
-
_xbutton.bind_append(
|
425
|
-
"ButtonPress-1",
|
426
|
-
proc{hide_left}
|
427
|
-
)
|
428
|
-
_ybutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
429
|
-
background '#118124'
|
430
|
-
}
|
431
|
-
_ybutton.place(
|
432
|
-
'x' => 0,
|
433
|
-
'y' => 21,
|
434
|
-
'bordermode' => 'outside',
|
435
|
-
'height' => 20,
|
436
|
-
'relwidth' => 1
|
437
|
-
)
|
438
|
-
_ybutton.bind_append(
|
439
|
-
"ButtonPress-1",
|
440
|
-
proc{hide_right}
|
441
|
-
)
|
374
|
+
|
375
|
+
if @user_control
|
376
|
+
@splitter_frame.bind_append(
|
377
|
+
"ButtonRelease-1",
|
378
|
+
proc{do_resize}
|
379
|
+
)
|
380
|
+
_xbutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
381
|
+
background '#4966d7'
|
382
|
+
}
|
383
|
+
_xbutton.place(
|
384
|
+
'x' => 0,
|
385
|
+
'y' => 0,
|
386
|
+
'relwidth' => 1,
|
387
|
+
'bordermode' => 'outside',
|
388
|
+
'height' => 20
|
389
|
+
)
|
390
|
+
_xbutton.bind_append(
|
391
|
+
"ButtonPress-1",
|
392
|
+
proc{hide_left}
|
393
|
+
)
|
394
|
+
_ybutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
395
|
+
background '#118124'
|
396
|
+
}
|
397
|
+
_ybutton.place(
|
398
|
+
'x' => 0,
|
399
|
+
'y' => 21,
|
400
|
+
'bordermode' => 'outside',
|
401
|
+
'height' => 20,
|
402
|
+
'relwidth' => 1
|
403
|
+
)
|
404
|
+
_ybutton.bind_append(
|
405
|
+
"ButtonPress-1",
|
406
|
+
proc{hide_right}
|
407
|
+
)
|
408
|
+
end
|
442
409
|
#-----
|
443
410
|
#-----
|
444
|
-
@splitter_frame_obj = AGTkObjPlace.new(@splitter_frame, 'x')
|
411
|
+
@splitter_frame_obj = AGTkObjPlace.new(@splitter_frame, 'x', nil, @user_control)
|
445
412
|
@splitter_frame_obj.width = @slen
|
446
413
|
@splitter_frame_obj.height = 0
|
447
414
|
@splitter_frame_obj.relwidth = 0
|
@@ -521,6 +488,18 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
|
|
521
488
|
@left_frame_obj.w == 0
|
522
489
|
end
|
523
490
|
|
491
|
+
def show_left
|
492
|
+
if @state=='right'
|
493
|
+
_w = @last
|
494
|
+
@state = 'middle'
|
495
|
+
@right_frame_obj.width = - _w - @slen
|
496
|
+
@right_frame_obj.amove(_w + @slen,0)
|
497
|
+
@splitter_frame_obj.amove(_w,0)
|
498
|
+
@left_frame_obj.width = _w
|
499
|
+
@left_frame_obj.go(_w,0)
|
500
|
+
end
|
501
|
+
end
|
502
|
+
|
524
503
|
def hide_right
|
525
504
|
if (@state=='right')
|
526
505
|
_w = @last
|
@@ -571,8 +550,8 @@ end
|
|
571
550
|
|
572
551
|
class AGTkOSplittedFrames < AGTkSplittedFrames
|
573
552
|
attr_reader :top_frame, :bottom_frame, :splitter_frame
|
574
|
-
def initialize(parent=nil, frame=nil, height=10, slen=5, perc=false, keys=nil)
|
575
|
-
super(parent, frame, height, slen, keys)
|
553
|
+
def initialize(parent=nil, frame=nil, height=10, slen=5, perc=false, user_control=true, keys=nil)
|
554
|
+
super(parent, frame, height, slen, user_control, keys)
|
576
555
|
@top_frame = TkFrame.new(self, Arcadia.style('panel')){
|
577
556
|
# relief 'flat'
|
578
557
|
}
|
@@ -607,15 +586,7 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
|
|
607
586
|
'bordermode' => 'inside',
|
608
587
|
'height' => @slen
|
609
588
|
)
|
610
|
-
@
|
611
|
-
"B1-Motion",
|
612
|
-
proc{@splitter_frame.raise}
|
613
|
-
)
|
614
|
-
@splitter_frame.bind_append(
|
615
|
-
"ButtonRelease-1",
|
616
|
-
proc{do_resize}
|
617
|
-
)
|
618
|
-
@splitter_frame_obj = AGTkObjPlace.new(@splitter_frame, 'y')
|
589
|
+
@splitter_frame_obj = AGTkObjPlace.new(@splitter_frame, 'y', nil, user_control)
|
619
590
|
@splitter_frame_obj.width = 0
|
620
591
|
@splitter_frame_obj.height = @slen
|
621
592
|
@splitter_frame_obj.relwidth = 1
|
@@ -640,34 +611,44 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
|
|
640
611
|
@bottom_frame_obj.height = -y
|
641
612
|
@bottom_frame_obj.relwidth = 1
|
642
613
|
@bottom_frame_obj.relheight = 1
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
614
|
+
if @user_control
|
615
|
+
@splitter_frame.bind_append(
|
616
|
+
"B1-Motion",
|
617
|
+
proc{@splitter_frame.raise}
|
618
|
+
)
|
619
|
+
@splitter_frame.bind_append(
|
620
|
+
"ButtonRelease-1",
|
621
|
+
proc{do_resize}
|
622
|
+
)
|
623
|
+
_xbutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
624
|
+
background '#4966d7'
|
625
|
+
}
|
626
|
+
_xbutton.place(
|
627
|
+
'x' => 0,
|
628
|
+
'y' => 0,
|
629
|
+
'relheight' => 1,
|
630
|
+
'bordermode' => 'outside',
|
631
|
+
'width' => 20
|
632
|
+
)
|
633
|
+
_xbutton.bind_append(
|
634
|
+
"ButtonPress-1",
|
635
|
+
proc{hide_top}
|
636
|
+
)
|
637
|
+
_ybutton = TkButton.new(@splitter_frame, Arcadia.style('toolbarbutton')){
|
638
|
+
background '#118124'
|
639
|
+
}
|
640
|
+
_ybutton.place(
|
641
|
+
'x' => 21,
|
642
|
+
'y' => 0,
|
643
|
+
'bordermode' => 'outside',
|
644
|
+
'width' => 20,
|
645
|
+
'relheight' => 1
|
646
|
+
)
|
647
|
+
_ybutton.bind_append(
|
648
|
+
"ButtonPress-1",
|
649
|
+
proc{hide_bottom}
|
650
|
+
)
|
651
|
+
end
|
671
652
|
@state = 'middle'
|
672
653
|
yield(self) if block_given?
|
673
654
|
end
|
@@ -776,8 +757,10 @@ class TkBaseTitledFrame < TkFrame
|
|
776
757
|
#background '#303b50'
|
777
758
|
background Arcadia.conf('titlelabel.background')
|
778
759
|
}.pack('side'=> 'right','anchor'=> 'w')
|
760
|
+
|
779
761
|
@buttons = Hash.new
|
780
762
|
@menu_buttons = Hash.new
|
763
|
+
@last_for_frame = Hash.new
|
781
764
|
self.head_buttons
|
782
765
|
end
|
783
766
|
|
@@ -785,45 +768,84 @@ class TkBaseTitledFrame < TkFrame
|
|
785
768
|
return TkFrame.new(self,Arcadia.style('panel')).place('x'=>0, 'y'=>@title_height,'height'=>-@title_height,'relheight'=>1, 'relwidth'=>1)
|
786
769
|
end
|
787
770
|
|
788
|
-
def
|
789
|
-
|
771
|
+
def add_fixed_button(_label,_proc=nil,_image=nil, _side= 'right')
|
772
|
+
__add_button(_label,_proc,_image, _side,@button_frame)
|
773
|
+
end
|
774
|
+
|
775
|
+
def add_fixed_menu_button(_name='default',_image=nil, _side= 'right', _args=nil)
|
776
|
+
__add_menu_button(_name, _image, _side, _args, @button_frame)
|
777
|
+
end
|
778
|
+
|
779
|
+
def add_fixed_sep(_width=0)
|
780
|
+
__add_sep(_width, @button_frame)
|
781
|
+
end
|
782
|
+
|
783
|
+
def __add_button(_label,_proc=nil,_image=nil, _side= 'right', _frame=nil)
|
784
|
+
return if _frame.nil?
|
785
|
+
last = @last_for_frame[_frame]
|
786
|
+
@last_for_frame[_frame] = TkButton.new(_frame, Arcadia.style('titletoolbarbutton')){
|
790
787
|
text _label if _label
|
791
788
|
image TkPhotoImage.new('dat' => _image) if _image
|
792
|
-
#relief 'flat'
|
793
789
|
font 'helvetica 8 bold'
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
790
|
+
padx 0
|
791
|
+
pady 0
|
792
|
+
if last
|
793
|
+
pack('side'=> _side,'anchor'=> 'e', 'after'=>last)
|
794
|
+
else
|
795
|
+
pack('side'=> _side,'anchor'=> 'e')
|
796
|
+
end
|
798
797
|
bind('1',_proc) if _proc
|
799
798
|
}
|
800
799
|
end
|
800
|
+
private :__add_button
|
801
801
|
|
802
|
-
def
|
803
|
-
|
804
|
-
|
802
|
+
def __add_menu_button(_name='default',_image=nil, _side= 'right', _args=nil, _frame=nil)
|
803
|
+
return if _frame.nil?
|
804
|
+
args = Arcadia.style('titlelabel')
|
805
|
+
args.update(_args) if _args
|
806
|
+
last = @last_for_frame[_frame]
|
807
|
+
@last_for_frame[_frame] = @menu_buttons[_name] = TkMenuButton.new(_frame, args){|mb|
|
805
808
|
menu TkMenu.new(mb, Arcadia.style('titlemenu'))
|
806
|
-
# menu TkMenu.new(:parent=>mb, Arcadia.style('titlemenu'))
|
807
|
-
# menu TkMenu.new(:parent=>mb,
|
808
|
-
# :tearoff=>0,
|
809
|
-
# :background=>Arcadia.style('titlelabel')['background'],
|
810
|
-
# :foreground=>Arcadia.style('titlelabel')['foreground']
|
811
|
-
# )
|
812
809
|
if _image
|
810
|
+
indicatoron false
|
813
811
|
image TkPhotoImage.new('dat' => _image)
|
812
|
+
else
|
813
|
+
indicatoron true
|
814
814
|
end
|
815
815
|
padx 0
|
816
|
-
|
816
|
+
if last
|
817
|
+
pack('side'=> _side,'anchor'=> 'e', 'after'=>last)
|
818
|
+
else
|
819
|
+
pack('side'=> _side,'anchor'=> 'e')
|
820
|
+
end
|
817
821
|
}
|
818
822
|
@menu_buttons[_name]
|
819
823
|
end
|
824
|
+
private :__add_menu_button
|
825
|
+
|
826
|
+
|
827
|
+
def __add_sep(_width=0, _frame=nil)
|
828
|
+
return if _width <= 0 || _frame.nil?
|
829
|
+
_background=_frame.background
|
830
|
+
last = @last_for_frame[_frame]
|
831
|
+
@last_for_frame[_frame] = TkLabel.new(_frame){||
|
832
|
+
text ''
|
833
|
+
background _background
|
834
|
+
if last
|
835
|
+
pack('side'=> 'right','anchor'=> 'e', 'ipadx'=>_width, 'after'=>last)
|
836
|
+
else
|
837
|
+
pack('side'=> 'right','anchor'=> 'e', 'ipadx'=>_width)
|
838
|
+
end
|
839
|
+
}
|
840
|
+
end
|
841
|
+
private :__add_sep
|
820
842
|
|
821
843
|
def menu_button(_name='default')
|
822
844
|
@menu_buttons[_name]
|
823
845
|
end
|
824
846
|
|
825
847
|
def head_buttons
|
826
|
-
@bmaxmin =
|
848
|
+
@bmaxmin = add_fixed_button('[ ]',proc{resize}, W_MAX_GIF)
|
827
849
|
end
|
828
850
|
|
829
851
|
def visible?
|
@@ -831,75 +853,98 @@ class TkBaseTitledFrame < TkFrame
|
|
831
853
|
end
|
832
854
|
end
|
833
855
|
|
834
|
-
|
835
|
-
|
836
856
|
class TkTitledFrame < TkBaseTitledFrame
|
837
857
|
attr_accessor :frame
|
838
858
|
attr_reader :top
|
839
859
|
attr_reader :parent
|
840
|
-
|
841
860
|
def initialize(parent=nil, title=nil, img=nil , keys=nil)
|
842
861
|
super(parent, keys)
|
843
862
|
@state = 'normal'
|
844
|
-
title
|
845
|
-
@
|
863
|
+
@title = title
|
864
|
+
@img = img
|
865
|
+
@left_label = create_left_label
|
866
|
+
@right_label = create_right_label
|
867
|
+
@right_labels_text = Hash.new
|
868
|
+
@ap = Array.new
|
869
|
+
@apx = Array.new
|
870
|
+
@apy = Array.new
|
871
|
+
@apw = Array.new
|
872
|
+
@aph = Array.new
|
873
|
+
end
|
874
|
+
|
875
|
+
def create_left_label
|
876
|
+
__create_left_label(@top)
|
877
|
+
end
|
878
|
+
|
879
|
+
def create_right_label
|
880
|
+
__create_right_label(@top)
|
881
|
+
end
|
882
|
+
|
883
|
+
def __create_left_label(_frame)
|
884
|
+
@title.nil??_text_title ='':_text_title = @title+' :: '
|
885
|
+
_img=@img
|
886
|
+
TkLabel.new(_frame, Arcadia.style('titlelabel')){
|
846
887
|
text _text_title
|
847
888
|
anchor 'w'
|
848
889
|
compound 'left'
|
849
|
-
image TkAllPhotoImage.new('file' =>
|
890
|
+
image TkAllPhotoImage.new('file' => _img) if _img
|
850
891
|
pack('side'=> 'left','anchor'=> 'e')
|
851
892
|
}
|
852
|
-
|
893
|
+
end
|
894
|
+
|
895
|
+
def __create_right_label(_frame)
|
896
|
+
TkLabel.new(_frame, Arcadia.style('titlelabel')){
|
853
897
|
anchor 'w'
|
854
898
|
font "#{Arcadia.conf('titlelabel.font')} italic"
|
855
899
|
foreground Arcadia.conf('titlecontext.foreground')
|
856
900
|
compound 'left'
|
857
901
|
pack('side'=> 'left','anchor'=> 'e')
|
858
902
|
}
|
859
|
-
|
860
|
-
@ap = Array.new
|
861
|
-
@apx = Array.new
|
862
|
-
@apy = Array.new
|
863
|
-
@apw = Array.new
|
864
|
-
@aph = Array.new
|
865
903
|
end
|
866
|
-
|
904
|
+
|
867
905
|
def title(_text=nil)
|
868
906
|
if _text.nil?
|
869
907
|
return @title
|
870
908
|
else
|
871
909
|
@title=_text
|
872
910
|
if _text.strip.length == 0
|
873
|
-
@
|
911
|
+
@left_label.text('')
|
874
912
|
else
|
875
|
-
@
|
913
|
+
@left_label.text(_text+'::')
|
876
914
|
end
|
877
915
|
end
|
878
916
|
end
|
879
917
|
|
880
918
|
def top_text(_text=nil)
|
881
919
|
if _text.nil?
|
882
|
-
return @
|
920
|
+
return @right_label.text
|
883
921
|
else
|
884
|
-
@
|
922
|
+
@right_label.text(_text)
|
885
923
|
end
|
886
924
|
end
|
887
925
|
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
def
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
926
|
+
def save_caption(_name, _caption)
|
927
|
+
@right_labels_text[_name] = _caption
|
928
|
+
end
|
929
|
+
|
930
|
+
def last_caption(_name)
|
931
|
+
@right_labels_text[_name]
|
932
|
+
end
|
933
|
+
|
934
|
+
def restore_caption(_name)
|
935
|
+
if @right_labels_text[_name]
|
936
|
+
top_text(@right_labels_text[_name])
|
937
|
+
else
|
938
|
+
top_text('')
|
939
|
+
end
|
898
940
|
end
|
899
941
|
|
942
|
+
# def top_text(_text)
|
943
|
+
# @right_label.text(_text)
|
944
|
+
# end
|
900
945
|
|
901
946
|
def head_buttons
|
902
|
-
@bmaxmin =
|
947
|
+
@bmaxmin = add_fixed_button('[ ]',proc{resize}, W_MAX_GIF)
|
903
948
|
#@bmaxmin = add_button('[ ]',proc{resize}, EXPAND_GIF)
|
904
949
|
end
|
905
950
|
|
@@ -1064,6 +1109,66 @@ end
|
|
1064
1109
|
#
|
1065
1110
|
#end
|
1066
1111
|
|
1112
|
+
class TkTitledFrameAdapter < TkTitledFrame
|
1113
|
+
attr_reader :transient_frame_adapter
|
1114
|
+
|
1115
|
+
def initialize(parent=nil, title=nil, img=nil , keys=nil)
|
1116
|
+
super(parent, title, img, keys)
|
1117
|
+
@transient_frame = TkFrame.new(@button_frame){
|
1118
|
+
background Arcadia.conf('titlelabel.background')
|
1119
|
+
padx 0
|
1120
|
+
pady 0
|
1121
|
+
pack('side'=> "right",'anchor'=> 'e','fill'=>'both', 'expand'=>true)
|
1122
|
+
}
|
1123
|
+
@transient_frame_adapter = Hash.new
|
1124
|
+
end
|
1125
|
+
|
1126
|
+
def forge_transient_adapter(_name)
|
1127
|
+
if @transient_frame_adapter[_name].nil?
|
1128
|
+
@transient_frame_adapter[_name] = TkFrameAdapter.new(Arcadia.layout.root,
|
1129
|
+
Arcadia.style('frame').update({'background'=> Arcadia.conf('titlelabel.background')}))
|
1130
|
+
__attach_adapter(@transient_frame_adapter[_name])
|
1131
|
+
@transient_frame_adapter[_name].raise
|
1132
|
+
end
|
1133
|
+
@transient_frame_adapter[_name]
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
def __attach_adapter(_adapter)
|
1137
|
+
@last_attached_adapter.detach_frame if @last_attached_adapter
|
1138
|
+
_adapter.attach_frame(@transient_frame)
|
1139
|
+
@last_attached_adapter = _adapter
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
def change_adapter(_name, _adapter)
|
1143
|
+
@transient_frame_adapter[_name] = _adapter
|
1144
|
+
@transient_frame_adapter[_name].detach_frame
|
1145
|
+
__attach_adapter(@transient_frame_adapter[_name])
|
1146
|
+
@transient_frame_adapter[_name].raise
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
def change_adapter_name(_name)
|
1150
|
+
__attach_adapter(forge_transient_adapter(_name))
|
1151
|
+
@transient_frame_adapter[_name].raise
|
1152
|
+
end
|
1153
|
+
|
1154
|
+
def add_button(_sender_name, _label,_proc=nil,_image=nil, _side= 'right')
|
1155
|
+
forge_transient_adapter(_sender_name)
|
1156
|
+
__add_button(_label,_proc,_image, _side, @transient_frame_adapter[_sender_name])
|
1157
|
+
end
|
1158
|
+
|
1159
|
+
def add_menu_button(_sender_name, _name='default',_image=nil, _side= 'right', _args=nil)
|
1160
|
+
forge_transient_adapter(_sender_name)
|
1161
|
+
__add_menu_button(_name, _image, _side, _args, @transient_frame_adapter[_sender_name])
|
1162
|
+
end
|
1163
|
+
|
1164
|
+
def add_sep(_sender_name, _width=0)
|
1165
|
+
forge_transient_adapter(_sender_name)
|
1166
|
+
__add_sep(_width, @transient_frame_adapter[_sender_name])
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
end
|
1170
|
+
|
1171
|
+
|
1067
1172
|
class TkTitledScrollFrame < TkTitledFrame
|
1068
1173
|
|
1069
1174
|
def create_frame
|
@@ -1096,7 +1201,7 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
1096
1201
|
borderwidth 2
|
1097
1202
|
relief 'groove'
|
1098
1203
|
|
1099
|
-
@
|
1204
|
+
@right_label = TkLabel.new(@top, Arcadia.style('titlelabel')){
|
1100
1205
|
anchor 'w'
|
1101
1206
|
}.pack('fill'=>'x', 'side'=>'top')
|
1102
1207
|
#.place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1 ,'width'=>-20)
|
@@ -1105,7 +1210,7 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
1105
1210
|
text '-'
|
1106
1211
|
image TkPhotoImage.new('dat'=>EXPAND_LIGHT_GIF)
|
1107
1212
|
}.pack('side'=> 'right','anchor'=> 's')
|
1108
|
-
start_moving(@
|
1213
|
+
start_moving(@right_label, self)
|
1109
1214
|
start_moving(frame, self)
|
1110
1215
|
start_resizing(@resizing_label, self)
|
1111
1216
|
@grabbed = false
|
@@ -1120,11 +1225,11 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
1120
1225
|
end
|
1121
1226
|
|
1122
1227
|
def title(_text)
|
1123
|
-
@
|
1228
|
+
@right_label.text(_text)
|
1124
1229
|
end
|
1125
1230
|
|
1126
1231
|
def on_close=(_proc)
|
1127
|
-
|
1232
|
+
add_fixed_button('X', _proc, TAB_CLOSE_GIF)
|
1128
1233
|
end
|
1129
1234
|
|
1130
1235
|
def hide
|
@@ -1542,7 +1647,7 @@ module TkScrollableWidget
|
|
1542
1647
|
end
|
1543
1648
|
end
|
1544
1649
|
|
1545
|
-
def show(_x=0,_y=0,_border_mode='
|
1650
|
+
def show(_x=0,_y=0,_border_mode='inside')
|
1546
1651
|
@x=_x
|
1547
1652
|
@y=_y
|
1548
1653
|
@widget.place(
|
@@ -1554,6 +1659,7 @@ module TkScrollableWidget
|
|
1554
1659
|
'relwidth'=>1,
|
1555
1660
|
'bordermode'=>_border_mode
|
1556
1661
|
)
|
1662
|
+
@widget.raise
|
1557
1663
|
if @v_scroll_on
|
1558
1664
|
show_v_scroll(true)
|
1559
1665
|
end
|