3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
|
# File 'lib/a-tkcommons.rb', line 3876
def build_gui
@font = Arcadia.conf('edit.font')
@font_bold = "#{Arcadia.conf('edit.font')} bold"
@font_metrics = TkFont.new(@font).metrics
@font_metrics_bold = TkFont.new(@font_bold).metrics
if !@label.nil?
Arcadia.wf.label(self, 'text' => @label).pack('side' =>'left')
end
@string_text = TkText.new(self, Arcadia.style('text').update({"height"=>'1',"highlightcolor"=>Arcadia.conf('panel.background'), "bg"=>Arcadia.conf('panel.background')})).pack('side' =>'left','padx'=>5, 'pady'=>5, 'fill'=>'x', 'expand'=>'1')
@string_text.bind_append("Enter", proc{ @string_text.set_insert("end")})
@tag_selected = "link_selected"
@string_text.tag_configure(@tag_selected,'borderwidth'=>0, 'relief'=>'flat', 'underline'=>true)
@string_text.tag_bind(@tag_selected,"ButtonRelease-1", proc{
self.release
} )
@string_text.tag_bind(@tag_selected,"Enter", proc{@string_text.configure('cursor'=> 'hand2')})
@string_text.tag_bind(@tag_selected,"Leave", proc{@string_text.configure('cursor'=> @cursor)})
_self=self
@string_text.bind_append('KeyPress', "%K"){|_keysym|
case _keysym
when "Return"
_self.release
end
}
@string_text.bind_append('KeyRelease', "%K"){|_keysym|
case _keysym
when 'Escape','Tab', "Return"
else
@string_text.tag_remove(@tag_selected,'1.0','end')
@string_text.tag_add(@tag_selected ,'1.0','end')
end
}
@string_text.bind_append("Control-KeyPress", "%K"){|_keysym|
case _keysym
when 'd'
_self.close
Tk.callback_break
end
}
@close_button = Arcadia.wf.toolbutton(self){
command proc{_self.close}
image Arcadia.image_res(CLOSE_FRAME_GIF)
}.pack('side' =>'right','padx'=>5, 'pady'=>0)
end
|