arcadia 0.8.1 → 0.9.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 (163) hide show
  1. data/README +28 -22
  2. data/bin/arcadia +3 -3
  3. data/conf/arcadia.conf +87 -36
  4. data/conf/arcadia.res.rb +143 -5
  5. data/conf/theme-dark.conf +94 -0
  6. data/conf/theme-dark.res.rb +218 -0
  7. data/ext/ae-breakpoints/ae-breakpoints.rb +1 -0
  8. data/ext/ae-dir-projects/ae-dir-projects.rb +37 -9
  9. data/ext/ae-editor/ae-editor.conf +10 -9
  10. data/ext/ae-editor/ae-editor.rb +306 -127
  11. data/ext/ae-editor/langs/pers.lang.bind +1 -0
  12. data/ext/ae-editor/langs/rb.lang +6 -6
  13. data/ext/ae-editor/langs/tcl.lang +3 -0
  14. data/ext/ae-file-history/ae-file-history.rb +4 -11
  15. data/ext/ae-output/ae-output.rb +57 -38
  16. data/ext/ae-rad/ae-rad-inspector.rb +1 -1
  17. data/ext/ae-rad/ae-rad-palette.rb +2 -2
  18. data/ext/ae-rad/ae-rad.rb +7 -7
  19. data/ext/ae-rad/lib/tk/al-tk.rb +3 -3
  20. data/ext/ae-rad/lib/tk/al-tkcustom.rb +2 -2
  21. data/ext/ae-ruby-debug/ae-ruby-debug.conf +20 -1
  22. data/ext/ae-ruby-debug/ae-ruby-debug.rb +69 -65
  23. data/ext/ae-search-in-files/ae-search-in-files.rb +2 -17
  24. data/ext/ae-shell/ae-shell.conf +7 -6
  25. data/ext/ae-shell/ae-shell.rb +211 -32
  26. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.conf +11 -0
  27. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +109 -0
  28. data/lib/a-commons.rb +74 -16
  29. data/lib/a-contracts.rb +18 -1
  30. data/lib/a-core.rb +410 -77
  31. data/lib/a-tkcommons.rb +338 -138
  32. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ArrowButton.html +0 -0
  33. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/BWidget.html +2 -2
  34. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Button.html +0 -0
  35. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ButtonBox.html +0 -0
  36. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ComboBox.html +0 -0
  37. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Dialog.html +0 -0
  38. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DragSite.html +0 -0
  39. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DropSite.html +0 -0
  40. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/DynamicHelp.html +0 -0
  41. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Entry.html +0 -0
  42. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Label.html +0 -0
  43. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/LabelEntry.html +0 -0
  44. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/LabelFrame.html +0 -0
  45. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ListBox.html +1 -4
  46. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/MainFrame.html +0 -0
  47. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/MessageDlg.html +0 -0
  48. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/NoteBook.html +0 -0
  49. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PagesManager.html +0 -0
  50. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PanedWindow.html +0 -0
  51. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PanelFrame.html +0 -0
  52. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/PasswdDlg.html +0 -0
  53. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ProgressBar.html +0 -0
  54. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ProgressDlg.html +0 -0
  55. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrollView.html +0 -0
  56. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrollableFrame.html +0 -0
  57. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/ScrolledWindow.html +0 -0
  58. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SelectColor.html +0 -0
  59. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SelectFont.html +0 -0
  60. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Separator.html +0 -0
  61. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/SpinBox.html +0 -0
  62. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/StatusBar.html +0 -0
  63. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/TitleFrame.html +0 -0
  64. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Tree.html +0 -0
  65. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/Widget.html +0 -0
  66. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/contents.html +0 -0
  67. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/index.html +0 -0
  68. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/navtree.html +0 -0
  69. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/BWman/options.htm +0 -0
  70. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/CHANGES.txt +0 -0
  71. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/ChangeLog +70 -0
  72. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/LICENSE.txt +0 -0
  73. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/README.txt +0 -0
  74. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/arrow.tcl +0 -0
  75. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/bitmap.tcl +0 -0
  76. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/button.tcl +0 -0
  77. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/buttonbox.tcl +0 -0
  78. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/color.tcl +0 -0
  79. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/combobox.tcl +4 -4
  80. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/basic.tcl +0 -0
  81. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/bwidget.xbm +0 -0
  82. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/demo.tcl +0 -0
  83. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/dnd.tcl +0 -0
  84. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/manager.tcl +0 -0
  85. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/select.tcl +0 -0
  86. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/tmpldlg.tcl +0 -0
  87. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/tree.tcl +0 -0
  88. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/demo/x1.xbm +0 -0
  89. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dialog.tcl +0 -0
  90. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dragsite.tcl +0 -0
  91. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dropsite.tcl +0 -0
  92. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/dynhelp.tcl +25 -18
  93. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/entry.tcl +0 -0
  94. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/font.tcl +0 -0
  95. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/bold.gif +0 -0
  96. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/copy.gif +0 -0
  97. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/cut.gif +0 -0
  98. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/dragfile.gif +0 -0
  99. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/dragicon.gif +0 -0
  100. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/error.gif +0 -0
  101. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/file.gif +0 -0
  102. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/folder.gif +0 -0
  103. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/hourglass.gif +0 -0
  104. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/info.gif +0 -0
  105. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/italic.gif +0 -0
  106. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/minus.xbm +0 -0
  107. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/new.gif +0 -0
  108. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/opcopy.xbm +0 -0
  109. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/open.gif +0 -0
  110. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/openfold.gif +0 -0
  111. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/oplink.xbm +0 -0
  112. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/opmove.xbm +0 -0
  113. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/overstrike.gif +0 -0
  114. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/palette.gif +0 -0
  115. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/passwd.gif +0 -0
  116. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/paste.gif +0 -0
  117. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/plus.xbm +0 -0
  118. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/print.gif +0 -0
  119. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/question.gif +0 -0
  120. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/redo.gif +0 -0
  121. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/save.gif +0 -0
  122. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/target.xbm +0 -0
  123. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/underline.gif +0 -0
  124. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/undo.gif +0 -0
  125. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/images/warning.gif +0 -0
  126. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/init.tcl +0 -0
  127. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/label.tcl +0 -0
  128. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/labelentry.tcl +0 -0
  129. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/labelframe.tcl +0 -0
  130. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/da.rc +0 -0
  131. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/de.rc +0 -0
  132. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/en.rc +0 -0
  133. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/es.rc +0 -0
  134. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/fr.rc +0 -0
  135. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/hu.rc +0 -0
  136. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/nl.rc +0 -0
  137. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/lang/no.rc +0 -0
  138. data/tcl/BWidget-1.9.2/lang/pl.rc +104 -0
  139. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/listbox.tcl +68 -35
  140. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/mainframe.tcl +0 -0
  141. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/messagedlg.tcl +0 -0
  142. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/notebook.tcl +2 -2
  143. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/pagesmgr.tcl +0 -0
  144. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/panedw.tcl +0 -0
  145. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/panelframe.tcl +0 -0
  146. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/passwddlg.tcl +0 -0
  147. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/pkgIndex.tcl +2 -2
  148. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/progressbar.tcl +0 -0
  149. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/progressdlg.tcl +0 -0
  150. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollframe.tcl +0 -0
  151. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollview.tcl +0 -0
  152. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/scrollw.tcl +0 -0
  153. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/separator.tcl +0 -0
  154. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/spinbox.tcl +0 -0
  155. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/statusbar.tcl +0 -0
  156. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/tests/entry.test +0 -0
  157. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/titleframe.tcl +0 -0
  158. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/tree.tcl +6 -1
  159. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/utils.tcl +27 -7
  160. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/widget.tcl +0 -0
  161. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/wizard.tcl +0 -0
  162. data/tcl/{BWidget-1.9.0 → BWidget-1.9.2}/xpm2image.tcl +0 -0
  163. metadata +162 -153
@@ -67,12 +67,14 @@ class FixedFrameWrapper < AbstractFrameWrapper
67
67
  attr_accessor :domain
68
68
  attr_reader :name
69
69
  attr_reader :title
70
- attr_reader :extension
71
- def initialize(_extension, _domain, _name, _title='')
70
+ attr_reader :extension_name
71
+ def initialize(_extension, _domain, _name, _title='', _index=0)
72
72
  @extension = _extension
73
+ @extension_name = _extension.name
73
74
  @domain =_domain
74
75
  @name = _name
75
76
  @title = _title
77
+ @index = _index
76
78
  fixed_frame_forge
77
79
  end
78
80
 
@@ -96,6 +98,16 @@ class FixedFrameWrapper < AbstractFrameWrapper
96
98
  fixed_frame_forge
97
99
  Arcadia.layout.raise_panel(@domain, @name)
98
100
  end
101
+
102
+ def show_anyway
103
+ self.show
104
+ if !Arcadia.layout.registered_panel?(self)
105
+ if domain.nil?
106
+ self.domain = @extension.frame_domain_default(@index)
107
+ end
108
+ Arcadia.layout.register_panel(self, self.hinner_frame)
109
+ end
110
+ end
99
111
 
100
112
  def hide
101
113
  end
@@ -188,6 +200,7 @@ end
188
200
 
189
201
  class ArcadiaExt
190
202
  attr_reader :arcadia
203
+ attr_reader :name
191
204
  def initialize(_arcadia, _name=nil)
192
205
  @arcadia = _arcadia
193
206
  @arcadia.register(self)
@@ -226,11 +239,37 @@ class ArcadiaExt
226
239
  if @frames[_n] == nil && @frames_points[_n] && create_if_not_exist
227
240
  (@frames_labels[_n].nil?)? _label = @name : _label = @frames_labels[_n]
228
241
  (@frames_names[_n].nil?)? _name = @name : _name = @frames_names[_n]
229
- @frames[_n] = FixedFrameWrapper.new(@name, @frames_points[_n], _name, _label)
242
+ @frames[_n] = FixedFrameWrapper.new(self, @frames_points[_n], _name, _label, _n)
230
243
  end
231
244
  return @frames[_n]
232
245
  end
233
246
 
247
+ def frame_domain(_n=0)
248
+ if conf('frames')
249
+ frs = conf('frames').split(',')
250
+ else
251
+ frs = Array.new
252
+ end
253
+ ret = nil
254
+ if frs.length > _n
255
+ ret = frs[_n]
256
+ end
257
+ ret
258
+ end
259
+
260
+ def frame_domain_default(_n=0)
261
+ if conf_default('frames')
262
+ frs = conf_default('frames').split(',')
263
+ else
264
+ frs = Array.new
265
+ end
266
+ ret = nil
267
+ if frs.length > _n
268
+ ret = frs[_n]
269
+ end
270
+ ret
271
+ end
272
+
234
273
  def float_frame(_n=0, _args=nil)
235
274
  if @float_frames[_n].nil?
236
275
  (@float_labels[_n].nil?)? _label = @name : _label = @float_labels[_n]
@@ -243,6 +282,16 @@ class ArcadiaExt
243
282
  @arcadia['conf'][@name+'.'+_property]
244
283
  end
245
284
 
285
+ def conf_default(_property)
286
+ @arcadia['conf_without_local'][@name+'.'+_property]
287
+ end
288
+
289
+ def restore_default_conf(_property)
290
+ if @arcadia['conf'][@name+'.'+_property] && @arcadia['conf_without_local'][@name+'.'+_property]
291
+ @arcadia['conf'][@name+'.'+_property] = @arcadia['conf_without_local'][@name+'.'+_property]
292
+ end
293
+ end
294
+
246
295
  # def conf_global(_property)
247
296
  # @arcadia['conf'][_property]
248
297
  # end
@@ -311,7 +360,7 @@ class Event
311
360
  if _args
312
361
  _args.each do |key, value|
313
362
  #self.send(key, value)
314
- self.send(key+'=', value)
363
+ self.send(key.to_s+'=', value) if self.respond_to?(key.to_s)
315
364
  end
316
365
  end
317
366
  @time = Time.new
@@ -526,20 +575,28 @@ module Configurable
526
575
  end
527
576
  end
528
577
 
529
- def Configurable.properties_group(_group, _hash_source)
578
+ # def one_line_format_as_hash(_line)
579
+ # ret = Hash.new
580
+ # end
581
+ #
582
+ # def hash_as_one_line_format(_name, _hash)
583
+ # end
584
+
585
+ def Configurable.properties_group(_group, _hash_source, _hash_suff='conf', _refresh=false)
586
+ group_key="#{_hash_suff}.#{_group}"
530
587
  @@conf_groups = Hash.new if !defined?(@@conf_groups)
531
- if @@conf_groups[_group].nil?
532
- @@conf_groups[_group] = Hash.new
588
+ if @@conf_groups[group_key].nil? || _refresh
589
+ @@conf_groups[group_key] = Hash.new
533
590
  glen=_group.length
534
591
  _hash_source.keys.sort.each{|k|
535
592
  if k[0..glen] == "#{_group}."
536
- @@conf_groups[_group][k[glen+1..-1]]=_hash_source[k]
537
- elsif @@conf_groups[_group].length > 0
593
+ @@conf_groups[group_key][k[glen+1..-1]]=_hash_source[k]
594
+ elsif @@conf_groups[group_key].length > 0
538
595
  break
539
596
  end
540
597
  }
541
598
  end
542
- Hash.new.update(@@conf_groups[_group])
599
+ Hash.new.update(@@conf_groups[group_key])
543
600
  end
544
601
 
545
602
  def resolve_link(_value, _hash_source, _link_symbol='>>>', _add_symbol='+++')
@@ -687,15 +744,16 @@ class Application
687
744
  "[Platform = #{RUBY_PLATFORM}]\n[Ruby version = #{RUBY_VERSION}]"
688
745
  end
689
746
 
690
- def Application.conf_group(_group)
747
+ def Application.conf_group(_group, _suff = 'conf')
748
+ group_key="#{_hash_suff}.#{_group}"
691
749
  @@conf_groups = Hash.new if !defined?(@@conf_groups)
692
- if @@conf_groups[_group].nil?
693
- @@conf_groups[_group] = Hash.new
750
+ if @@conf_groups[group_key].nil?
751
+ @@conf_groups[group_key] = Hash.new
694
752
  glen=_group.length
695
753
  @@instance['conf'].keys.sort.each{|k|
696
754
  if k[0..glen] == "#{_group}."
697
- @@conf_groups[_group][k[glen+1..-1]]=@@instance['conf'][k]
698
- elsif @@conf_groups[_group].length > 0
755
+ @@conf_groups[group_key][k[glen+1..-1]]=@@instance['conf'][k]
756
+ elsif @@conf_groups[group_key].length > 0
699
757
  break
700
758
  end
701
759
  }
@@ -791,7 +849,7 @@ class Application
791
849
  self['conf_theme'] = self.properties_file2hash(_theme_file)
792
850
  self['conf'].update(self['conf_theme'])
793
851
  self['conf_without_local'].update(self['conf_theme'])
794
- _theme_res_file = "conf/theme-#{_name}.res.rb"
852
+ _theme_res_file = "#{Dir.pwd}/conf/theme-#{_name}.res.rb"
795
853
  if _theme_res_file && File.exist?(_theme_res_file)
796
854
  begin
797
855
  require _theme_res_file
@@ -177,9 +177,14 @@ end
177
177
  # +---------------------------------------------+
178
178
 
179
179
  class MsgEvent < ArcadiaEvent
180
- attr_accessor :msg, :level
180
+ attr_accessor :msg, :level, :mark, :append
181
181
  end
182
182
 
183
+ class SubProcessEvent < ArcadiaEvent
184
+ attr_accessor :abort_action, :alive_check, :name, :pid, :timeout, :timecheck
185
+ end
186
+
187
+
183
188
  #class DebugMsgEvent < MsgEvent
184
189
  #end
185
190
  #
@@ -223,6 +228,18 @@ class RunRubyFileEvent < ArcadiaEvent
223
228
  attr_accessor :persistent
224
229
  end
225
230
 
231
+ class RunCmdEvent < ArcadiaEvent
232
+ class Result < Result
233
+ attr_accessor :output
234
+ end
235
+ attr_accessor :file
236
+ attr_accessor :dir
237
+ attr_accessor :cmd
238
+ attr_accessor :title
239
+ attr_accessor :persistent
240
+ attr_accessor :runner_name
241
+ end
242
+
226
243
  class InputEvent < ArcadiaEvent
227
244
  end
228
245
 
@@ -8,28 +8,35 @@
8
8
  # &require_omissis=tk/label
9
9
  # &require_omissis=tk/toplevel
10
10
 
11
- require "conf/arcadia.res"
11
+ require "#{Dir.pwd}/conf/arcadia.res"
12
12
  require 'tkextlib/bwidget'
13
- require "lib/a-tkcommons"
14
- require "lib/a-contracts"
13
+ require "#{Dir.pwd}/lib/a-tkcommons"
14
+ require "#{Dir.pwd}/lib/a-contracts"
15
15
  require "observer"
16
16
 
17
17
  class Arcadia < TkApplication
18
18
  include Observable
19
19
  attr_reader :layout
20
+ attr_reader :wf
20
21
  def initialize
21
22
  super(
22
23
  ApplicationParams.new(
23
24
  'arcadia',
24
- '0.8.1',
25
+ '0.9.0',
25
26
  'conf/arcadia.conf',
26
27
  'conf/arcadia.pers'
27
28
  )
28
- )
29
+ )
29
30
  load_config
30
31
  if self['conf']['encoding']
31
32
  Tk.encoding=self['conf']['encoding']
32
33
  end
34
+ # @use_splash = self['conf']['splash.show']=='yes'
35
+ # @splash = ArcadiaAboutSplash.new if @use_splash
36
+ # @splash.set_progress(50) if @splash
37
+ # @splash.deiconify if @splash
38
+ # Tk.update
39
+ @wf = TkWidgetFactory.new
33
40
  ArcadiaDialogManager.new(self)
34
41
  ArcadiaActionDispatcher.new(self)
35
42
  ArcadiaGemsWizard.new(self)
@@ -303,7 +310,7 @@ class Arcadia < TkApplication
303
310
  begin
304
311
  source = self['conf'][_extension+'.require']
305
312
  if source.strip.length > 0
306
- require source
313
+ require "#{Dir.pwd}/#{source}"
307
314
  end
308
315
  @exts_loaded << _extension
309
316
  rescue Exception,LoadError
@@ -435,12 +442,18 @@ class Arcadia < TkApplication
435
442
  self.load_exts_conf
436
443
  self.load_local_config
437
444
  self.load_theme(self['conf']['theme'])
438
- self.load_sysdefaultproperty
439
445
  self.resolve_properties_link(self['conf'],self['conf'])
440
446
  self.resolve_properties_link(self['conf_without_local'],self['conf_without_local'])
447
+ self.load_sysdefaultproperty
441
448
  end
442
449
 
443
450
  def load_sysdefaultproperty
451
+ # colors = Hash.new
452
+ # colors['background']=self['conf']['background']
453
+ # colors['foreground']=self['conf']['foreground']
454
+ #
455
+ # TkPalette.set(colors)
456
+
444
457
  Tk.tk_call "eval","option add *background #{self['conf']['background']}"
445
458
  Tk.tk_call "eval","option add *foreground #{self['conf']['foreground']}"
446
459
  #Tk.tk_call "eval","option add *font #{self['conf']['font']}"
@@ -489,8 +502,8 @@ class Arcadia < TkApplication
489
502
 
490
503
  #load user controls
491
504
  #Arcadia control
492
- load_user_control(@main_menu)
493
505
  load_user_control(@main_toolbar)
506
+ load_user_control(@main_menu)
494
507
  #Extension control
495
508
  load_key_binding
496
509
  @exts.each{|ext|
@@ -501,9 +514,102 @@ class Arcadia < TkApplication
501
514
  }
502
515
  load_user_control(@main_menu,"","e")
503
516
  load_user_control(@main_toolbar,"","e")
517
+ load_runners
504
518
  #@layout.build_invert_menu
505
519
  end
520
+
521
+ def load_runners
522
+ self['runners'] = Hash.new
523
+ self['runners_by_ext'] = Hash.new
524
+ mr = Arcadia.menu_root('runcurr')
525
+ return if mr.nil?
526
+
527
+ insert_runner_item = proc{|name, run|
528
+ if run[:file_exts]
529
+ run[:file_exts].split(',').each{|ext|
530
+ self['runners_by_ext'][ext.strip.sub('.','')]=run
531
+ }
532
+ end
533
+ if run[:runner] && self['runners'][run[:runner]]
534
+ run = Hash.new.update(self['runners'][run[:runner]]).update(run)
535
+ #self['runners'][name]=run
536
+ end
537
+ _run_title = run[:title]
538
+ run[:title] = nil
539
+ run[:runner_name] = name
540
+ _command = proc{
541
+ _event = Arcadia.process_event(
542
+ RunCmdEvent.new(self, run)
543
+ )
544
+ }
545
+ mr.insert('0',
546
+ :command ,{
547
+ :image => Arcadia.file_icon(run[:file_exts]),
548
+ :label => _run_title,
549
+ :compound => 'left',
550
+ :command => _command
551
+ }
552
+ )
553
+ }
554
+
555
+ insert_runner_instance_item = proc{|name, run|
556
+ if run[:runner] && self['runners'][run[:runner]]
557
+ run = Hash.new.update(self['runners'][run[:runner]]).update(run)
558
+ #self['runners'][name]=run
559
+ end
560
+ _run_title = run[:title]
561
+ run[:title] = nil
562
+ run[:runner_name] = name
563
+ _command = proc{
564
+ _event = Arcadia.process_event(
565
+ RunCmdEvent.new(self, run)
566
+ )
567
+ }
568
+ mr.insert('0',
569
+ :command ,{
570
+ :image => Arcadia.file_icon(run[:file_exts]),
571
+ :label => _run_title,
572
+ :compound => 'left',
573
+ :command => _command
574
+ }
575
+ )
576
+ }
577
+
578
+ # conf runner
579
+ runs=Arcadia.conf_group('runners')
580
+ mr.insert('0', :separator) if runs && !runs.empty?
581
+
582
+ runs.each{|name, hash_string|
583
+ self['runners'][name]=eval hash_string
584
+ }
585
+
586
+ self['runners'].each{|name, run|
587
+ insert_runner_item.call(name, run)
588
+ }
589
+
590
+ # pers runner instance
591
+ runs=Arcadia.pers_group('runners')
592
+ mr.insert('0', :separator) if runs && !runs.empty?
593
+ pers_runner = Hash.new
594
+ runs.each{|name, hash_string|
595
+ pers_runner[name]=eval hash_string
596
+ }
597
+
598
+ pers_runner.each{|name, run|
599
+ insert_runner_instance_item.call(name, run)
600
+ }
601
+ end
602
+
603
+ def manage_runners
604
+ if !@runm
605
+ @runm = RunnerManager.new(Arcadia.layout.root)
606
+ @runm.on_close=proc{@runm.hide}
607
+ end
608
+ @runm.show
609
+ @runm.load_items
506
610
 
611
+ end
612
+
507
613
  def load_key_binding(_ext='')
508
614
  return unless _ext && ext_active?(_ext)
509
615
  if _ext.length > 0
@@ -557,6 +663,7 @@ class Arcadia < TkApplication
557
663
  suf1 = suf+'.'+group
558
664
  begin
559
665
  context_path = self['conf']["#{suf1}.context_path"]
666
+ rif = self['conf']["#{suf1}.rif"] == nil ? 'main': self['conf']["#{suf1}.rif"]
560
667
  context_underline = self['conf']["#{suf1}.context_underline"]
561
668
  items = self['conf'][suf1].split(',')
562
669
  items.each{|item|
@@ -569,15 +676,8 @@ class Arcadia < TkApplication
569
676
  item_args[k]= make_value(_self_on_eval, v)
570
677
  }
571
678
 
572
- # iprops.each{|k,v|
573
- # value = v.strip
574
- # if value[0..0]=='!'
575
- # item_args[k]=_self_on_eval.instance_eval(value[1..-1])
576
- # else
577
- # item_args[k]=value
578
- # end
579
- # }
580
679
  item_args['name'] = item if item_args['name'].nil?
680
+ item_args['rif'] = rif
581
681
  item_args['context'] = group
582
682
  item_args['context_path'] = context_path
583
683
  item_args['context_caption'] = groups_caption[gi] if groups_caption
@@ -603,7 +703,6 @@ class Arcadia < TkApplication
603
703
 
604
704
  end
605
705
 
606
-
607
706
  def do_exit
608
707
  q1 = conf('confirm-on-exit')!='yes' || (Arcadia.dialog(self,
609
708
  'type'=>'yes_no',
@@ -613,6 +712,7 @@ class Arcadia < TkApplication
613
712
  if q1 && can_exit?
614
713
  do_finalize
615
714
  @root.destroy
715
+ Tk.exit
616
716
  end
617
717
  end
618
718
 
@@ -704,8 +804,29 @@ class Arcadia < TkApplication
704
804
  end
705
805
 
706
806
  def Arcadia.console(_sender, _args=Hash.new)
707
- process_event(MsgEvent.new(_sender, _args))
807
+ _event = process_event(MsgEvent.new(_sender, _args))
808
+ _event.mark
708
809
  end
810
+
811
+ def Arcadia.file_extension(_filename=nil)
812
+ if _filename
813
+ _m = /(.*\.)(.*$)/.match(File.basename(_filename))
814
+ end
815
+ _ret = (_m && _m.length > 1)?_m[2]: nil
816
+ end
817
+
818
+ def Arcadia.runner_for_file(_filename=nil)
819
+ if @@instance
820
+ return @@instance['runners_by_ext'][Arcadia.file_extension(_filename)]
821
+ end
822
+ end
823
+
824
+ def Arcadia.runner(_name=nil)
825
+ if @@instance
826
+ return @@instance['runners'][_name]
827
+ end
828
+ end
829
+
709
830
 
710
831
  def Arcadia.dialog(_sender, _args=Hash.new)
711
832
  _event = process_event(DialogEvent.new(_sender, _args))
@@ -716,10 +837,19 @@ class Arcadia < TkApplication
716
837
  Configurable.properties_group(_class, Arcadia.instance['conf'])
717
838
  end
718
839
 
719
- def Arcadia.conf_group(_path)
720
- Configurable.properties_group(_path, Arcadia.instance['conf'])
840
+ def Arcadia.pers_group(_path, _refresh=false)
841
+ Configurable.properties_group(_path, Arcadia.instance['pers'], 'pers', _refresh)
842
+ end
843
+
844
+ def Arcadia.conf_group(_path, _refresh=false)
845
+ Configurable.properties_group(_path, Arcadia.instance['conf'], 'conf', _refresh)
721
846
  end
722
847
 
848
+ def Arcadia.runner(_name)
849
+ @@instance['runners'][_name] if @@instance
850
+ end
851
+
852
+
723
853
  def Arcadia.persistent(_property, _value=nil, _immediate=false)
724
854
  if @@instance
725
855
  if _value.nil?
@@ -733,11 +863,26 @@ class Arcadia < TkApplication
733
863
  end
734
864
  end
735
865
 
866
+ def Arcadia.unpersistent(_property, _immediate=false)
867
+ if @@instance
868
+ @@instance['pers'].delete(_property)
869
+ if _immediate
870
+ # not yet supported
871
+ end
872
+ end
873
+ end
874
+
736
875
  def Arcadia.layout
737
876
  if @@instance
738
877
  return @@instance.layout
739
878
  end
740
879
  end
880
+
881
+ def Arcadia.wf
882
+ if @@instance
883
+ return @@instance.wf
884
+ end
885
+ end
741
886
 
742
887
  def Arcadia.open_file_dialog
743
888
  Tk.getOpenFile 'initialdir' => MonitorLastUsedDir.get_last_dir
@@ -747,8 +892,19 @@ class Arcadia < TkApplication
747
892
  RUBY_PLATFORM =~ /mingw|mswin/
748
893
  end
749
894
 
895
+ def Arcadia.menu_root(_menu_root_name, _menu_root=nil)
896
+ if @@instance['menu_roots'] == nil
897
+ @@instance['menu_roots'] = Hash.new
898
+ end
899
+ if _menu_root != nil
900
+ @@instance['menu_roots'][_menu_root_name]= _menu_root
901
+ end
902
+ @@instance['menu_roots'][_menu_root_name]
903
+ end
904
+
750
905
 
751
906
  def Arcadia.file_icon(_file_name)
907
+ _file_name = '' if _file_name.nil?
752
908
  if @@instance['file_icons'] == nil
753
909
  @@instance['file_icons'] = Hash.new
754
910
  @@instance['file_icons']['default']= TkPhotoImage.new('dat' => FILE_ICON_DEFAULT)
@@ -790,25 +946,32 @@ class ArcadiaUserControl
790
946
  SUF='user_control'
791
947
  class UserItem
792
948
  attr_accessor :name
949
+ attr_accessor :rif
793
950
  attr_accessor :context
794
951
  attr_accessor :context_caption
795
952
  attr_accessor :caption
796
953
  attr_accessor :hint
954
+ attr_accessor :action
797
955
  attr_accessor :event_class
798
956
  attr_accessor :event_args
799
957
  attr_accessor :image_data
958
+ attr_reader :item_obj
800
959
  def initialize(_sender, _args)
801
960
  @sender = _sender
802
961
  if _args
803
962
  _args.each do |key, value|
804
- self.send(key+'=', value)
963
+ self.send(key+'=', value) if self.respond_to?(key)
805
964
  end
806
965
  end
807
- #@item_obj = ?
966
+ if @action
967
+ @command = proc{Arcadia.process_event(_sender.instance_eval(@action))}
968
+ elsif @event_class
969
+ @command = proc{Arcadia.process_event(@event_class.new(_sender, @event_args))}
970
+ end
808
971
  end
809
972
 
810
973
  def method_missing(m, *args)
811
- if @item_obj && m.respond_to?(m)
974
+ if @item_obj && @item_obj.respond_to?(m)
812
975
  @item_obj.send(m, *args)
813
976
  end
814
977
  end
@@ -844,31 +1007,39 @@ class ArcadiaMainToolbar < ArcadiaUserControl
844
1007
  SUF='user_toolbar'
845
1008
  class UserItem < UserItem
846
1009
  attr_accessor :frame
1010
+ attr_accessor :menu_button
847
1011
  def initialize(_sender, _args)
848
1012
  super(_sender, _args)
849
1013
  _image = TkPhotoImage.new('data' => @image_data) if @image_data
850
- _command = proc{Arcadia.process_event(@event_class.new(_sender, @event_args))} if @event_class
1014
+ _command = @command #proc{Arcadia.process_event(@event_class.new(_sender, @event_args))} if @event_class
851
1015
  _hint = @hint
852
1016
  _font = @font
853
1017
  _caption = @caption
854
1018
  @item_obj = Tk::BWidget::Button.new(_args['frame'], Arcadia.style('toolbarbutton')){
855
1019
  image _image if _image
856
- #borderwidth 1
857
- #font _font if _font
858
- #activebackground Arcadia.conf('button.activebackground')
859
- #activeforeground Arcadia.conf('button.activeforeground')
860
- #background Arcadia.conf('button.background')
861
- #foreground Arcadia.conf('button.foreground')
862
- #highlightbackground Arcadia.conf('button.highlightbackground')
863
- #relief Arcadia.conf('button.relief')
864
1020
  command _command if _command
865
- #relief 'groove'
866
1021
  width 20
867
1022
  height 20
868
1023
  helptext _hint if _hint
869
1024
  text _caption if _caption
870
- pack('side' =>'left', :padx=>2, :pady=>0)
1025
+
871
1026
  }
1027
+ if _args['context_path'] && _args['last_item_for_context']
1028
+ @item_obj.pack('after'=>_args['last_item_for_context'].item_obj, 'side' =>'left', :padx=>2, :pady=>0)
1029
+ else
1030
+ @item_obj.pack('side' =>'left', :padx=>2, :pady=>0)
1031
+ end
1032
+ if _args['menu_button'] && _args['menu_button'] == 'yes'
1033
+ @menu_button = TkMenuButton.new(_args['frame'], Arcadia.style('toolbarbutton')){|mb|
1034
+ indicatoron false
1035
+ menu TkMenu.new(mb, Arcadia.style('titlemenu'))
1036
+ image TkPhotoImage.new('dat' => MENUBUTTON_ARROW_DOWN_GIF)
1037
+ padx 0
1038
+ pady 0
1039
+ pack('side'=> 'left','anchor'=> 's','pady'=>3)
1040
+ }
1041
+ Arcadia.menu_root(_args['name'], @menu_button.cget('menu'))
1042
+ end
872
1043
  #Tk::BWidget::Separator.new(@frame, :orient=>'vertical').pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w')
873
1044
  end
874
1045
 
@@ -889,31 +1060,31 @@ class ArcadiaMainToolbar < ArcadiaUserControl
889
1060
  #@frame.highlightbackground(Arcadia.conf('panel.highlightbackground'))
890
1061
  @frame.relief(Arcadia.conf('panel.relief'))
891
1062
 
892
- @context_frames = Hash.new
1063
+ @context_frames = Hash.new
893
1064
  @last_context = nil
1065
+ @last_item_for_context = Hash.new
894
1066
  end
895
1067
 
896
1068
  def new_item(_sender, _args= nil)
897
- _context = _args['context']
898
- # if _context
899
- # if @context_frames[_context]
900
- # else
901
- # @context_frames[_context] = TkLabelFrame.new(@frame){
902
- # text ""
903
- # relief 'groove'
904
- # pack('side' =>'left', :padx=>0, :pady=>0)
905
- # }
906
- # end
907
- # _args['frame']=@context_frames[_context]
908
- # else
909
- # _args['frame']=@frame
910
- # end
911
- if @last_context && _context != @last_context
1069
+ _context = _args['context']
1070
+ _context_path = _args['context_path']
1071
+
1072
+ if @last_context && _context != @last_context && _context_path.nil?
912
1073
  new_separator
913
1074
  end
914
1075
  @last_context = _context
915
1076
  _args['frame']=@frame
1077
+ if _context_path && @last_item_for_context[_context_path]
1078
+ _args['last_item_for_context']=@last_item_for_context[_context_path]
1079
+ end
1080
+
916
1081
  super(_sender, _args)
1082
+ if _context_path && items[_args['name']]
1083
+ @last_item_for_context[_context_path] = items[_args['name']]
1084
+ end
1085
+ if _context && items[_args['name']]
1086
+ @last_item_for_context[_context] = items[_args['name']]
1087
+ end
917
1088
  end
918
1089
 
919
1090
  def new_separator
@@ -995,9 +1166,7 @@ class ArcadiaMainMenu < ArcadiaUserControl
995
1166
  attr_accessor :type
996
1167
  def initialize(_sender, _args)
997
1168
  super(_sender, _args)
998
- _command = proc{
999
- Arcadia.process_event(@event_class.new(_sender, @event_args))
1000
- } if @event_class
1169
+ _command = @command #proc{ Arcadia.process_event(@event_class.new(_sender, @event_args)) } if @event_class
1001
1170
  #_menu = @menu[@parent]
1002
1171
  item_args = Hash.new
1003
1172
  item_args['image']=TkPhotoImage.new('data' => @image_data) if @image_data
@@ -1079,6 +1248,7 @@ class ArcadiaMainMenu < ArcadiaUserControl
1079
1248
  :tearoff=>0
1080
1249
  )
1081
1250
  sub.configure(Arcadia.style('menu'))
1251
+ sub.extend(TkAutoPostMenu)
1082
1252
  #update_style(sub)
1083
1253
  menu_context.insert('end',
1084
1254
  :cascade,
@@ -1090,17 +1260,20 @@ class ArcadiaMainMenu < ArcadiaUserControl
1090
1260
  sub
1091
1261
  end
1092
1262
 
1093
- def get_menu(_menubar, _context, context_path, context_underline=nil)
1263
+ def make_menu_in_menubar(_menubar, _context, context_path, context_underline=nil)
1094
1264
  context_menu = get_menu_context(_menubar, _context, context_underline)
1265
+ make_menu(context_menu, context_path, context_underline)
1266
+ end
1267
+
1268
+ def make_menu(_menu, context_path, context_underline=nil)
1095
1269
  folders = context_path.split('/')
1096
- sub = context_menu
1270
+ sub = _menu
1097
1271
  folders.each{|folder|
1098
1272
  sub = get_sub_menu(sub, folder)
1099
1273
  }
1100
1274
  sub
1101
1275
  end
1102
1276
 
1103
-
1104
1277
  def new_item(_sender, _args= nil)
1105
1278
  return if _args.nil?
1106
1279
  if _args['context_caption']
@@ -1108,7 +1281,22 @@ class ArcadiaMainMenu < ArcadiaUserControl
1108
1281
  else
1109
1282
  conte = _args['context']
1110
1283
  end
1111
- _args['menu']=get_menu(@menu, conte, _args['context_path'], _args['context_underline'])
1284
+ if _args['rif'] == 'main'
1285
+ _args['menu']=make_menu_in_menubar(@menu, conte, _args['context_path'], _args['context_underline'])
1286
+ else
1287
+ if Arcadia.menu_root(_args['rif'])
1288
+ _args['menu']=make_menu(Arcadia.menu_root(_args['rif']), _args['context_path'], _args['context_underline'])
1289
+ else
1290
+ msg = "During building of menu item \"#{_args['name']}\" rif \"#{_args['rif']}\" not found!"
1291
+ Arcadia.dialog(self,
1292
+ 'type'=>'ok',
1293
+ 'title' => "(Arcadia) #{self.class::SUF}",
1294
+ 'msg'=>msg,
1295
+ 'level'=>'error')
1296
+
1297
+ _args['menu']=make_menu_in_menubar(@menu, conte, _args['context_path'], _args['context_underline'])
1298
+ end
1299
+ end
1112
1300
  super(_sender, _args)
1113
1301
  end
1114
1302
 
@@ -1157,7 +1345,7 @@ class ArcadiaMainMenu < ArcadiaUserControl
1157
1345
  @menu.add_menu(menu_spec_tools)
1158
1346
  @menu.add_menu(menu_spec_help)
1159
1347
 
1160
- #@menu.bind_append("1", proc{
1348
+ # #@menu.bind_append("1", proc{
1161
1349
  # chs = TkWinfo.children(@menu)
1162
1350
  # hh = 25
1163
1351
  # @last_post = nil
@@ -1171,10 +1359,124 @@ class ArcadiaMainMenu < ArcadiaUserControl
1171
1359
  # @last_post=nil
1172
1360
  # })
1173
1361
  # }
1362
+ #
1363
+ # #})
1364
+
1365
+ # @menu.bind_append("Leave", proc{
1366
+ # if Tk.focus != @last_menu_posted
1367
+ # @last_post.unpost if @last_post
1368
+ # @last_post=nil
1369
+ # end
1370
+ # })
1371
+ #
1372
+
1373
+
1374
+ # chs = TkWinfo.children(@menu)
1375
+ # hh = 25
1376
+ # @last_post = nil
1377
+ # chs.each{|ch|
1378
+ # ch.bind_append("Enter", proc{|x,y,rx,ry|
1379
+ # @last_post.unpost if @last_post && @last_post != ch.menu
1380
+ # ch.menu.post(x-rx,y-ry+hh)
1381
+ # chmenus = TkWinfo.children(ch)
1382
+ # @last_menu_posted = chmenus[0]
1383
+ # @last_menu_posted.set_focus
1384
+ # #@last_post=ch.menu
1385
+ # }, "%X %Y %x %y")
1386
+ # ch.bind_append("Leave", proc{
1387
+ # @last_post.unpost if @last_post
1388
+ # #@last_post=nil
1389
+ # @last_post=ch.menu
1390
+ # })
1391
+ # }
1392
+ # @menu.bind_append("Leave", proc{
1393
+ # if Tk.focus != @last_menu_posted
1394
+ # @last_post.unpost if @last_post
1395
+ # @last_post=nil
1396
+ # end
1397
+ # })
1398
+ @menu.extend(TkAutoPostMenu)
1399
+ @menu.event_posting_on
1400
+ end
1401
+
1402
+ end
1174
1403
 
1175
- #})
1404
+ class RunnerManager < TkFloatTitledFrame
1405
+ class RunnerMangerItem < TkFrame
1406
+ def initialize(_parent=nil, _runner_hash=nil, *args)
1407
+ super(_parent, Arcadia.style('panel'))
1408
+ @runner_hash = _runner_hash
1409
+ Tk::BWidget::Label.new(self,
1410
+ 'image'=> Arcadia.file_icon(_runner_hash[:file_exts]),
1411
+ 'relief'=>'flat').pack('side' =>'left')
1412
+ Tk::BWidget::Label.new(self,
1413
+ 'text'=>_runner_hash[:title],
1414
+ 'helptext'=>_runner_hash[:file],
1415
+ 'compound'=>:left,
1416
+ 'relief'=>'flat').pack('fill'=>'x','side' =>'left')
1417
+ _close_command = proc{
1418
+ if (Arcadia.dialog(self, 'type'=>'yes_no',
1419
+ 'msg'=>"Do you want delete runner item '#{_runner_hash[:name]}'?",
1420
+ 'title' => '(Arcadia) Manage runners',
1421
+ 'level' => 'question')=='yes')
1422
+
1423
+ Arcadia.unpersistent("runners.#{_runner_hash[:name]}")
1424
+ mr = Arcadia.menu_root('runcurr')
1425
+ index_to_delete = -1
1426
+ i_end = mr.index('end')
1427
+ if i_end
1428
+ 0.upto(i_end){|j|
1429
+ type = mr.menutype(j)
1430
+ if type != 'separator'
1431
+ l = mr.entrycget(j,'label')
1432
+ if l == _runner_hash[:title]
1433
+ index_to_delete = j
1434
+ break
1435
+ end
1436
+ end
1437
+ }
1438
+ end
1439
+ if index_to_delete > -1
1440
+ mr.delete(index_to_delete)
1441
+ end
1442
+ self.destroy
1443
+ end
1444
+ }
1445
+ Tk::BWidget::Button.new(self,
1446
+ 'command'=>_close_command,
1447
+ 'helptext'=>@runner_hash[:file],
1448
+ 'background'=>'white',
1449
+ 'image'=> TkPhotoImage.new('data' => TRASH_GIF),
1450
+ 'relief'=>'flat').pack('side' =>'right','padx'=>0)
1451
+ pack('side' =>'top','anchor'=>'nw','fill'=>'x','padx'=>5, 'pady'=>5)
1452
+ end
1453
+
1454
+ end
1455
+
1456
+ def initialize(_parent)
1457
+ super(_parent)
1458
+ title("Runners manager")
1459
+ @items = Hash.new
1460
+ place('x'=>100,'y'=>100,'height'=> 220,'width'=> 300)
1461
+ end
1462
+
1463
+ def clear_items
1464
+ @items.each_value{|i| i.destroy }
1465
+ @items.clear
1176
1466
  end
1177
1467
 
1468
+ def load_items
1469
+ clear_items
1470
+ runs=Arcadia.pers_group('runners', true)
1471
+ runs.each{|name, hash_string|
1472
+ item_hash = eval hash_string
1473
+ item_hash[:name]=name
1474
+ if item_hash[:runner] && Arcadia.runner(item_hash[:runner])
1475
+ item_hash = Hash.new.update(Arcadia.runner(item_hash[:runner])).update(item_hash)
1476
+ end
1477
+ @items[name]=RunnerMangerItem.new(self.frame, item_hash)
1478
+ }
1479
+ end
1178
1480
  end
1179
1481
 
1180
1482
  class ArcadiaAboutSplash < TkToplevel
@@ -1197,26 +1499,37 @@ class ArcadiaAboutSplash < TkToplevel
1197
1499
  background _bgcolor
1198
1500
  place('x'=> 20,'y' => 20)
1199
1501
  }
1502
+
1503
+
1504
+ # @tkLabel1 = TkLabel.new(self){
1505
+ # text 'Arcadia'
1506
+ # background _bgcolor
1507
+ # foreground '#ffffff'
1508
+ # font Arcadia.conf('splash.title.font')
1509
+ # justify 'left'
1510
+ # place('width' => '190','x' => 110,'y' => 10,'height' => 25)
1511
+ # }
1512
+
1200
1513
  @tkLabel1 = TkLabel.new(self){
1201
- text 'Arcadia'
1514
+ image TkPhotoImage.new('format'=>'GIF','data' =>ARCADIA_JAP_GIF)
1202
1515
  background _bgcolor
1203
- foreground '#ffffff'
1204
- font Arcadia.conf('splash.title.font')
1205
1516
  justify 'left'
1206
- place('width' => '190','x' => 110,'y' => 10,'height' => 25)
1517
+ place('x' => 90,'y' => 10)
1207
1518
  }
1519
+
1208
1520
  @tkLabelRuby = TkLabel.new(self){
1209
1521
  image TkPhotoImage.new('data' =>RUBY_DOCUMENT_GIF)
1210
1522
  background _bgcolor
1211
- place('x'=> 150,'y' => 40)
1523
+ place('x'=> 210,'y' => 12)
1212
1524
  }
1525
+
1213
1526
  @tkLabel2 = TkLabel.new(self){
1214
- text 'Ruby ide'
1527
+ text 'Arcadia Ide'
1215
1528
  background _bgcolor
1216
1529
  foreground '#ffffff'
1217
1530
  font Arcadia.instance['conf']['splash.subtitle.font']
1218
1531
  justify 'left'
1219
- place('width' => '90','x' => 170,'y' => 40,'height' => 19)
1532
+ place('x' => 100,'y' => 40,'height' => 19)
1220
1533
  }
1221
1534
  @tkLabelVersion = TkLabel.new(self){
1222
1535
  text 'version: '+$arcadia['applicationParams'].version
@@ -1224,7 +1537,7 @@ class ArcadiaAboutSplash < TkToplevel
1224
1537
  foreground '#ffffff'
1225
1538
  font Arcadia.instance['conf']['splash.version.font']
1226
1539
  justify 'left'
1227
- place('width' => '120','x' => 150,'y' => 65,'height' => 19)
1540
+ place('x' => 100,'y' => 65,'height' => 19)
1228
1541
  }
1229
1542
  @tkLabel21 = TkLabel.new(self){
1230
1543
  text 'by Antonio Galeone - 2004/2010'
@@ -1233,7 +1546,7 @@ class ArcadiaAboutSplash < TkToplevel
1233
1546
  font Arcadia.instance['conf']['splash.credits.font']
1234
1547
  justify 'left'
1235
1548
  anchor 'w'
1236
- place('width' => '210','x' => 100,'y' => 95,'height' => 25)
1549
+ place('width' => '220','x' => 100,'y' => 95,'height' => 25)
1237
1550
  }
1238
1551
 
1239
1552
  @tkLabelCredits = TkLabel.new(self){
@@ -1258,7 +1571,7 @@ class ArcadiaAboutSplash < TkToplevel
1258
1571
  @progress = TkVariable.new
1259
1572
  reset
1260
1573
  _width = 380
1261
- _height = 240
1574
+ _height = 210
1262
1575
  #_width = 0;_height = 0
1263
1576
  _x = TkWinfo.screenwidth(self)/2 - _width / 2
1264
1577
  _y = TkWinfo.screenheight(self)/2 - _height / 2
@@ -1304,7 +1617,6 @@ class ArcadiaAboutSplash < TkToplevel
1304
1617
  @progress.numeric = @max
1305
1618
  labelStep(_txt) if _txt
1306
1619
  end
1307
-
1308
1620
  end
1309
1621
 
1310
1622
  class ArcadiaActionDispatcher
@@ -1331,9 +1643,10 @@ class ArcadiaSh < TkToplevel
1331
1643
  def initialize
1332
1644
  super
1333
1645
  title 'ArcadiaSh'
1646
+ iconphoto(TkPhotoImage.new('dat'=>ARCADIA_RING_GIF))
1334
1647
  geometry = '800x200+10+10'
1335
1648
  geometry(geometry)
1336
- @text = TkScrollText.new(self, Arcadia.style('text')){
1649
+ @text = TkText.new(self, Arcadia.style('text')){
1337
1650
  wrap 'none'
1338
1651
  undo true
1339
1652
  insertofftime 200
@@ -1345,9 +1658,7 @@ class ArcadiaSh < TkToplevel
1345
1658
  @text.set_focus
1346
1659
  @text.tag_configure('error', 'foreground' => '#d93421')
1347
1660
  @text.tag_configure('response', 'foreground' => '#2c51d9')
1348
- @text.show
1349
- @text.show_v_scroll
1350
- @text.show_h_scroll
1661
+ @text.extend(TkScrollableWidget).show
1351
1662
  #@input_buffer = ''
1352
1663
  @wait = true
1353
1664
  @result = false
@@ -1508,7 +1819,7 @@ class ArcadiaGemsWizard
1508
1819
  ret = false
1509
1820
 
1510
1821
  sh=ArcadiaSh.new
1511
- cmd = "gem install #{name}"
1822
+ cmd = "gem install --remote --include-dependencies #{name}"
1512
1823
  cmd="sudo #{cmd}" if !is_windows?
1513
1824
  cmd+=" --source=#{repository}" if repository
1514
1825
  sh.prepare_exec(cmd)
@@ -2632,6 +2943,10 @@ class ArcadiaLayout
2632
2943
 
2633
2944
  end
2634
2945
 
2946
+ def registered_panel?(_ffw)
2947
+ _ffw.domain.nil? || _ffw.domain.length == 0 ?false:registed?(_ffw.domain, _ffw.name)
2948
+ end
2949
+
2635
2950
  def register_panel(_ffw, _adapter=nil)
2636
2951
  _domain_name = _ffw.domain
2637
2952
  _name = _ffw.name
@@ -2675,7 +2990,7 @@ class ArcadiaLayout
2675
2990
  'raisecmd'=>proc{
2676
2991
  pan['root'].title(api.title)
2677
2992
  pan['root'].top_text('')
2678
- Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>pan['sons'][api.name].extension, 'frame_name'=>pan['sons'][api.name].name))
2993
+ Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>pan['sons'][api.name].extension_name, 'frame_name'=>pan['sons'][api.name].name))
2679
2994
  # changed
2680
2995
  # notify_observers('RAISE', api.name)
2681
2996
  }
@@ -2695,7 +3010,7 @@ class ArcadiaLayout
2695
3010
  'text'=>_title,
2696
3011
  'raisecmd'=>proc{
2697
3012
  pan['root'].title(_title)
2698
- Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>_ffw.extension, 'frame_name'=>_ffw.name))
3013
+ Arcadia.process_event(LayoutRaisingFrameEvent.new(self,'extension_name'=>_ffw.extension_name, 'frame_name'=>_ffw.name))
2699
3014
  # changed
2700
3015
  # notify_observers('RAISE', _name)
2701
3016
  }
@@ -3054,4 +3369,22 @@ class FocusEventManager
3054
3369
  end
3055
3370
  end
3056
3371
  end
3372
+ end
3373
+
3374
+
3375
+ class ArcadiaUtils
3376
+ def ArcadiaUtils.unix_child_pids(_ppid)
3377
+ ret = Array.new
3378
+ readed = ''
3379
+ open("|ps -o pid,ppid ax | grep #{_ppid}", "r"){|f| readed = f.read }
3380
+ apids = readed.split
3381
+ apids.each_with_index do |v,i|
3382
+ ret << v if i % 2 == 0 && v != _ppid.to_s
3383
+ end
3384
+ subpids = Array.new
3385
+ ret.each{|ccp|
3386
+ subpids.concat(unix_child_pids(ccp))
3387
+ }
3388
+ ret.concat(subpids)
3389
+ end
3057
3390
  end