779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
|
# File 'ext/ae-editor/ae-editor.rb', line 779
def initialize(_controller)
@controller = _controller
@panel = @controller.main_instance.frame(1).root.add_panel(@controller.main_instance.frame(1).name, "sync");
@cb_sync = TkCheckButton.new(@panel, Arcadia.style('checkbox').update('background'=>@panel.background)){
text 'Sync'
justify 'left'
indicatoron 0
offrelief 'flat'
image Arcadia.image_res(SYNC_GIF)
pack
}
Tk::BWidget::DynamicHelp::add(@cb_sync,
'text'=> Arcadia.text('ext.editor.button.link.hint'))
do_check = proc {
if @cb_sync.cget('onvalue')==@cb_sync.cget('variable').value.to_i
sync_on
else
sync_off
end
}
@sync = false
@cb_sync.command(do_check)
go_to_parent = proc{
e = @controller.active_instance.raised
if e
no = e.outline.last_opened
if no
e.outline.tree_exp.see(no)
else
_selected = e.outline.tree_exp.selected
if _selected && e.outline.tree_exp.exist?(_selected)
_parent = e.outline.tree_exp.parent(_selected)
if _parent && _parent != 'root'
e.outline.tree_exp.see(_parent)
else
e.outline.tree_exp.see(_selected)
end
end
end
end
}
@b_goto_p = @controller.main_instance.frame(1).root.add_button(@controller.main_instance.frame(1).name, Arcadia.text("ext.editor.button.up.hint"), go_to_parent, ARROW_UP_GIF)
end
|