arcadia 0.5.1 → 0.6.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.
Files changed (170) hide show
  1. data/README +11 -8
  2. data/bin/arcadia +1 -1
  3. data/bin/arcadia.bat +0 -0
  4. data/conf/arcadia.conf +21 -4
  5. data/conf/arcadia.init.rb +0 -0
  6. data/conf/arcadia.res.rb +25 -2
  7. data/ext/ae-breakpoints/ae-breakpoints.conf +2 -1
  8. data/ext/ae-breakpoints/ae-breakpoints.rb +12 -12
  9. data/ext/ae-editor/ae-editor.conf +2 -1
  10. data/ext/ae-editor/ae-editor.rb +3841 -3813
  11. data/ext/ae-editor/langs/conf.lang +0 -0
  12. data/ext/ae-editor/langs/lang.lang.bind +0 -0
  13. data/ext/ae-editor/langs/rb.lang +0 -0
  14. data/ext/ae-editor/langs/rbw.lang.bind +0 -0
  15. data/ext/ae-file-history/ae-file-history.conf +2 -1
  16. data/ext/ae-file-history/ae-file-history.rb +1 -0
  17. data/ext/ae-output/ae-output.conf +2 -1
  18. data/ext/ae-output/ae-output.rb +0 -0
  19. data/ext/ae-rad/ae-rad-inspector.rb +4 -3
  20. data/ext/ae-rad/ae-rad-libs.rb +0 -0
  21. data/ext/ae-rad/ae-rad-palette.rb +0 -0
  22. data/ext/ae-rad/ae-rad.conf +2 -1
  23. data/ext/ae-rad/ae-rad.rb +0 -0
  24. data/ext/ae-rad/lib/tk/al-tk.rb +0 -0
  25. data/ext/ae-rad/lib/tk/al-tk.res.rb +0 -0
  26. data/ext/ae-rad/lib/tk/al-tkarcadia.rb +25 -25
  27. data/ext/ae-rad/lib/tk/al-tkcustom.rb +0 -0
  28. data/ext/ae-rad/lib/tkext/al-bwidget.rb +0 -0
  29. data/ext/ae-rad/lib/tkext/al-iwidgets.rb +0 -0
  30. data/ext/ae-rad/lib/tkext/al-tile.rb +0 -0
  31. data/ext/ae-rad/lib/tkext/al-tktable.rb +0 -0
  32. data/ext/ae-ruby-debug/ae-ruby-debug.conf +3 -2
  33. data/ext/ae-ruby-debug/ae-ruby-debug.rb +10 -6
  34. data/ext/ae-search-in-files/ae-search-in-files.conf +2 -1
  35. data/ext/ae-search-in-files/ae-search-in-files.rb +0 -0
  36. data/ext/ae-shell/ae-shell.conf +0 -0
  37. data/ext/ae-shell/ae-shell.rb +0 -0
  38. data/ext/ae-shell/sh.rb +0 -0
  39. data/lib/a-commons.rb +37 -15
  40. data/lib/a-contracts.rb +11 -0
  41. data/lib/a-core.rb +1084 -84
  42. data/lib/a-tkcommons.rb +240 -43
  43. data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +0 -0
  44. data/tcl/BWidget-1.8.0/BWman/BWidget.html +0 -0
  45. data/tcl/BWidget-1.8.0/BWman/Button.html +0 -0
  46. data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +0 -0
  47. data/tcl/BWidget-1.8.0/BWman/ComboBox.html +0 -0
  48. data/tcl/BWidget-1.8.0/BWman/Dialog.html +0 -0
  49. data/tcl/BWidget-1.8.0/BWman/DragSite.html +0 -0
  50. data/tcl/BWidget-1.8.0/BWman/DropSite.html +0 -0
  51. data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +0 -0
  52. data/tcl/BWidget-1.8.0/BWman/Entry.html +0 -0
  53. data/tcl/BWidget-1.8.0/BWman/Label.html +0 -0
  54. data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +0 -0
  55. data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +0 -0
  56. data/tcl/BWidget-1.8.0/BWman/ListBox.html +0 -0
  57. data/tcl/BWidget-1.8.0/BWman/MainFrame.html +0 -0
  58. data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +0 -0
  59. data/tcl/BWidget-1.8.0/BWman/NoteBook.html +0 -0
  60. data/tcl/BWidget-1.8.0/BWman/PagesManager.html +0 -0
  61. data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +0 -0
  62. data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +0 -0
  63. data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +0 -0
  64. data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +0 -0
  65. data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +0 -0
  66. data/tcl/BWidget-1.8.0/BWman/ScrollView.html +0 -0
  67. data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +0 -0
  68. data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +0 -0
  69. data/tcl/BWidget-1.8.0/BWman/SelectColor.html +0 -0
  70. data/tcl/BWidget-1.8.0/BWman/SelectFont.html +0 -0
  71. data/tcl/BWidget-1.8.0/BWman/Separator.html +0 -0
  72. data/tcl/BWidget-1.8.0/BWman/SpinBox.html +0 -0
  73. data/tcl/BWidget-1.8.0/BWman/StatusBar.html +0 -0
  74. data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +0 -0
  75. data/tcl/BWidget-1.8.0/BWman/Tree.html +0 -0
  76. data/tcl/BWidget-1.8.0/BWman/Widget.html +0 -0
  77. data/tcl/BWidget-1.8.0/BWman/contents.html +0 -0
  78. data/tcl/BWidget-1.8.0/BWman/index.html +0 -0
  79. data/tcl/BWidget-1.8.0/BWman/navtree.html +0 -0
  80. data/tcl/BWidget-1.8.0/BWman/options.htm +0 -0
  81. data/tcl/BWidget-1.8.0/CHANGES.txt +0 -0
  82. data/tcl/BWidget-1.8.0/ChangeLog +0 -0
  83. data/tcl/BWidget-1.8.0/LICENSE.txt +0 -0
  84. data/tcl/BWidget-1.8.0/README.txt +0 -0
  85. data/tcl/BWidget-1.8.0/arrow.tcl +0 -0
  86. data/tcl/BWidget-1.8.0/bitmap.tcl +0 -0
  87. data/tcl/BWidget-1.8.0/button.tcl +0 -0
  88. data/tcl/BWidget-1.8.0/buttonbox.tcl +0 -0
  89. data/tcl/BWidget-1.8.0/color.tcl +0 -0
  90. data/tcl/BWidget-1.8.0/combobox.tcl +0 -0
  91. data/tcl/BWidget-1.8.0/demo/basic.tcl +0 -0
  92. data/tcl/BWidget-1.8.0/demo/bwidget.xbm +0 -0
  93. data/tcl/BWidget-1.8.0/demo/demo.tcl +0 -0
  94. data/tcl/BWidget-1.8.0/demo/dnd.tcl +0 -0
  95. data/tcl/BWidget-1.8.0/demo/manager.tcl +0 -0
  96. data/tcl/BWidget-1.8.0/demo/select.tcl +0 -0
  97. data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +0 -0
  98. data/tcl/BWidget-1.8.0/demo/tree.tcl +0 -0
  99. data/tcl/BWidget-1.8.0/demo/x1.xbm +0 -0
  100. data/tcl/BWidget-1.8.0/dialog.tcl +0 -0
  101. data/tcl/BWidget-1.8.0/dragsite.tcl +0 -0
  102. data/tcl/BWidget-1.8.0/dropsite.tcl +0 -0
  103. data/tcl/BWidget-1.8.0/dynhelp.tcl +0 -0
  104. data/tcl/BWidget-1.8.0/entry.tcl +0 -0
  105. data/tcl/BWidget-1.8.0/font.tcl +0 -0
  106. data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
  107. data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
  108. data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
  109. data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
  110. data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
  111. data/tcl/BWidget-1.8.0/images/error.gif +0 -0
  112. data/tcl/BWidget-1.8.0/images/file.gif +0 -0
  113. data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
  114. data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
  115. data/tcl/BWidget-1.8.0/images/info.gif +0 -0
  116. data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
  117. data/tcl/BWidget-1.8.0/images/minus.xbm +0 -0
  118. data/tcl/BWidget-1.8.0/images/new.gif +0 -0
  119. data/tcl/BWidget-1.8.0/images/opcopy.xbm +0 -0
  120. data/tcl/BWidget-1.8.0/images/open.gif +0 -0
  121. data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
  122. data/tcl/BWidget-1.8.0/images/oplink.xbm +0 -0
  123. data/tcl/BWidget-1.8.0/images/opmove.xbm +0 -0
  124. data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
  125. data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
  126. data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
  127. data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
  128. data/tcl/BWidget-1.8.0/images/plus.xbm +0 -0
  129. data/tcl/BWidget-1.8.0/images/print.gif +0 -0
  130. data/tcl/BWidget-1.8.0/images/question.gif +0 -0
  131. data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
  132. data/tcl/BWidget-1.8.0/images/save.gif +0 -0
  133. data/tcl/BWidget-1.8.0/images/target.xbm +0 -0
  134. data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
  135. data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
  136. data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
  137. data/tcl/BWidget-1.8.0/init.tcl +0 -0
  138. data/tcl/BWidget-1.8.0/label.tcl +0 -0
  139. data/tcl/BWidget-1.8.0/labelentry.tcl +0 -0
  140. data/tcl/BWidget-1.8.0/labelframe.tcl +0 -0
  141. data/tcl/BWidget-1.8.0/lang/da.rc +0 -0
  142. data/tcl/BWidget-1.8.0/lang/de.rc +0 -0
  143. data/tcl/BWidget-1.8.0/lang/en.rc +0 -0
  144. data/tcl/BWidget-1.8.0/lang/es.rc +0 -0
  145. data/tcl/BWidget-1.8.0/lang/fr.rc +0 -0
  146. data/tcl/BWidget-1.8.0/listbox.tcl +0 -0
  147. data/tcl/BWidget-1.8.0/mainframe.tcl +0 -0
  148. data/tcl/BWidget-1.8.0/messagedlg.tcl +0 -0
  149. data/tcl/BWidget-1.8.0/notebook.tcl +0 -0
  150. data/tcl/BWidget-1.8.0/pagesmgr.tcl +0 -0
  151. data/tcl/BWidget-1.8.0/panedw.tcl +0 -0
  152. data/tcl/BWidget-1.8.0/panelframe.tcl +0 -0
  153. data/tcl/BWidget-1.8.0/passwddlg.tcl +0 -0
  154. data/tcl/BWidget-1.8.0/pkgIndex.tcl +0 -0
  155. data/tcl/BWidget-1.8.0/progressbar.tcl +0 -0
  156. data/tcl/BWidget-1.8.0/progressdlg.tcl +0 -0
  157. data/tcl/BWidget-1.8.0/scrollframe.tcl +0 -0
  158. data/tcl/BWidget-1.8.0/scrollview.tcl +0 -0
  159. data/tcl/BWidget-1.8.0/scrollw.tcl +0 -0
  160. data/tcl/BWidget-1.8.0/separator.tcl +0 -0
  161. data/tcl/BWidget-1.8.0/spinbox.tcl +0 -0
  162. data/tcl/BWidget-1.8.0/statusbar.tcl +0 -0
  163. data/tcl/BWidget-1.8.0/tests/entry.test +0 -0
  164. data/tcl/BWidget-1.8.0/titleframe.tcl +0 -0
  165. data/tcl/BWidget-1.8.0/tree.tcl +0 -0
  166. data/tcl/BWidget-1.8.0/utils.tcl +0 -0
  167. data/tcl/BWidget-1.8.0/widget.tcl +0 -0
  168. data/tcl/BWidget-1.8.0/wizard.tcl +0 -0
  169. data/tcl/BWidget-1.8.0/xpm2image.tcl +0 -0
  170. metadata +136 -135
@@ -4,6 +4,7 @@
4
4
  #
5
5
 
6
6
  require "lib/a-commons"
7
+ require "tk/menu"
7
8
 
8
9
  class TkApplication < Application
9
10
  attr_reader :tcltk_info
@@ -192,9 +193,55 @@ class AGTkObjPlace
192
193
 
193
194
  end
194
195
 
196
+ class TkFrameAdapter < TkFrame
197
+ include TkMovable
198
+ attr_reader :frame
199
+ def initialize(scope_parent=nil, *args)
200
+ super(scope_parent, *args)
201
+ @scope_parent = scope_parent
202
+ @movable = true
203
+ end
204
+
205
+ def add_moved_by(_obj)
206
+ @movable = true
207
+ start_moving(_obj, self)
208
+ end
209
+
210
+ def detach_frame
211
+ if @frame
212
+ if @movable
213
+ @frame.bind_remove("Configure")
214
+ @frame.bind_remove("Map")
215
+ @frame.bind_remove("Unmap")
216
+ end
217
+ @frame = nil
218
+ self.unplace
219
+ end
220
+ end
221
+
222
+ def attach_frame(_frame)
223
+ @frame = _frame
224
+ refresh
225
+ if @movable
226
+ @frame.bind_append("Configure",proc{ refresh})
227
+ @frame.bind_append("Map",proc{refresh})
228
+ @frame.bind_append("Unmap",proc{unplace})
229
+ end
230
+ self
231
+ end
232
+
233
+
234
+ def refresh(_x=0, _y=0)
235
+ place('in'=>@frame, 'x'=>_x, 'y'=>_y, 'relheight'=> 1, 'relwidth'=>1, 'bordermode'=>'outside')
236
+ end
237
+
238
+ end
195
239
 
196
- class AGTkSplittedFrames < TkFrame
197
- def initialize(parent=nil, length=10, slen=5, keys=nil)
240
+
241
+ class AGTkSplittedFrames < TkFrameAdapter
242
+ attr_reader :frame1
243
+ attr_reader :frame2
244
+ def initialize(parent=nil, frame=nil, length=10, slen=5, keys=nil)
198
245
  if keys.nil?
199
246
  keys = Hash.new
200
247
  end
@@ -202,20 +249,22 @@ class AGTkSplittedFrames < TkFrame
202
249
  super(parent, keys)
203
250
  @parent = parent
204
251
  @slen = slen
205
- #relief 'groove'
252
+ if frame
253
+ self.attach_frame(frame)
254
+ end
206
255
  end
207
256
 
208
257
  def maximize(_frame)
209
- p = TkWinfo.parent(@parent)
258
+ p = TkWinfo.parent(@frame)
210
259
  if p.kind_of?(AGTkSplittedFrames)
211
- p.maximize(@parent)
260
+ p.maximize(@frame)
212
261
  end
213
262
  end
214
263
 
215
264
  def minimize(_frame)
216
- p = TkWinfo.parent(@parent)
265
+ p = TkWinfo.parent(@frame)
217
266
  if p.kind_of?(AGTkSplittedFrames)
218
- p.minimize(@parent)
267
+ p.minimize(@frame)
219
268
  end
220
269
  end
221
270
 
@@ -224,18 +273,19 @@ end
224
273
 
225
274
  class AGTkVSplittedFrames < AGTkSplittedFrames
226
275
  attr_reader :left_frame, :right_frame, :splitter_frame
227
- def initialize(parent=nil, width=10, slen=5, perc=false, keys=nil)
228
- super(parent, width, slen, keys)
276
+ def initialize(parent=nil, frame=nil, width=10, slen=5, perc=false, keys=nil)
277
+ super(parent, frame, width, slen, keys)
229
278
  #self.place('relheight'=>1, 'relwidth'=>1, 'bordermode'=>'outside' )
230
- self.pack(:expand=>true, :fill=>:both)
279
+ #self.pack(:expand=>true, :fill=>:both)
231
280
  @left_frame = TkFrame.new(self, Arcadia.style('panel')){
232
281
  #relief 'flat'
233
282
  }
283
+ @frame1 = @left_frame
234
284
  if perc
235
- p_width = TkWinfo.screenwidth(self)
285
+ p_width = TkWinfo.screenwidth(self)
236
286
  x = (p_width/100*width).to_i
237
287
  else
238
- x = width
288
+ x = width
239
289
  end
240
290
 
241
291
  @left_frame.place(
@@ -346,6 +396,7 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
346
396
  @right_frame = TkFrame.new(self, Arcadia.style('panel')){
347
397
  #relief 'flat'
348
398
  }
399
+ @frame2 = @right_frame
349
400
  @right_frame.place(
350
401
  'relwidth' => 1,
351
402
  'relx' => 0,
@@ -394,6 +445,7 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
394
445
  @last = @left_frame_obj.w
395
446
  end
396
447
  @left_frame_obj.amove(0,0)
448
+ @left_frame_obj.obj.place_forget if @state=='right'
397
449
  @splitter_frame_obj.amove(_w,0)
398
450
  @right_frame_obj.width = - _w - @slen
399
451
  @right_frame_obj.amove(_w + @slen,0)
@@ -414,6 +466,7 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
414
466
  end
415
467
  @right_frame_obj.width = - _w - @slen
416
468
  @right_frame_obj.amove(_w + @slen,0)
469
+ @right_frame_obj.obj.unplace if @state=='left'
417
470
  @splitter_frame_obj.amove(_w,0)
418
471
  @left_frame_obj.width = _w
419
472
  @left_frame_obj.go(_w,0)
@@ -450,21 +503,22 @@ class AGTkVSplittedFrames < AGTkSplittedFrames
450
503
  end
451
504
 
452
505
  class AGTkOSplittedFrames < AGTkSplittedFrames
453
- attr_reader :top_frame, :bottom_frame
454
- def initialize(parent=nil, height=10, slen=5, perc=false, keys=nil)
455
- super(parent, height, slen, keys)
456
- self.place(
457
- 'relwidth' => 1,
458
- 'relx' => 0,
459
- 'x' => 0,
460
- 'y' => 0,
461
- 'relheight' => 1,
462
- 'rely' => 0,
463
- 'bordermode' => 'inside'
464
- )
506
+ attr_reader :top_frame, :bottom_frame, :splitter_frame
507
+ def initialize(parent=nil, frame=nil, height=10, slen=5, perc=false, keys=nil)
508
+ super(parent, frame, height, slen, keys)
509
+ # self.place(
510
+ # 'relwidth' => 1,
511
+ # 'relx' => 0,
512
+ # 'x' => 0,
513
+ # 'y' => 0,
514
+ # 'relheight' => 1,
515
+ # 'rely' => 0,
516
+ # 'bordermode' => 'inside'
517
+ # )
465
518
  @top_frame = TkFrame.new(self, Arcadia.style('panel')){
466
519
  # relief 'flat'
467
520
  }
521
+ @frame1 = @top_frame
468
522
  if perc
469
523
  p_height = TkWinfo.screenheight(self)
470
524
  y = (p_height/100*height).to_i
@@ -476,6 +530,7 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
476
530
  'bordermode' => 'inside',
477
531
  'height' => y
478
532
  )
533
+
479
534
  @top_frame_obj = AGTkObjPlace.new(@top_frame, 'y', nil, false)
480
535
  @top_frame_obj.width = 0
481
536
  @top_frame_obj.height = y
@@ -511,6 +566,7 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
511
566
  @bottom_frame = TkFrame.new(self, Arcadia.style('panel')){
512
567
  # relief 'flat'
513
568
  }
569
+ @frame2 = @bottom_frame
514
570
  @bottom_frame.place(
515
571
  'relwidth' => 1,
516
572
  'relx' => 0,
@@ -576,6 +632,7 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
576
632
  @last = @top_frame_obj.h
577
633
  end
578
634
  @top_frame_obj.amove(0,0)
635
+ @top_frame_obj.obj.unplace if @state=='bottom'
579
636
  @splitter_frame_obj.amove(0, _h)
580
637
  @bottom_frame_obj.height = - _h - @slen
581
638
  @bottom_frame_obj.amove(0,_h + @slen)
@@ -594,6 +651,7 @@ class AGTkOSplittedFrames < AGTkSplittedFrames
594
651
  end
595
652
  @bottom_frame_obj.height = - _h - @slen
596
653
  @bottom_frame_obj.amove(0,_h + @slen)
654
+ @bottom_frame_obj.obj.unplace if @state=='top'
597
655
  @splitter_frame_obj.amove(0,_h)
598
656
  @top_frame_obj.height = _h
599
657
  @top_frame_obj.go(0,_h)
@@ -659,24 +717,18 @@ class TkBaseTitledFrame < TkFrame
659
717
  #anchor 'w'
660
718
  }.place('x'=>0, 'y'=>0,'height'=>@title_height, 'relwidth'=>1)
661
719
  #.pack('fill'=> 'x','ipady'=> @title_height, 'side'=>'top')
662
-
663
-
664
720
  @frame = create_frame
665
-
666
-
667
-
668
721
  @button_frame=TkFrame.new(@top){
669
722
  #background '#303b50'
670
723
  background Arcadia.conf('titlelabel.background')
671
724
  }.pack('side'=> 'right','anchor'=> 'w')
672
-
725
+ @buttons = Hash.new
726
+ @menu_buttons = Hash.new
673
727
  self.head_buttons
674
728
  end
675
729
 
676
730
  def create_frame
677
731
  return TkFrame.new(self,Arcadia.style('panel')).place('x'=>0, 'y'=>@title_height,'height'=>-@title_height,'relheight'=>1, 'relwidth'=>1)
678
- #pack('fill'=>'both','expand'=> 1, 'anchor'=>'center')
679
- #
680
732
  end
681
733
 
682
734
  def add_button(_label,_proc=nil,_image=nil, _side= 'right')
@@ -693,6 +745,28 @@ class TkBaseTitledFrame < TkFrame
693
745
  }
694
746
  end
695
747
 
748
+ def add_menu_button(_name='default',_image=nil, _side= 'right')
749
+ @menu_buttons[_name] = TkMenuButton.new(@button_frame, Arcadia.style('titlelabel')){|mb|
750
+ indicatoron true
751
+ menu TkMenu.new(mb, Arcadia.style('titlemenu'))
752
+ # menu TkMenu.new(:parent=>mb, Arcadia.style('titlemenu'))
753
+ # menu TkMenu.new(:parent=>mb,
754
+ # :tearoff=>0,
755
+ # :background=>Arcadia.style('titlelabel')['background'],
756
+ # :foreground=>Arcadia.style('titlelabel')['foreground']
757
+ # )
758
+ if _image
759
+ image TkPhotoImage.new('dat' => _image)
760
+ end
761
+ pack('side'=> _side,'anchor'=> 'e')
762
+ }
763
+ @menu_buttons[_name]
764
+ end
765
+
766
+ def menu_button(_name='default')
767
+ @menu_buttons[_name]
768
+ end
769
+
696
770
  def head_buttons
697
771
  @bmaxmin = add_button('[ ]',proc{resize}, W_MAX_GIF)
698
772
  end
@@ -702,8 +776,9 @@ end
702
776
 
703
777
 
704
778
  class TkTitledFrame < TkBaseTitledFrame
705
- attr_reader :frame
779
+ attr_accessor :frame
706
780
  attr_reader :top
781
+ attr_reader :parent
707
782
 
708
783
  def initialize(parent=nil, title=nil, img=nil , keys=nil)
709
784
  super(parent, keys)
@@ -712,12 +787,6 @@ class TkTitledFrame < TkBaseTitledFrame
712
787
  @title_label =TkLabel.new(@top, Arcadia.style('titlelabel')){
713
788
  text _text_title
714
789
  anchor 'w'
715
- #font $arcadia['conf']['all.frame.title.font']
716
- # background '#303b50'
717
- # foreground '#e8e651'
718
- # font Arcadia.conf('titlepanel.font')
719
- # background Arcadia.conf('titlepanel.background')
720
- # foreground Arcadia.conf('titlepanel.foreground')
721
790
  compound 'left'
722
791
  image TkAllPhotoImage.new('file' => img) if img
723
792
  pack('side'=> 'left','anchor'=> 'e')
@@ -737,14 +806,30 @@ class TkTitledFrame < TkBaseTitledFrame
737
806
  @aph = Array.new
738
807
  end
739
808
 
740
- def top_text(_text)
741
- @top_label.text(_text)
809
+ def title(_text=nil)
810
+ if _text.nil?
811
+ return @title
812
+ else
813
+ @title=_text
814
+ if _text.strip.length == 0
815
+ @title_label.text('')
816
+ else
817
+ @title_label.text(_text+'::')
818
+ end
819
+ end
742
820
  end
743
821
 
744
- def title(_text)
745
- @title_label.text(_text+'::')
822
+ def top_text(_text=nil)
823
+ if _text.nil?
824
+ return @top_label.text
825
+ else
826
+ @top_label.text(_text)
827
+ end
746
828
  end
747
829
 
830
+ # def top_text(_text)
831
+ # @top_label.text(_text)
832
+ # end
748
833
 
749
834
  def add_sep(_width=0,_background =@top.background)
750
835
  TkLabel.new(@top){||
@@ -808,6 +893,115 @@ class TkTitledFrame < TkBaseTitledFrame
808
893
  end
809
894
  end
810
895
 
896
+
897
+
898
+ #class TkFrameAdapterOld < TkFrame
899
+ # include TkMovable
900
+ # attr_reader :frame
901
+ # def initialize(god_parent=nil, *args)
902
+ # super(god_parent, *args)
903
+ # @god_parent = god_parent
904
+ # #add_moved_by(self)
905
+ # end
906
+ #
907
+ # def add_moved_by(_obj)
908
+ # start_moving(_obj, self)
909
+ # end
910
+ #
911
+ # def detach_frame
912
+ # if @frame
913
+ # @frame.bind_remove("Configure")
914
+ # @frame.bind_remove("Map")
915
+ # @frame.bind_remove("Unmap")
916
+ # @frame = nil
917
+ # end
918
+ # end
919
+ #
920
+ # def attach_frame(_frame)
921
+ # @frame = _frame
922
+ # init
923
+ # #update
924
+ # reset
925
+ # @frame.bind_append("Configure",proc{|x,y,w,h| refresh(x,y,w,h)}, "%x %y %w %h")
926
+ # @frame.bind_append("Map",proc{refresh})
927
+ # @frame.bind_append("Unmap",proc{unplace})
928
+ # self
929
+ # end
930
+ #
931
+ # def init
932
+ # @last_x = 0
933
+ # @last_y = 0
934
+ # @last_w = 100
935
+ # @last_h = 100
936
+ # reset_offset
937
+ # end
938
+ #
939
+ # def reset
940
+ # w = TkPlace.info(@frame)['width']
941
+ # h = TkPlace.info(@frame)['height']
942
+ # x = TkPlace.info(@frame)['x']
943
+ # y = TkPlace.info(@frame)['y']
944
+ # refresh(x,y,w,h)
945
+ # end
946
+ #
947
+ # def reset_offset
948
+ # @x0=0
949
+ # @y0=0
950
+ # parent = TkWinfo.parent(@frame)
951
+ # #parent = @frame
952
+ # while parent != nil && parent != @god_parent
953
+ # xc = TkPlace.info(parent)['x']
954
+ # yc = TkPlace.info(parent)['y']
955
+ # @x0=@x0+xc if xc
956
+ # @y0=@y0+yc if yc
957
+ # parent= TkWinfo.parent(parent)
958
+ # end
959
+ # end
960
+ #
961
+ # def refresh(_x=nil, _y=nil, _w=nil, _h=nil)
962
+ # reset_offset
963
+ # _x=@last_x if _x.nil?
964
+ # _y=@last_y if _y.nil?
965
+ # _w=@last_w if _w.nil?
966
+ # _h=@last_h if _h.nil?
967
+ # @last_x = _x
968
+ # @last_y = _y
969
+ # @last_w = _w
970
+ # @last_h = _h
971
+ # place('x'=>_x+@x0, 'y'=>_y+@y0, 'width'=>_w, 'height'=> _h, 'bordermode'=>'outside')
972
+ # #place('in'=>@frame, 'relheight'=> 1, 'bordermode'=>'outside', 'relwidth'=>1)
973
+ # end
974
+ #end
975
+
976
+
977
+ #class TkTitledMovableFrame < TkTitledFrame
978
+ # attr_reader :wrapper
979
+ # def initialize(root_parent=nil, parent=nil, title=nil, img=nil , keys=nil)
980
+ # @root_parent = root_parent
981
+ # #@wrapper = TkFrameAdapter.new(@root_parent, 'background'=>'red')
982
+ # @wrapper = TkFrameAdapter.new(@root_parent, Arcadia.style('frame'))
983
+ # super(parent, title, img, keys)
984
+ # #@wrapper.add_moved_by(@top)
985
+ # @wrapper.attach_frame(@frame)
986
+ # @frame=@wrapper
987
+ # end
988
+ #
989
+ # def change_wrapper(_new_wrapper)
990
+ # @wrapper = _new_wrapper
991
+ # @frame = _new_wrapper
992
+ # end
993
+ #
994
+ # # def initialize(root_parent=nil, parent=nil, title=nil, img=nil , keys=nil)
995
+ # # @root_parent = root_parent
996
+ # # @wrapper = TkFrameAdapter.new(@root_parent, Arcadia.style('frame'))
997
+ # # super(@wrapper, title, img, keys)
998
+ # # @wrapped_frame=parent
999
+ # # #@wrapper.add_moved_by(@top)
1000
+ # # @wrapper.attach_frame(parent)
1001
+ # # end
1002
+ #
1003
+ #end
1004
+
811
1005
  class TkTitledScrollFrame < TkTitledFrame
812
1006
 
813
1007
  def create_frame
@@ -816,6 +1010,8 @@ class TkTitledScrollFrame < TkTitledFrame
816
1010
 
817
1011
  end
818
1012
 
1013
+
1014
+
819
1015
  class TkResizingTitledFrame < TkFrame
820
1016
  include TkResizable
821
1017
  def initialize(parent=nil, *args)
@@ -882,6 +1078,7 @@ class TkFloatTitledFrame < TkBaseTitledFrame
882
1078
  if @manager == 'place'
883
1079
  self.place('x'=>@x_place, 'y'=>@y_place, 'width'=>@width_place, 'height'=>@height_place)
884
1080
  end
1081
+ self.raise
885
1082
  end
886
1083
 
887
1084
  def show_grabbed
File without changes
File without changes