arcadia 0.12.2 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/README +25 -14
  2. data/conf/LC/en-UK.LANG +3 -1
  3. data/conf/arcadia.conf +10 -0
  4. data/conf/arcadia.res.rb +29 -1
  5. data/ext/ae-editor/ae-editor.rb +239 -48
  6. data/ext/ae-file-history/ae-file-history.conf +11 -1
  7. data/ext/ae-file-history/ae-file-history.rb +120 -2
  8. data/ext/ae-ruby-debug/ae-ruby-debug.rb +6 -5
  9. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +7 -3
  10. data/ext/ae-term/ae-term.rb +1 -1
  11. data/lib/a-commons.rb +72 -56
  12. data/lib/a-contracts.rb +23 -1
  13. data/lib/a-core.rb +136 -41
  14. data/lib/a-tkcommons.rb +127 -36
  15. data/tcl/fsdialog/fsdialog.tcl +2 -2
  16. data/tcl/ptwidgets-1.1.0/COPYRIGHT +10 -0
  17. data/tcl/ptwidgets-1.1.0/ChangeLog +194 -0
  18. data/tcl/ptwidgets-1.1.0/README +50 -0
  19. data/tcl/ptwidgets-1.1.0/common/stacktrace.tcl +29 -0
  20. data/tcl/ptwidgets-1.1.0/common/tokenframe.tcl +200 -0
  21. data/tcl/ptwidgets-1.1.0/doc/img/toggleswitch_off.png +0 -0
  22. data/tcl/ptwidgets-1.1.0/doc/img/toggleswitch_on.png +0 -0
  23. data/tcl/ptwidgets-1.1.0/doc/img/tokenentry.png +0 -0
  24. data/tcl/ptwidgets-1.1.0/doc/img/tokensearch_popup_example.png +0 -0
  25. data/tcl/ptwidgets-1.1.0/doc/img/tokensearch_popup_example2.png +0 -0
  26. data/tcl/ptwidgets-1.1.0/doc/img/wmarkentry.png +0 -0
  27. data/tcl/ptwidgets-1.1.0/doc/toggleswitch.html +402 -0
  28. data/tcl/ptwidgets-1.1.0/doc/tokenentry.html +1366 -0
  29. data/tcl/ptwidgets-1.1.0/doc/tokensearch.html +1549 -0
  30. data/tcl/ptwidgets-1.1.0/doc/wmarkentry.html +634 -0
  31. data/tcl/ptwidgets-1.1.0/library/toggleswitch.tcl +432 -0
  32. data/tcl/ptwidgets-1.1.0/library/tokenentry.tcl +2208 -0
  33. data/tcl/ptwidgets-1.1.0/library/tokensearch.tcl +2488 -0
  34. data/tcl/ptwidgets-1.1.0/library/wmarkentry.tcl +630 -0
  35. data/tcl/ptwidgets-1.1.0/pkgIndex.tcl +10 -0
  36. data/tcl/ptwidgets-1.1.0/test/Makefile +3 -0
  37. data/tcl/ptwidgets-1.1.0/test/run.tcl +3 -0
  38. data/tcl/ptwidgets-1.1.0/test/test.tcl +89 -0
  39. data/tcl/ptwidgets-1.1.0/test/toggleswitch.test +562 -0
  40. data/tcl/ptwidgets-1.1.0/test/tokenentry.test +1023 -0
  41. data/tcl/ptwidgets-1.1.0/test/tokensearch.test +1023 -0
  42. data/tcl/ptwidgets-1.1.0/test/wmarkentry.test +1325 -0
  43. data/tcl/themes/altTheme.tcl +101 -0
  44. data/tcl/themes/aquaTheme.tcl +59 -0
  45. data/tcl/themes/clamTheme.tcl +140 -0
  46. data/tcl/themes/classicTheme.tcl +108 -0
  47. data/tcl/themes/pkgIndex.tcl +3 -0
  48. data/tcl/themes/ttk.tcl +176 -0
  49. data/tcl/themes/vistaTheme.tcl +224 -0
  50. data/tcl/themes/winTheme.tcl +80 -0
  51. data/tcl/themes/xpTheme.tcl +65 -0
  52. data/tcl/tkfbox/folder.gif +0 -0
  53. data/tcl/tkfbox/textfile.gif +0 -0
  54. data/tcl/tkfbox/tkfbox.tcl +1 -0
  55. data/tcl/tkfbox/tkfbox.tcl~ +1 -0
  56. data/tcl/tkfbox/updir.xbm +1 -0
  57. metadata +43 -2
@@ -115,6 +115,8 @@ class OpenBufferEvent < BufferEvent
115
115
  end
116
116
 
117
117
  class OpenBufferTransientEvent < OpenBufferEvent
118
+ # @transient is a boolean property setted to true during event elaboration if the file is considered transient
119
+ attr_accessor :transient
118
120
  end
119
121
 
120
122
  class CloseBufferEvent < BufferEvent
@@ -174,12 +176,32 @@ end
174
176
 
175
177
  class BufferClosedEvent < BufferEvent
176
178
  end
179
+
180
+ # +---------------------------------------------+
181
+ # Bookmark event
182
+ # +---------------------------------------------+
183
+
184
+ class BookmarkEvent < ArcadiaEvent
185
+ #range around row where event has effect
186
+ attr_accessor :id, :file, :row, :persistent, :range, :from_row, :to_row , :content
187
+ end
188
+
189
+ class SetBookmarkEvent < BookmarkEvent
190
+ end
191
+
192
+ class UnsetBookmarkEvent < BookmarkEvent
193
+ end
194
+
195
+ class ToggleBookmarkEvent < BookmarkEvent
196
+ end
197
+
198
+
177
199
  # +---------------------------------------------+
178
200
  # Debug event
179
201
  # +---------------------------------------------+
180
202
 
181
203
  class DebugEvent < ArcadiaEvent
182
- attr_accessor :id, :file, :row, :active, :persistent
204
+ attr_accessor :id, :file, :row, :active, :persistent
183
205
  end
184
206
 
185
207
  class SetBreakpointEvent < DebugEvent
@@ -24,7 +24,7 @@ class Arcadia < TkApplication
24
24
  super(
25
25
  ApplicationParams.new(
26
26
  'arcadia',
27
- '0.12.2',
27
+ '0.13.0',
28
28
  'conf/arcadia.conf',
29
29
  'conf/arcadia.pers'
30
30
  )
@@ -178,10 +178,16 @@ class Arcadia < TkApplication
178
178
  end
179
179
 
180
180
  def register(_ext)
181
+ if @@instance['exts_map'] == nil
182
+ @@instance['exts_map'] = Hash.new
183
+ end
181
184
  @exts_i << _ext
185
+ @@instance['exts_map'][_ext.name]=_ext
182
186
  end
183
187
 
184
188
  def unregister(_ext)
189
+ @@instance['exts_map'][_ext.name] = nil
190
+ @@instance['exts_map'].delete(_ext.name)
185
191
  @exts_i.delete(_ext)
186
192
  end
187
193
 
@@ -367,7 +373,7 @@ class Arcadia < TkApplication
367
373
  def do_make_clones
368
374
  Array.new.concat(@exts_i).each{|ext|
369
375
  if ext.kind_of?(ArcadiaExtPlus)
370
- a = ext.conf_array("#{ext.name}.clones")
376
+ a = ext.conf_array("clones")
371
377
  a.each{|clone_name|
372
378
  ext.clone(clone_name)
373
379
  }
@@ -1253,6 +1259,12 @@ class Arcadia < TkApplication
1253
1259
  end
1254
1260
  end
1255
1261
 
1262
+ def Arcadia.extension(_name=nil)
1263
+ if _name && @@instance && @@instance['exts_map']
1264
+ return @@instance['exts_map'][_name]
1265
+ end
1266
+ end
1267
+
1256
1268
  def Arcadia.runtime_error(_e, _title=Arcadia.text("main.e.runtime.title"))
1257
1269
  ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::RUNTIME_ERROR_TYPE,"title"=>"#{_title} : [#{_e.class}] #{_e.message} at :", "detail"=>_e.backtrace).go!
1258
1270
  end
@@ -1480,16 +1492,16 @@ class ArcadiaMainMenu < ArcadiaUserControl
1480
1492
  end
1481
1493
  end
1482
1494
 
1483
- def get_sub_menu(menu_context, folder=nil)
1484
- if folder
1485
- s_i = -1
1486
- i_end = menu_context.index('end')
1495
+ def ArcadiaMainMenu.sub_menu(_menu, _title=nil)
1496
+ s_i = -1
1497
+ if _title
1498
+ i_end = _menu.index('end')
1487
1499
  if i_end
1488
1500
  0.upto(i_end){|j|
1489
- type = menu_context.menutype(j)
1501
+ type = _menu.menutype(j)
1490
1502
  if type != 'separator'
1491
- l = menu_context.entrycget(j,'label')
1492
- if l == folder && type == 'cascade'
1503
+ l = _menu.entrycget(j,'label')
1504
+ if l == _title && type == 'cascade'
1493
1505
  s_i = j
1494
1506
  break
1495
1507
  end
@@ -1497,9 +1509,17 @@ class ArcadiaMainMenu < ArcadiaUserControl
1497
1509
  }
1498
1510
  end
1499
1511
  end
1500
- if s_i > -1 #&& menu_context.menutype(s_i) == 'cascade'
1501
- sub = menu_context.entrycget(s_i, 'menu')
1512
+ if s_i > -1
1513
+ sub = _menu.entrycget(s_i, 'menu')
1502
1514
  else
1515
+ sub = nil
1516
+ end
1517
+ sub
1518
+ end
1519
+
1520
+ def get_sub_menu(menu_context, folder=nil)
1521
+ sub = ArcadiaMainMenu.sub_menu(menu_context, folder)
1522
+ if sub.nil?
1503
1523
  sub = TkMenu.new(
1504
1524
  :parent=>@pop_up,
1505
1525
  :tearoff=>0
@@ -2493,6 +2513,7 @@ class ArcadiaLayout
2493
2513
  p['sons'].each{|k,v|
2494
2514
  if k == _extension
2495
2515
  v.hinner_frame.raise
2516
+ #title_titled_frame(_domain, v.title)
2496
2517
  p['root'].title(v.title)
2497
2518
  p['root'].restore_caption(k)
2498
2519
  p['root'].change_adapters_name(k)
@@ -3108,13 +3129,37 @@ class ArcadiaLayout
3108
3129
  end
3109
3130
 
3110
3131
  end
3132
+
3133
+ # def title_titled_frame(_domain, _text)
3134
+ # mb = @panels[_domain]['root'].menu_button('ext') if @panels[_domain]
3135
+ # if mb
3136
+ # #mb.configure('text'=>_text)
3137
+ # mb.cget('textvariable').value=_text
3138
+ # p "configuro #{_text}"
3139
+ # end
3140
+ # end
3111
3141
 
3112
3142
  def build_titled_frame(domain)
3113
3143
  if @panels[domain]
3114
3144
  tframe = TkTitledFrameAdapter.new(@panels[domain]['root']).place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1)
3115
- mb = tframe.add_fixed_menu_button('ext')
3145
+ # mb = tframe.add_fixed_menu_button('ext')
3146
+
3147
+ # mb = tframe.add_fixed_menu_button(
3148
+ # 'ext',
3149
+ # nil,
3150
+ # 'left',
3151
+ # {'relief'=>:flat,
3152
+ # 'borderwidth'=>1,
3153
+ # 'compound'=> 'left',
3154
+ # 'anchor'=>'w',
3155
+ # 'activebackground'=>Arcadia.conf('titlelabel.background'),
3156
+ # 'foreground' => Arcadia.conf('titlecontext.foreground'),
3157
+ # 'textvariable'=> TkVariable.new('')
3158
+ # })
3159
+
3116
3160
  # add commons item
3117
- menu = mb.cget('menu')
3161
+ # menu = mb.cget('menu')
3162
+ menu = tframe.title_menu
3118
3163
  add_commons_menu_items(domain, menu)
3119
3164
  @panels[domain]['root']= tframe
3120
3165
  #-----------------------------------
@@ -3272,31 +3317,85 @@ class ArcadiaLayout
3272
3317
  exist
3273
3318
  end
3274
3319
 
3320
+ def menu_item_add(_menu, _dom, _ffw, _is_plus=false)
3321
+ if !menu_item_exist?(_menu, _ffw.title)
3322
+ ind = sorted_menu_index(_menu, _ffw.title)
3323
+ if _is_plus
3324
+ if Arcadia.extension(_ffw.name).main_instance?
3325
+ submenu_title = _ffw.title
3326
+ else
3327
+ submenu_title = Arcadia.extension(_ffw.name).main_instance.frame_title
3328
+ end
3329
+ submenu = nil
3330
+ newlabel = "New ..."
3331
+ if menu_item_exist?(_menu, submenu_title)
3332
+ submenu = ArcadiaMainMenu.sub_menu(_menu, submenu_title)
3333
+ end
3334
+ if submenu.nil?
3335
+ submenu = TkMenu.new(
3336
+ :parent=>_menu,
3337
+ :tearoff=>0,
3338
+ :title => submenu_title
3339
+ )
3340
+ submenu.extend(TkAutoPostMenu)
3341
+ submenu.configure(Arcadia.style('menu'))
3342
+ _menu.insert(ind,
3343
+ :cascade,
3344
+ :image=>Arcadia.image_res(ARROW_LEFT_GIF),
3345
+ :label=>submenu_title,
3346
+ :compound=>'left',
3347
+ :menu=>submenu,
3348
+ :hidemargin => false
3349
+ )
3350
+ submenu.insert('end',:command,
3351
+ :label=>newlabel,
3352
+ :image=>Arcadia.image_res(STAR_EMPTY_GIF),
3353
+ :compound=>'left',
3354
+ :command=>proc{Arcadia.extension(_ffw.name).main_instance.duplicate(nil, _dom)},
3355
+ :hidemargin => true
3356
+ )
3357
+ end
3358
+ submenu.insert(newlabel,:command,
3359
+ :label=>_ffw.title,
3360
+ :image=>Arcadia.image_res(ARROW_LEFT_GIF),
3361
+ :compound=>'left',
3362
+ :command=>proc{change_domain(_dom, _ffw.name)},
3363
+ :hidemargin => true
3364
+ )
3365
+
3366
+ else
3367
+ _menu.insert(ind,:command,
3368
+ :label=>_ffw.title,
3369
+ :image=>Arcadia.image_res(ARROW_LEFT_GIF),
3370
+ :compound=>'left',
3371
+ :command=>proc{change_domain(_dom, _ffw.name)},
3372
+ :hidemargin => true
3373
+ )
3374
+ end
3375
+ end
3376
+ end
3275
3377
 
3276
3378
  def process_frame(_ffw)
3277
3379
  #p "processo frame #{_ffw.title}"
3380
+ #-------
3381
+ is_plus = Arcadia.extension(_ffw.name).kind_of?(ArcadiaExtPlus)
3382
+ #-------
3278
3383
  @panels.keys.each{|dom|
3279
3384
  if dom != '_domain_root_' && dom != _ffw.domain && @panels[dom] && @panels[dom]['root']
3280
3385
  titledFrame = @panels[dom]['root']
3281
3386
  if titledFrame.instance_of?(TkTitledFrameAdapter)
3282
- menu = @panels[dom]['root'].menu_button('ext').cget('menu')
3283
- if !menu_item_exist?(menu, _ffw.title)
3284
- ind = sorted_menu_index(menu, _ffw.title)
3285
- menu.insert(ind,:command,
3286
- :label=>_ffw.title,
3287
- :image=>Arcadia.image_res(ARROW_LEFT_GIF),
3288
- :compound=>'left',
3289
- :command=>proc{change_domain(dom, _ffw.name)},
3290
- :hidemargin => true
3291
- )
3292
- end
3387
+ #menu = @panels[dom]['root'].menu_button('ext').cget('menu')
3388
+ menu = titledFrame.title_menu
3389
+ menu_item_add(menu, dom, _ffw, is_plus)
3293
3390
  end
3294
3391
  end
3295
3392
  }
3296
3393
  if @panels[_ffw.domain]
3297
3394
  titledFrame = @panels[_ffw.domain]['root']
3298
3395
  if titledFrame.instance_of?(TkTitledFrameAdapter)
3299
- mymenu = titledFrame.menu_button('ext').cget('menu')
3396
+ #titledFrame.menu_button('ext').text("#{_ffw.title}::")
3397
+ #mymenu = titledFrame.menu_button('ext').cget('menu')
3398
+ mymenu = titledFrame.title_menu
3300
3399
  index = mymenu.index('end').to_i
3301
3400
  if @panels.keys.length > 2
3302
3401
  i=index-3
@@ -3318,7 +3417,6 @@ class ArcadiaLayout
3318
3417
  )
3319
3418
  end
3320
3419
  else
3321
- # if raised_name(_ffw.domain) == _ffw.name
3322
3420
  if !menu_item_exist?(mymenu, clabel)
3323
3421
  mymenu.insert(index,:command,
3324
3422
  :label=> clabel,
@@ -3328,18 +3426,7 @@ class ArcadiaLayout
3328
3426
  :hidemargin => true
3329
3427
  )
3330
3428
  end
3331
- # else
3332
- if !menu_item_exist?(mymenu, _ffw.title)
3333
- ind = sorted_menu_index(mymenu, _ffw.title)
3334
- mymenu.insert(ind,:command,
3335
- :label=>_ffw.title,
3336
- :image=>Arcadia.image_res(ARROW_LEFT_GIF),
3337
- :compound=>'left',
3338
- :command=>proc{change_domain(_ffw.domain, _ffw.name)},
3339
- :hidemargin => true
3340
- )
3341
- end
3342
- # end
3429
+ menu_item_add(mymenu, _ffw.domain, _ffw, is_plus)
3343
3430
  end
3344
3431
  end
3345
3432
  end
@@ -3353,9 +3440,11 @@ class ArcadiaLayout
3353
3440
  if dom != '_domain_root_' && @panels[dom] && @panels[dom]['root']
3354
3441
  titledFrame = @panels[dom]['root']
3355
3442
  if titledFrame.instance_of?(TkTitledFrameAdapter)
3356
- menu = titledFrame.menu_button('ext').cget('menu')
3443
+ #menu = titledFrame.menu_button('ext').cget('menu')
3444
+ menu = titledFrame.title_menu
3357
3445
  if refresh_commons_items
3358
- @panels[dom]['root'].menu_button('ext').cget('menu').delete('0','end')
3446
+ #@panels[dom]['root'].menu_button('ext').cget('menu').delete('0','end')
3447
+ @panels[dom]['root'].title_menu.delete('0','end')
3359
3448
  add_commons_menu_items(dom, menu)
3360
3449
  else
3361
3450
  index = menu.index('end').to_i
@@ -3374,7 +3463,8 @@ class ArcadiaLayout
3374
3463
  end
3375
3464
  if i >= 0
3376
3465
  end_index = i.to_s
3377
- @panels[dom]['root'].menu_button('ext').cget('menu').delete('0',end_index)
3466
+ #@panels[dom]['root'].menu_button('ext').cget('menu').delete('0',end_index)
3467
+ @panels[dom]['root'].title_menu.delete('0',end_index)
3378
3468
  end
3379
3469
  end
3380
3470
  # index = menu.index('end').to_i
@@ -3404,6 +3494,7 @@ class ArcadiaLayout
3404
3494
  num = pan['sons'].length
3405
3495
  if @headed
3406
3496
  root_frame = pan['root'].frame
3497
+ #title_titled_frame(_domain_name, _title)
3407
3498
  pan['root'].title(_title)
3408
3499
  pan['root'].restore_caption(_name)
3409
3500
  pan['root'].change_adapters_name(_name)
@@ -3439,6 +3530,7 @@ class ArcadiaLayout
3439
3530
  api.name,
3440
3531
  'text'=>api.title,
3441
3532
  'raisecmd'=>proc{
3533
+ #title_titled_frame(_domain_name, api.title)
3442
3534
  pan['root'].title(api.title)
3443
3535
  pan['root'].restore_caption(api.name)
3444
3536
  pan['root'].change_adapters_name(api.name)
@@ -3459,6 +3551,7 @@ class ArcadiaLayout
3459
3551
  _panel = pan['notebook'].insert('end',_name ,
3460
3552
  'text'=>_title,
3461
3553
  'raisecmd'=>proc{
3554
+ #title_titled_frame(_domain_name, _title)
3462
3555
  pan['root'].title(_title)
3463
3556
  pan['root'].restore_caption(_name)
3464
3557
  pan['root'].change_adapters_name(_name)
@@ -3523,6 +3616,7 @@ class ArcadiaLayout
3523
3616
  n = @panels[_domain_name][:raised_stack][-1]
3524
3617
  w = @panels[_domain_name]['sons'][n].hinner_frame
3525
3618
  t = @panels[_domain_name]['sons'][n].title
3619
+ #title_titled_frame(_domain_name, t)
3526
3620
  @panels[_domain_name]['root'].title(t)
3527
3621
  @panels[_domain_name]['root'].restore_caption(n)
3528
3622
  @panels[_domain_name]['root'].shift_on if !@panels[_domain_name]['sons'][n].kind_of?(ArcadiaExtPlus)
@@ -3542,6 +3636,7 @@ class ArcadiaLayout
3542
3636
  end
3543
3637
  end
3544
3638
  elsif @panels[_domain_name]['sons'].length == 0
3639
+ #title_titled_frame(_domain_name, '')
3545
3640
  @panels[_domain_name]['root'].title('')
3546
3641
  @panels[_domain_name]['root'].top_text_clear
3547
3642
  end
@@ -969,7 +969,8 @@ class TkTitledFrame < TkBaseTitledFrame
969
969
  @state = 'normal'
970
970
  @title = title
971
971
  @img = img
972
- @left_label = create_left_label
972
+ # @left_label = create_left_label
973
+ @left_label = create_left_title
973
974
  @right_label = create_right_label
974
975
  @right_labels_text = Hash.new
975
976
  @right_labels_image = Hash.new
@@ -979,29 +980,29 @@ class TkTitledFrame < TkBaseTitledFrame
979
980
  @apw = Array.new
980
981
  @aph = Array.new
981
982
  @top.bind_append("Double-Button-1", proc{resize})
982
- @left_label.bind_append("Double-Button-1", proc{resize})
983
+ #@left_label.bind_append("Double-Button-1", proc{resize})
983
984
  @right_label.bind_append("Double-Button-1", proc{resize})
984
985
  end
985
986
 
986
- def create_left_label
987
- __create_left_label(@top)
988
- end
987
+ # def create_left_label
988
+ # __create_left_label(@top)
989
+ # end
989
990
 
990
991
  def create_right_label
991
992
  __create_right_label(@top)
992
993
  end
993
994
 
994
- def __create_left_label(_frame)
995
- @title.nil??_text_title ='':_text_title = @title+' :: '
996
- _img=@img
997
- TkLabel.new(_frame, Arcadia.style('titlelabel')){
998
- text _text_title
999
- anchor 'w'
1000
- compound 'left'
1001
- image TkAllPhotoImage.new('file' => _img) if _img
1002
- pack('side'=> 'left','anchor'=> 'e')
1003
- }
1004
- end
995
+ # def __create_left_label(_frame)
996
+ # @title.nil??_text_title ='':_text_title = @title+' :: '
997
+ # _img=@img
998
+ # TkLabel.new(_frame, Arcadia.style('titlelabel')){
999
+ # text _text_title
1000
+ # anchor 'w'
1001
+ # compound 'left'
1002
+ # image TkAllPhotoImage.new('file' => _img) if _img
1003
+ # pack('side'=> 'left','anchor'=> 'e')
1004
+ # }
1005
+ # end
1005
1006
 
1006
1007
  def __create_right_label(_frame)
1007
1008
  TkLabel.new(_frame, Arcadia.style('titlelabel')){
@@ -1013,26 +1014,26 @@ class TkTitledFrame < TkBaseTitledFrame
1013
1014
  }
1014
1015
  end
1015
1016
 
1016
- def shift_on
1017
- @left_label.foreground(Arcadia.conf('titlelabel.foreground'))
1018
- end
1019
-
1020
- def shift_off
1021
- @left_label.foreground(Arcadia.conf('titlelabel.disabledforeground'))
1022
- end
1017
+ # def shift_on
1018
+ # @left_label.foreground(Arcadia.conf('titlelabel.foreground'))
1019
+ # end
1020
+ #
1021
+ # def shift_off
1022
+ # @left_label.foreground(Arcadia.conf('titlelabel.disabledforeground'))
1023
+ # end
1023
1024
 
1024
- def title(_text=nil)
1025
- if _text.nil?
1026
- return @title
1027
- else
1028
- @title=_text
1029
- if _text.strip.length == 0
1030
- @left_label.text('')
1031
- else
1032
- @left_label.text(_text+'::')
1033
- end
1034
- end
1035
- end
1025
+ # def title(_text=nil)
1026
+ # if _text.nil?
1027
+ # return @title
1028
+ # else
1029
+ # @title=_text
1030
+ # if _text.strip.length == 0
1031
+ # @left_label.text('')
1032
+ # else
1033
+ # @left_label.text(_text+'::')
1034
+ # end
1035
+ # end
1036
+ # end
1036
1037
 
1037
1038
  def top_text_clear
1038
1039
  @right_label.configure('text'=>'', 'image'=>nil)
@@ -1158,6 +1159,96 @@ class TkTitledFrame < TkBaseTitledFrame
1158
1159
  end
1159
1160
 
1160
1161
 
1162
+ class TkLabelTitledFrame < TkTitledFrame
1163
+
1164
+ def create_left_title
1165
+ @left_label = __create_left_label(@top)
1166
+ @left_label.bind_append("Double-Button-1", proc{resize})
1167
+ end
1168
+
1169
+ def __create_left_label(_frame)
1170
+ @title.nil??_text_title ='':_text_title = @title+' :: '
1171
+ _img=@img
1172
+ TkLabel.new(_frame, Arcadia.style('titlelabel')){
1173
+ text _text_title
1174
+ anchor 'w'
1175
+ compound 'left'
1176
+ image TkAllPhotoImage.new('file' => _img) if _img
1177
+ pack('side'=> 'left','anchor'=> 'e')
1178
+ }
1179
+ end
1180
+
1181
+ def shift_on
1182
+ @left_label.foreground(Arcadia.conf('titlelabel.foreground'))
1183
+ end
1184
+
1185
+ def shift_off
1186
+ @left_label.foreground(Arcadia.conf('titlelabel.disabledforeground'))
1187
+ end
1188
+
1189
+ def title(_text=nil)
1190
+ if _text.nil?
1191
+ return @title
1192
+ else
1193
+ @title=_text
1194
+ if _text.strip.length == 0
1195
+ @left_label.text('')
1196
+ else
1197
+ @left_label.text(_text+'::')
1198
+ end
1199
+ end
1200
+ end
1201
+ end
1202
+
1203
+ class TkMenuTitledFrame < TkTitledFrame
1204
+ def create_left_title
1205
+ @left_menu_button = __create_left_menu_button(@top)
1206
+ @left_menu_button.bind_append("Double-Button-1", proc{resize})
1207
+ end
1208
+
1209
+ def title_menu
1210
+ @left_menu_button.cget('menu') if @left_menu_button
1211
+ end
1212
+
1213
+ def __create_left_menu_button(_frame)
1214
+ img=@img
1215
+ @left_menu_button = TkMenuButton.new(_frame, Arcadia.style('titlebutton')){|mb|
1216
+ menu TkMenu.new(mb, Arcadia.style('titlemenu'))
1217
+ if img
1218
+ indicatoron false
1219
+ image Arcadia.image_res(img)
1220
+ else
1221
+ indicatoron true
1222
+ end
1223
+ padx 0
1224
+ textvariable TkVariable.new('')
1225
+ pack('side'=> 'left','anchor'=> 'e')
1226
+ }
1227
+
1228
+ end
1229
+
1230
+ def shift_on
1231
+ @left_menu_button.foreground(Arcadia.conf('titlelabel.foreground'))
1232
+ end
1233
+
1234
+ def shift_off
1235
+ @left_menu_button.foreground(Arcadia.conf('titlelabel.disabledforeground'))
1236
+ end
1237
+
1238
+ def title(_text=nil)
1239
+ if _text.nil?
1240
+ return @title
1241
+ else
1242
+ @title=_text
1243
+ if _text.strip.length == 0
1244
+ @left_menu_button.textvariable.value=''
1245
+ else
1246
+ @left_menu_button.textvariable.value=_text+'::'
1247
+ end
1248
+ end
1249
+ end
1250
+ end
1251
+
1161
1252
 
1162
1253
  #class TkFrameAdapterOld < TkFrame
1163
1254
  # include TkMovable
@@ -1266,7 +1357,7 @@ end
1266
1357
  #
1267
1358
  #end
1268
1359
 
1269
- class TkTitledFrameAdapter < TkTitledFrame
1360
+ class TkTitledFrameAdapter < TkMenuTitledFrame
1270
1361
  attr_reader :transient_frame_adapter
1271
1362
 
1272
1363
  def initialize(parent=nil, title=nil, img=nil , keys=nil)