arcadia 0.10.0 → 0.11.0
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 +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-tkcommons.rb
CHANGED
@@ -93,28 +93,28 @@ end
|
|
93
93
|
|
94
94
|
module TkMovable
|
95
95
|
def start_moving(_moving_obj=self, _moved_obj=self)
|
96
|
-
@
|
97
|
-
@
|
98
|
-
@
|
99
|
-
@
|
100
|
-
@
|
101
|
-
@
|
96
|
+
@x0_m = 0
|
97
|
+
@y0_m = 0
|
98
|
+
@moving_obj_m = _moving_obj
|
99
|
+
@moved_obj_m = _moved_obj
|
100
|
+
@moving_obj_m.bind_append("B1-Motion", proc{|x, y| moving_do_move_obj(x,y)},"%x %y")
|
101
|
+
@moving_obj_m.bind_append("ButtonPress-1", proc{|e| moving_do_press(e.x, e.y)})
|
102
102
|
end
|
103
103
|
|
104
104
|
def stop_moving
|
105
|
-
@
|
106
|
-
@
|
105
|
+
@moving_obj_m.bind_remove("B1-Motion")
|
106
|
+
@moving_obj_m.bind_remove("ButtonPress-1")
|
107
107
|
end
|
108
108
|
|
109
109
|
def moving_do_press(_x, _y)
|
110
|
-
@
|
111
|
-
@
|
110
|
+
@x0_m = _x
|
111
|
+
@y0_m = _y
|
112
112
|
end
|
113
113
|
|
114
114
|
def moving_do_move_obj(_x, _y)
|
115
|
-
_x = TkPlace.info(@
|
116
|
-
_y = TkPlace.info(@
|
117
|
-
@
|
115
|
+
_x = TkPlace.info(@moved_obj_m)['x'] + _x - @x0_m
|
116
|
+
_y = TkPlace.info(@moved_obj_m)['y'] + _y - @y0_m
|
117
|
+
@moved_obj_m.place('x'=>_x, 'y'=>_y)
|
118
118
|
end
|
119
119
|
|
120
120
|
end
|
@@ -123,32 +123,32 @@ module TkResizable
|
|
123
123
|
MIN_WIDTH = 50
|
124
124
|
MIN_HEIGHT = 50
|
125
125
|
def start_resizing(_moving_obj=self, _moved_obj=self)
|
126
|
-
@
|
127
|
-
@
|
128
|
-
@
|
129
|
-
@
|
130
|
-
@
|
131
|
-
@
|
126
|
+
@x0_r = 0
|
127
|
+
@y0_r = 0
|
128
|
+
@moving_obj_r = _moving_obj
|
129
|
+
@moved_obj_r = _moved_obj
|
130
|
+
@moving_obj_r.bind_append("B1-Motion", proc{|x, y| resizing_do_move_obj(x,y)},"%x %y")
|
131
|
+
@moving_obj_r.bind_append("ButtonPress-1", proc{|e| resizing_do_press(e.x, e.y)})
|
132
132
|
end
|
133
133
|
|
134
134
|
def stop_resizing
|
135
|
-
@
|
136
|
-
@
|
135
|
+
@moving_obj_r.bind_remove("B1-Motion")
|
136
|
+
@moving_obj_r.bind_remove("ButtonPress-1")
|
137
137
|
end
|
138
138
|
|
139
139
|
def resizing_do_press(_x, _y)
|
140
|
-
@
|
141
|
-
@
|
140
|
+
@x0_r = _x
|
141
|
+
@y0_r = _y
|
142
142
|
end
|
143
143
|
|
144
144
|
def resizing_do_move_obj(_x, _y)
|
145
|
-
_width0 = TkPlace.info(@
|
146
|
-
_height0 = TkPlace.info(@
|
147
|
-
_width = _width0 + _x - @
|
148
|
-
_height = _height0 + _y -@
|
145
|
+
_width0 = TkPlace.info(@moved_obj_r)['width']
|
146
|
+
_height0 = TkPlace.info(@moved_obj_r)['height']
|
147
|
+
_width = _width0 + _x - @x0_r
|
148
|
+
_height = _height0 + _y -@y0_r
|
149
149
|
_width = MIN_WIDTH if _width < MIN_WIDTH
|
150
150
|
_height = MIN_HEIGHT if _height < MIN_HEIGHT
|
151
|
-
@
|
151
|
+
@moved_obj_r.place('width'=>_width, 'height'=>_height)
|
152
152
|
end
|
153
153
|
|
154
154
|
end
|
@@ -262,7 +262,7 @@ class AGTkObjPlace
|
|
262
262
|
end
|
263
263
|
|
264
264
|
class TkFrameAdapter < TkFrame
|
265
|
-
include TkMovable
|
265
|
+
#include TkMovable
|
266
266
|
attr_reader :frame
|
267
267
|
def initialize(scope_parent=nil, args=nil)
|
268
268
|
newargs = Arcadia.style('panel')
|
@@ -271,22 +271,21 @@ class TkFrameAdapter < TkFrame
|
|
271
271
|
end
|
272
272
|
super(scope_parent, newargs)
|
273
273
|
@scope_parent = scope_parent
|
274
|
-
|
275
|
-
#ObjectSpace.define_finalizer(self, self.method(:detach_frame).to_proc)
|
274
|
+
#@movable = false
|
276
275
|
end
|
277
276
|
|
278
|
-
def add_moved_by(_obj)
|
279
|
-
@movable = true
|
280
|
-
start_moving(_obj, self)
|
281
|
-
end
|
277
|
+
# def add_moved_by(_obj)
|
278
|
+
# @movable = true
|
279
|
+
# start_moving(_obj, self)
|
280
|
+
# end
|
282
281
|
|
283
282
|
def detach_frame
|
284
283
|
if @frame
|
285
|
-
if @movable
|
286
|
-
@frame.bind_remove("Configure")
|
287
|
-
@frame.bind_remove("Map")
|
288
|
-
@frame.bind_remove("Unmap")
|
289
|
-
end
|
284
|
+
# if @movable
|
285
|
+
# @frame.bind_remove("Configure")
|
286
|
+
# @frame.bind_remove("Map")
|
287
|
+
# @frame.bind_remove("Unmap")
|
288
|
+
# end
|
290
289
|
@frame = nil
|
291
290
|
self.unmap
|
292
291
|
end
|
@@ -304,11 +303,11 @@ class TkFrameAdapter < TkFrame
|
|
304
303
|
@frame = _frame
|
305
304
|
@frame_manager = TkWinfo.manager(@frame)
|
306
305
|
refresh
|
307
|
-
if @movable
|
308
|
-
@frame.bind_append("Configure",proc{refresh})
|
309
|
-
@frame.bind_append("Map",proc{refresh})
|
310
|
-
@frame.bind_append("Unmap",proc{unmap if TkWinfo.mapped?(@frame)})
|
311
|
-
end
|
306
|
+
# if @movable
|
307
|
+
# @frame.bind_append("Configure",proc{refresh})
|
308
|
+
# @frame.bind_append("Map",proc{refresh})
|
309
|
+
# @frame.bind_append("Unmap",proc{unmap if TkWinfo.mapped?(@frame)})
|
310
|
+
# end
|
312
311
|
self
|
313
312
|
end
|
314
313
|
|
@@ -785,6 +784,12 @@ class TkBaseTitledFrame < TkFrame
|
|
785
784
|
}.place('x'=>0, 'y'=>0,'height'=>@title_height, 'relwidth'=>1)
|
786
785
|
#.pack('fill'=> 'x','ipady'=> @title_height, 'side'=>'top')
|
787
786
|
@frame = create_frame
|
787
|
+
|
788
|
+
@state_frame=TkFrame.new(@top){
|
789
|
+
#background '#303b50'
|
790
|
+
background Arcadia.conf('titlelabel.background')
|
791
|
+
}.pack('side'=> 'left','anchor'=> 'e')
|
792
|
+
|
788
793
|
@button_frame=TkFrame.new(@top){
|
789
794
|
#background '#303b50'
|
790
795
|
background Arcadia.conf('titlelabel.background')
|
@@ -794,6 +799,7 @@ class TkBaseTitledFrame < TkFrame
|
|
794
799
|
@menu_buttons = Hash.new
|
795
800
|
@panels = Hash.new
|
796
801
|
@last_for_frame = Hash.new
|
802
|
+
@last_for_state_frame = Hash.new
|
797
803
|
self.head_buttons
|
798
804
|
end
|
799
805
|
|
@@ -834,6 +840,8 @@ class TkBaseTitledFrame < TkFrame
|
|
834
840
|
end
|
835
841
|
bind('1',_proc) if _proc
|
836
842
|
}
|
843
|
+
Tk::BWidget::DynamicHelp::add(@last_for_frame[_frame], 'text'=>_label) if _label
|
844
|
+
@last_for_frame[_frame]
|
837
845
|
rescue RuntimeError => e
|
838
846
|
Arcadia.runtime_error(e)
|
839
847
|
end
|
@@ -902,6 +910,31 @@ class TkBaseTitledFrame < TkFrame
|
|
902
910
|
end
|
903
911
|
private :__add_sep
|
904
912
|
|
913
|
+
def __add_state_button(_label,_proc=nil,_image=nil, _side= 'left', _frame=nil)
|
914
|
+
return if _frame.nil?
|
915
|
+
begin
|
916
|
+
last = @last_for_state_frame[_frame]
|
917
|
+
@last_for_state_frame[_frame] = TkButton.new(_frame, Arcadia.style('titletoolbarbutton')){
|
918
|
+
text _label if _label
|
919
|
+
image Arcadia.image_res(_image) if _image
|
920
|
+
font 'helvetica 8 bold'
|
921
|
+
padx 0
|
922
|
+
pady 0
|
923
|
+
if last
|
924
|
+
pack('side'=> _side,'anchor'=> 'w', 'after'=>last)
|
925
|
+
else
|
926
|
+
pack('side'=> _side,'anchor'=> 'w')
|
927
|
+
end
|
928
|
+
bind('1',_proc) if _proc
|
929
|
+
}
|
930
|
+
Tk::BWidget::DynamicHelp::add(@last_for_state_frame[_frame], 'text'=>_label) if _label
|
931
|
+
@last_for_state_frame[_frame]
|
932
|
+
rescue RuntimeError => e
|
933
|
+
Arcadia.runtime_error(e)
|
934
|
+
end
|
935
|
+
end
|
936
|
+
private :__add_state_button
|
937
|
+
|
905
938
|
def menu_button(_name='default')
|
906
939
|
@menu_buttons[_name]
|
907
940
|
end
|
@@ -927,6 +960,7 @@ class TkTitledFrame < TkBaseTitledFrame
|
|
927
960
|
@left_label = create_left_label
|
928
961
|
@right_label = create_right_label
|
929
962
|
@right_labels_text = Hash.new
|
963
|
+
@right_labels_image = Hash.new
|
930
964
|
@ap = Array.new
|
931
965
|
@apx = Array.new
|
932
966
|
@apy = Array.new
|
@@ -966,7 +1000,15 @@ class TkTitledFrame < TkBaseTitledFrame
|
|
966
1000
|
pack('side'=> 'left','anchor'=> 'e')
|
967
1001
|
}
|
968
1002
|
end
|
969
|
-
|
1003
|
+
|
1004
|
+
def shift_on
|
1005
|
+
@left_label.foreground(Arcadia.conf('titlelabel.foreground'))
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
def shift_off
|
1009
|
+
@left_label.foreground(Arcadia.conf('titlelabel.disabledforeground'))
|
1010
|
+
end
|
1011
|
+
|
970
1012
|
def title(_text=nil)
|
971
1013
|
if _text.nil?
|
972
1014
|
return @title
|
@@ -980,27 +1022,60 @@ class TkTitledFrame < TkBaseTitledFrame
|
|
980
1022
|
end
|
981
1023
|
end
|
982
1024
|
|
983
|
-
def
|
984
|
-
|
1025
|
+
def top_text_clear
|
1026
|
+
@right_label.configure('text'=>'', 'image'=>nil)
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
def top_text(_text=nil, _image=nil)
|
1030
|
+
if _text.nil? && _image.nil?
|
985
1031
|
return @right_label.text
|
986
|
-
|
1032
|
+
elsif !_text.nil? && _image.nil?
|
987
1033
|
@right_label.text(_text)
|
1034
|
+
else
|
1035
|
+
@right_label.configure('text'=>_text, 'image'=>_image)
|
988
1036
|
end
|
989
1037
|
end
|
990
1038
|
|
991
|
-
def
|
1039
|
+
def top_text_bind_append(_tkevent, _proc=nil)
|
1040
|
+
@right_label.bind_append(_tkevent, _proc)
|
1041
|
+
end
|
1042
|
+
|
1043
|
+
def top_text_bind_remove(_tkevent)
|
1044
|
+
@right_label.bind_remove(_tkevent)
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
def top_text_hint(_text=nil)
|
1048
|
+
if _text.nil?
|
1049
|
+
res = ''
|
1050
|
+
res = @right_label_hint_variable.value if defined?(@right_label_hint_variable)
|
1051
|
+
res
|
1052
|
+
else
|
1053
|
+
if !defined?(@right_label_hint_variable)
|
1054
|
+
@right_label_hint_variable = TkVariable.new
|
1055
|
+
Tk::BWidget::DynamicHelp::add(@right_label, 'variable'=>@right_label_hint_variable)
|
1056
|
+
end
|
1057
|
+
@right_label_hint_variable.value=_text
|
1058
|
+
end
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
def save_caption(_name, _caption, _image=nil)
|
992
1062
|
@right_labels_text[_name] = _caption
|
1063
|
+
@right_labels_image[_name] = _image
|
993
1064
|
end
|
994
1065
|
|
995
1066
|
def last_caption(_name)
|
996
1067
|
@right_labels_text[_name]
|
997
1068
|
end
|
998
1069
|
|
1070
|
+
def last_caption_image(_name)
|
1071
|
+
@right_labels_image[_name]
|
1072
|
+
end
|
1073
|
+
|
999
1074
|
def restore_caption(_name)
|
1000
1075
|
if @right_labels_text[_name]
|
1001
|
-
top_text(@right_labels_text[_name])
|
1076
|
+
top_text(@right_labels_text[_name], @right_labels_image[_name])
|
1002
1077
|
else
|
1003
|
-
|
1078
|
+
top_text_clear
|
1004
1079
|
end
|
1005
1080
|
end
|
1006
1081
|
|
@@ -1039,7 +1114,8 @@ class TkTitledFrame < TkBaseTitledFrame
|
|
1039
1114
|
if @state == 'normal'
|
1040
1115
|
p = TkWinfo.parent(self)
|
1041
1116
|
while (p != nil) && (TkWinfo.manager(p)=='place')
|
1042
|
-
|
1117
|
+
Arcadia.dialog(self, 'msg'=>p.to_s)
|
1118
|
+
#Tk.messageBox('message'=>p.to_s)
|
1043
1119
|
@ap << p
|
1044
1120
|
@apx << TkPlace.info(p)['x']
|
1045
1121
|
@apy << TkPlace.info(p)['y']
|
@@ -1179,60 +1255,122 @@ class TkTitledFrameAdapter < TkTitledFrame
|
|
1179
1255
|
|
1180
1256
|
def initialize(parent=nil, title=nil, img=nil , keys=nil)
|
1181
1257
|
super(parent, title, img, keys)
|
1182
|
-
@
|
1258
|
+
@transient_action_frame = TkFrame.new(@button_frame){
|
1183
1259
|
background Arcadia.conf('titlelabel.background')
|
1184
1260
|
padx 0
|
1185
1261
|
pady 0
|
1186
1262
|
pack('side'=> "right",'anchor'=> 'e','fill'=>'both', 'expand'=>true)
|
1187
1263
|
}
|
1264
|
+
@transient_state_frame = TkFrame.new(@state_frame){
|
1265
|
+
background Arcadia.conf('titlelabel.background')
|
1266
|
+
padx 0
|
1267
|
+
pady 0
|
1268
|
+
pack('side'=> "left",'anchor'=> 'w','fill'=>'both', 'expand'=>true)
|
1269
|
+
}
|
1188
1270
|
@transient_frame_adapter = Hash.new
|
1271
|
+
@@instances = [] if !defined?(@@instances)
|
1272
|
+
@@instances << self
|
1189
1273
|
end
|
1190
1274
|
|
1191
1275
|
def forge_transient_adapter(_name)
|
1192
1276
|
if @transient_frame_adapter[_name].nil?
|
1193
|
-
@transient_frame_adapter[_name] =
|
1194
|
-
|
1195
|
-
@transient_frame_adapter[_name].
|
1277
|
+
@transient_frame_adapter[_name] = Hash.new
|
1278
|
+
@transient_frame_adapter[_name][:action] = TkFrameAdapter.new(Arcadia.layout.root, {'background'=> Arcadia.conf('titlelabel.background')})
|
1279
|
+
@transient_frame_adapter[_name][:state] = TkFrameAdapter.new(Arcadia.layout.root, {'background'=> Arcadia.conf('titlelabel.background')})
|
1280
|
+
__attach_action_adapter(@transient_frame_adapter[_name][:action])
|
1281
|
+
__attach_action_adapter(@transient_frame_adapter[_name][:state])
|
1282
|
+
@transient_frame_adapter[_name][:action].raise
|
1283
|
+
@transient_frame_adapter[_name][:state].raise
|
1196
1284
|
end
|
1197
1285
|
@transient_frame_adapter[_name]
|
1198
1286
|
end
|
1199
1287
|
|
1200
|
-
def __attach_adapter(_adapter)
|
1201
|
-
@last_attached_adapter.detach_frame if @last_attached_adapter
|
1202
|
-
_adapter.attach_frame(@
|
1203
|
-
@last_attached_adapter = _adapter
|
1288
|
+
# def __attach_adapter(_adapter)
|
1289
|
+
# @last_attached_adapter.detach_frame if @last_attached_adapter
|
1290
|
+
# _adapter.attach_frame(@transient_action_frame)
|
1291
|
+
# @last_attached_adapter = _adapter
|
1292
|
+
# end
|
1293
|
+
|
1294
|
+
def __attach_action_adapter(_adapter)
|
1295
|
+
@last_attached_action_adapter.detach_frame if @last_attached_action_adapter
|
1296
|
+
_adapter.attach_frame(@transient_action_frame)
|
1297
|
+
@last_attached_action_adapter = _adapter
|
1204
1298
|
end
|
1205
1299
|
|
1206
|
-
def
|
1207
|
-
@
|
1208
|
-
@
|
1209
|
-
|
1210
|
-
@transient_frame_adapter[_name].raise
|
1300
|
+
def __attach_state_adapter(_adapter)
|
1301
|
+
@last_attached_state_adapter.detach_frame if @last_attached_state_adapter
|
1302
|
+
_adapter.attach_frame(@transient_state_frame)
|
1303
|
+
@last_attached_state_adapter = _adapter
|
1211
1304
|
end
|
1212
1305
|
|
1213
|
-
def
|
1214
|
-
|
1215
|
-
@transient_frame_adapter[_name].
|
1306
|
+
# def change_adapter(_name, _adapter)
|
1307
|
+
# @transient_frame_adapter[_name] = _adapter
|
1308
|
+
# @transient_frame_adapter[_name].detach_frame
|
1309
|
+
# __attach_adapter(@transient_frame_adapter[_name])
|
1310
|
+
# @transient_frame_adapter[_name].raise
|
1311
|
+
# end
|
1312
|
+
#
|
1313
|
+
# def change_adapter_name(_name)
|
1314
|
+
# __attach_adapter(forge_transient_adapter(_name))
|
1315
|
+
# @transient_frame_adapter[_name].raise
|
1316
|
+
# end
|
1317
|
+
|
1318
|
+
def change_adapters(_name, _adapters)
|
1319
|
+
forge_transient_adapter(_name)
|
1320
|
+
@transient_frame_adapter[_name][:action] = _adapters[:action]
|
1321
|
+
@transient_frame_adapter[_name][:state] = _adapters[:state]
|
1322
|
+
@transient_frame_adapter[_name][:action].detach_frame
|
1323
|
+
@transient_frame_adapter[_name][:state].detach_frame
|
1324
|
+
__attach_action_adapter(@transient_frame_adapter[_name][:action])
|
1325
|
+
__attach_state_adapter(@transient_frame_adapter[_name][:state])
|
1326
|
+
@transient_frame_adapter[_name][:action].raise
|
1327
|
+
@transient_frame_adapter[_name][:state].raise
|
1328
|
+
end
|
1329
|
+
|
1330
|
+
def change_adapters_name(_name)
|
1331
|
+
__attach_action_adapter(forge_transient_adapter(_name)[:action])
|
1332
|
+
__attach_state_adapter(forge_transient_adapter(_name)[:state])
|
1333
|
+
@transient_frame_adapter[_name][:action].raise
|
1334
|
+
@transient_frame_adapter[_name][:state].raise
|
1335
|
+
end
|
1336
|
+
|
1337
|
+
def clear_transient_adapters(_name)
|
1338
|
+
@@instances.each{|i|
|
1339
|
+
if i.transient_frame_adapter[_name]
|
1340
|
+
if i.transient_frame_adapter[_name][:action]
|
1341
|
+
i.transient_frame_adapter[_name][:action].detach_frame
|
1342
|
+
end
|
1343
|
+
if i.transient_frame_adapter[_name][:state]
|
1344
|
+
i.transient_frame_adapter[_name][:state].detach_frame
|
1345
|
+
end
|
1346
|
+
i.transient_frame_adapter.delete(_name).clear
|
1347
|
+
end
|
1348
|
+
}
|
1216
1349
|
end
|
1217
1350
|
|
1218
1351
|
def add_button(_sender_name, _label,_proc=nil,_image=nil, _side= 'right')
|
1219
1352
|
forge_transient_adapter(_sender_name)
|
1220
|
-
__add_button(_label,_proc,_image, _side, @transient_frame_adapter[_sender_name])
|
1353
|
+
__add_button(_label,_proc,_image, _side, @transient_frame_adapter[_sender_name][:action])
|
1221
1354
|
end
|
1222
1355
|
|
1223
1356
|
def add_menu_button(_sender_name, _name='default',_image=nil, _side= 'right', _args=nil)
|
1224
1357
|
forge_transient_adapter(_sender_name)
|
1225
|
-
__add_menu_button(_name, _image, _side, _args, @transient_frame_adapter[_sender_name])
|
1358
|
+
__add_menu_button(_name, _image, _side, _args, @transient_frame_adapter[_sender_name][:action])
|
1226
1359
|
end
|
1227
1360
|
|
1228
1361
|
def add_panel(_sender_name, _name='default',_side= 'right', _args=nil)
|
1229
1362
|
forge_transient_adapter(_sender_name)
|
1230
|
-
__add_panel(_name, _side, _args, @transient_frame_adapter[_sender_name])
|
1363
|
+
__add_panel(_name, _side, _args, @transient_frame_adapter[_sender_name][:action])
|
1231
1364
|
end
|
1232
1365
|
|
1233
1366
|
def add_sep(_sender_name, _width=0)
|
1234
1367
|
forge_transient_adapter(_sender_name)
|
1235
|
-
__add_sep(_width, @transient_frame_adapter[_sender_name])
|
1368
|
+
__add_sep(_width, @transient_frame_adapter[_sender_name][:action])
|
1369
|
+
end
|
1370
|
+
|
1371
|
+
def add_state_button(_sender_name, _label,_proc=nil,_image=nil, _side= 'left')
|
1372
|
+
forge_transient_adapter(_sender_name)
|
1373
|
+
__add_state_button(_label,_proc,_image, _side, @transient_frame_adapter[_sender_name][:state])
|
1236
1374
|
end
|
1237
1375
|
|
1238
1376
|
end
|
@@ -1291,8 +1429,9 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
1291
1429
|
# hide
|
1292
1430
|
# end
|
1293
1431
|
# }
|
1432
|
+
Arcadia.instance.register_key_binding(self,"KeyPress[Escape]","ActionEvent.new(self, 'action'=>hide_if_visible)")
|
1294
1433
|
end
|
1295
|
-
|
1434
|
+
|
1296
1435
|
def title(_text)
|
1297
1436
|
@right_label.text(_text)
|
1298
1437
|
end
|
@@ -1301,6 +1440,10 @@ class TkFloatTitledFrame < TkBaseTitledFrame
|
|
1301
1440
|
add_fixed_button('X', _proc, TAB_CLOSE_GIF)
|
1302
1441
|
end
|
1303
1442
|
|
1443
|
+
def hide_if_visible
|
1444
|
+
hide if visible?
|
1445
|
+
end
|
1446
|
+
|
1304
1447
|
def hide
|
1305
1448
|
@manager = TkWinfo.manager(self)
|
1306
1449
|
if @manager == 'place'
|
@@ -1534,6 +1677,10 @@ module TkInputThrow
|
|
1534
1677
|
_widget.bind_append("<Redo>"){Arcadia.process_event(RedoTextEvent.new(_widget));break}
|
1535
1678
|
_widget.bind_append("1", proc{Arcadia.process_event(InputEnterEvent.new(self,'receiver'=>_widget))})
|
1536
1679
|
end
|
1680
|
+
|
1681
|
+
def select_throw
|
1682
|
+
InputEnterEvent.new(self,'receiver'=>self).go!
|
1683
|
+
end
|
1537
1684
|
end
|
1538
1685
|
|
1539
1686
|
module TkAutoPostMenu
|
@@ -1725,8 +1872,7 @@ module TkScrollableWidget
|
|
1725
1872
|
end
|
1726
1873
|
@v_scroll_command.call(first,last) if !@v_scroll_command.nil?
|
1727
1874
|
@last_y_last = last if last.to_f < 1
|
1728
|
-
end
|
1729
|
-
|
1875
|
+
end
|
1730
1876
|
end
|
1731
1877
|
|
1732
1878
|
def add_xscrollcommand(cmd=Proc.new)
|
@@ -1896,7 +2042,8 @@ class KeyTest < TkFloatTitledFrame
|
|
1896
2042
|
super(_parent)
|
1897
2043
|
|
1898
2044
|
@ttest = TkText.new(self.frame){
|
1899
|
-
background
|
2045
|
+
background Arcadia.conf("background")
|
2046
|
+
foreground Arcadia.conf("foreground")
|
1900
2047
|
#place('relwidth' => '1','relx' => 0,'x' => '0','y' => '0','relheight' => '1','rely' => 0,'height' => '0','bordermode' => 'inside','width' => '0')
|
1901
2048
|
}.bind("KeyPress"){|e|
|
1902
2049
|
@ttest.insert('end'," "+e.keysym+" ")
|