arcadia 0.13.1 → 1.0.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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/{README → README.md} +60 -53
  3. data/conf/LC/en-UK.LANG +10 -4
  4. data/conf/arcadia.conf +221 -83
  5. data/conf/arcadia.res.rb +165 -175
  6. data/conf/theme-dark.conf +1 -1
  7. data/conf/theme-dark.res.rb +0 -123
  8. data/ext/ae-breakpoints/ae-breakpoints.rb +4 -3
  9. data/ext/ae-dir-projects/ae-dir-projects.conf +27 -1
  10. data/ext/ae-dir-projects/ae-dir-projects.rb +120 -70
  11. data/ext/ae-editor/ae-editor.conf +2 -2
  12. data/ext/ae-editor/ae-editor.rb +610 -303
  13. data/ext/ae-file-history/ae-file-history.rb +60 -39
  14. data/ext/ae-output/ae-output.rb +52 -27
  15. data/ext/ae-ruby-debug/ae-ruby-debug.conf +3 -1
  16. data/ext/ae-ruby-debug/ae-ruby-debug.rb +18 -11
  17. data/ext/ae-search-in-files/ae-search-in-files.conf +2 -2
  18. data/ext/ae-search-in-files/ae-search-in-files.rb +124 -77
  19. data/ext/ae-shell/ae-shell.conf +1 -1
  20. data/ext/ae-shell/ae-shell.rb +18 -81
  21. data/ext/ae-subprocess-inspector/ae-subprocess-inspector.rb +78 -81
  22. data/ext/ae-term/ae-term.rb +9 -7
  23. data/lib/a-commons.rb +125 -17
  24. data/lib/a-contracts.rb +6 -2
  25. data/lib/a-core.rb +441 -405
  26. data/lib/a-tkcommons.rb +1237 -45
  27. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ArrowButton.html +0 -0
  28. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/BWidget.html +0 -0
  29. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Button.html +0 -0
  30. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ButtonBox.html +0 -0
  31. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ComboBox.html +0 -0
  32. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Dialog.html +0 -0
  33. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/DragSite.html +0 -0
  34. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/DropSite.html +0 -0
  35. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/DynamicHelp.html +0 -0
  36. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Entry.html +0 -0
  37. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Label.html +0 -0
  38. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/LabelEntry.html +0 -0
  39. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/LabelFrame.html +0 -0
  40. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ListBox.html +0 -0
  41. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/MainFrame.html +0 -0
  42. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/MessageDlg.html +0 -0
  43. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/NoteBook.html +0 -0
  44. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/PagesManager.html +0 -0
  45. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/PanedWindow.html +0 -0
  46. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/PanelFrame.html +0 -0
  47. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/PasswdDlg.html +0 -0
  48. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ProgressBar.html +0 -0
  49. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ProgressDlg.html +0 -0
  50. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ScrollView.html +0 -0
  51. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ScrollableFrame.html +0 -0
  52. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/ScrolledWindow.html +0 -0
  53. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/SelectColor.html +0 -0
  54. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/SelectFont.html +0 -0
  55. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Separator.html +0 -0
  56. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/SpinBox.html +0 -0
  57. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/StatusBar.html +0 -0
  58. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/TitleFrame.html +0 -0
  59. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Tree.html +0 -0
  60. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/Widget.html +0 -0
  61. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/contents.html +0 -0
  62. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/index.html +0 -0
  63. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/navtree.html +0 -0
  64. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/BWman/options.htm +0 -0
  65. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/CHANGES.txt +0 -0
  66. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/ChangeLog +65 -0
  67. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/LICENSE.txt +0 -0
  68. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/README.txt +0 -0
  69. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/arrow.tcl +0 -0
  70. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/bitmap.tcl +0 -0
  71. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/button.tcl +0 -2
  72. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/buttonbox.tcl +0 -0
  73. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/color.tcl +0 -0
  74. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/combobox.tcl +40 -16
  75. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/basic.tcl +0 -0
  76. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/bwidget.xbm +0 -0
  77. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/demo.tcl +0 -0
  78. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/dnd.tcl +0 -0
  79. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/manager.tcl +0 -0
  80. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/select.tcl +0 -0
  81. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/tmpldlg.tcl +0 -0
  82. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/tree.tcl +0 -0
  83. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/demo/x1.xbm +0 -0
  84. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/dialog.tcl +0 -0
  85. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/dragsite.tcl +0 -0
  86. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/dropsite.tcl +0 -0
  87. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/dynhelp.tcl +3 -0
  88. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/entry.tcl +0 -0
  89. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/font.tcl +0 -0
  90. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/bold.gif +0 -0
  91. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/copy.gif +0 -0
  92. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/cut.gif +0 -0
  93. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/dragfile.gif +0 -0
  94. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/dragicon.gif +0 -0
  95. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/error.gif +0 -0
  96. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/file.gif +0 -0
  97. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/folder.gif +0 -0
  98. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/hourglass.gif +0 -0
  99. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/info.gif +0 -0
  100. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/italic.gif +0 -0
  101. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/minus.xbm +0 -0
  102. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/new.gif +0 -0
  103. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/opcopy.xbm +0 -0
  104. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/open.gif +0 -0
  105. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/openfold.gif +0 -0
  106. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/oplink.xbm +0 -0
  107. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/opmove.xbm +0 -0
  108. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/overstrike.gif +0 -0
  109. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/palette.gif +0 -0
  110. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/passwd.gif +0 -0
  111. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/paste.gif +0 -0
  112. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/plus.xbm +0 -0
  113. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/print.gif +0 -0
  114. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/question.gif +0 -0
  115. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/redo.gif +0 -0
  116. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/save.gif +0 -0
  117. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/target.xbm +0 -0
  118. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/underline.gif +0 -0
  119. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/undo.gif +0 -0
  120. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/images/warning.gif +0 -0
  121. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/init.tcl +0 -0
  122. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/label.tcl +0 -2
  123. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/labelentry.tcl +0 -3
  124. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/labelframe.tcl +0 -2
  125. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/da.rc +1 -0
  126. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/de.rc +1 -0
  127. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/en.rc +1 -0
  128. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/es.rc +1 -0
  129. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/fr.rc +1 -0
  130. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/hu.rc +1 -0
  131. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/nl.rc +1 -0
  132. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/no.rc +59 -58
  133. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/lang/pl.rc +0 -0
  134. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/listbox.tcl +17 -4
  135. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/mainframe.tcl +0 -0
  136. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/messagedlg.tcl +0 -0
  137. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/notebook.tcl +0 -0
  138. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/pagesmgr.tcl +0 -0
  139. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/panedw.tcl +0 -0
  140. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/panelframe.tcl +0 -0
  141. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/passwddlg.tcl +0 -0
  142. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/pkgIndex.tcl +2 -2
  143. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/progressbar.tcl +0 -0
  144. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/progressdlg.tcl +0 -0
  145. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/scrollframe.tcl +6 -6
  146. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/scrollview.tcl +0 -0
  147. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/scrollw.tcl +1 -0
  148. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/separator.tcl +0 -0
  149. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/spinbox.tcl +0 -0
  150. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/statusbar.tcl +0 -0
  151. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/tests/entry.test +2 -2
  152. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/titleframe.tcl +0 -0
  153. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/tree.tcl +0 -0
  154. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/utils.tcl +0 -0
  155. data/tcl/bwidget-1.9.8/widget-old.tcl +1651 -0
  156. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/widget.tcl +64 -36
  157. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/wizard.tcl +0 -0
  158. data/tcl/{bwidget-1.9.7 → bwidget-1.9.8}/xpm2image.tcl +0 -0
  159. metadata +196 -195
@@ -255,6 +255,9 @@ class SubProcessEvent < ArcadiaEvent
255
255
  attr_accessor :abort_action, :alive_check, :name, :pid, :timeout, :timecheck
256
256
  end
257
257
 
258
+ class SubProcessProgressEvent < SubProcessEvent
259
+ attr_accessor :max, :varprogress
260
+ end
258
261
 
259
262
  #class DebugMsgEvent < MsgEvent
260
263
  #end
@@ -315,7 +318,8 @@ end
315
318
  class InputKeyboardQueryEvent < ArcadiaEvent
316
319
  class Result < Result
317
320
  attr_accessor :input
318
- end
321
+ end
322
+ attr_accessor :pid
319
323
  end
320
324
 
321
325
  class InputEvent < ArcadiaEvent
@@ -367,6 +371,7 @@ class LowerCaseTextEvent < FocusEvent; end
367
371
  class DialogEvent < ArcadiaEvent
368
372
  TYPE_PATTERNS = ['ok', 'yes_no', 'ok_cancel', 'yes_no_cancel', 'abort_retry_ignore']
369
373
  MSG_MAX_CHARS = 500
374
+ TITLE_MAX_CHARS = 100
370
375
  class Result < Result
371
376
  attr_accessor :value
372
377
  end
@@ -379,7 +384,6 @@ end
379
384
  class HinnerDialogEvent < DialogEvent
380
385
  end
381
386
 
382
-
383
387
  #class QuestionDialogEvent < DialogEvent
384
388
  #end
385
389
  #
@@ -16,15 +16,17 @@ require "observer"
16
16
 
17
17
  class Arcadia < TkApplication
18
18
  include Observable
19
+ include OS
19
20
  attr_reader :layout
20
21
  attr_reader :wf
21
22
  attr_reader :mf_root
22
23
  attr_reader :localization
23
24
  def initialize
25
+ @initialized=false
24
26
  super(
25
27
  ApplicationParams.new(
26
28
  'arcadia',
27
- '0.13.1',
29
+ '1.0.0',
28
30
  'conf/arcadia.conf',
29
31
  'conf/arcadia.pers'
30
32
  )
@@ -56,18 +58,19 @@ class Arcadia < TkApplication
56
58
  title _title
57
59
  withdraw
58
60
  protocol( "WM_DELETE_WINDOW", proc{Arcadia.process_event(QuitEvent.new(self))})
59
- iconphoto(Arcadia.image_res(ARCADIA_RING_GIF)) if Arcadia.instance.tcltk_info.level >= '8.4.9'
61
+ iconphoto(Arcadia.image_res(A_LOGO_STRIP_GIF)) if Arcadia.instance.tcltk_info.level >= '8.4.9'
60
62
  }
61
63
  @on_event = Hash.new
62
64
 
63
- @main_menu_bar = TkMenubar.new(
64
- 'background'=> self['conf']['background']
65
- ).pack('fill'=>'x')
65
+ # @main_menu_bar = TkMenubar.new(
66
+ # 'background'=> self['conf']['background']
67
+ # ).pack('fill'=>'x')
68
+
66
69
  @mf_root = Tk::BWidget::MainFrame.new(@root,
67
70
  'background'=> self['conf']['background'],
68
71
  'height'=> 0
69
72
  ){
70
- menu @main_menu_bar
73
+ #menu @main_menu_bar
71
74
  }.pack(
72
75
  'anchor'=> 'center',
73
76
  'fill'=> 'both',
@@ -82,7 +85,7 @@ class Arcadia < TkApplication
82
85
  @mf_root.show_toolbar(0,@is_toolbar_show)
83
86
  @use_splash = self['conf']['splash.show']=='yes'
84
87
  @splash = ArcadiaAboutSplash.new if @use_splash
85
- @splash.set_progress(31) if @splash
88
+ @splash.set_progress(62) if @splash
86
89
  @splash.deiconify if @splash
87
90
  Tk.update
88
91
  @screenwidth=TkWinfo.screenwidth(@root)
@@ -113,7 +116,7 @@ class Arcadia < TkApplication
113
116
  else
114
117
  start_width = (@screenwidth-4)
115
118
  start_height = (@screenheight-20)
116
- if RUBY_PLATFORM =~ /mswin|mingw/ # on doze don't go below the start gar
119
+ if OS.windows? # on doze don't go below the start gar
117
120
  start_height -= 50
118
121
  start_width -= 20
119
122
  end
@@ -150,16 +153,17 @@ class Arcadia < TkApplication
150
153
  Arcadia.runtime_error(e)
151
154
  end
152
155
  if self['conf']['geometry.state'] == 'zoomed'
153
- if Arcadia.is_windows?
156
+ if Arcadia.is_windows? || OS.mac?
154
157
  @root.state('zoomed')
155
158
  else
156
159
  @root.wm_attributes('zoomed',1)
157
160
  end
158
161
  end
159
162
  #sleep(1)
163
+ @splash.last_step if @splash
160
164
  @splash.destroy if @splash
161
165
  if @first_run # first ARCADIA ever
162
- Arcadia.process_event(OpenBufferEvent.new(self,'file'=>'README'))
166
+ Arcadia.process_event(OpenBufferEvent.new(self,'file'=>'README.md'))
163
167
  elsif ARGV.length > 0
164
168
  ARGV.each{|_f|
165
169
  if $pwd != File.dirname(__FILE__) && !File.exist?(_f)
@@ -171,6 +175,12 @@ class Arcadia < TkApplication
171
175
  Arcadia.attach_listener(self, QuitEvent)
172
176
  Arcadia.persistent("version", self['applicationParams'].version)
173
177
  @@last_input_keyboard_query_event=nil
178
+ @initialized=true
179
+ # @focus_event_manager = FocusEventManager.new
180
+ end
181
+
182
+ def initialized?
183
+ @initialized
174
184
  end
175
185
 
176
186
  def on_quit(_event)
@@ -577,13 +587,14 @@ class Arcadia < TkApplication
577
587
  end
578
588
 
579
589
  def load_sysdefaultproperty
580
- Tk.tk_call "eval","option add *background #{self['conf']['background']}"
581
- Tk.tk_call "eval","option add *foreground #{self['conf']['foreground']}"
582
- Tk.tk_call "eval","option add *activebackground #{self['conf']['activebackground']}"
583
- Tk.tk_call "eval","option add *activeforeground #{self['conf']['activeforeground']}"
584
- Tk.tk_call "eval","option add *highlightcolor #{self['conf']['background']}"
585
- Tk.tk_call "eval","option add *relief #{self['conf']['relief']}"
586
-
590
+ if !OS.mac?
591
+ Tk.tk_call "eval","option add *background #{self['conf']['background']}"
592
+ Tk.tk_call "eval","option add *foreground #{self['conf']['foreground']}"
593
+ Tk.tk_call "eval","option add *activebackground #{self['conf']['activebackground']}"
594
+ Tk.tk_call "eval","option add *activeforeground #{self['conf']['activeforeground']}"
595
+ Tk.tk_call "eval","option add *highlightcolor #{self['conf']['background']}"
596
+ Tk.tk_call "eval","option add *relief #{self['conf']['relief']}"
597
+ end
587
598
  if !Arcadia.is_windows? && File.basename(Arcadia.ruby) != 'ruby'
588
599
  begin
589
600
  if !FileTest.exist?("#{local_dir}/bin")
@@ -611,7 +622,8 @@ class Arcadia < TkApplication
611
622
  publish('action.test.keys', proc{@keytest.show})
612
623
  publish('action.get.font', proc{Tk::BWidget::SelectFont::Dialog.new.create})
613
624
  publish('action.show_about', proc{ArcadiaAboutSplash.new.deiconify})
614
- self['menubar'] = ArcadiaMainMenu.new(@main_menu_bar)
625
+ # self['menubar'] = ArcadiaMainMenu.new(@main_menu_bar)
626
+ self['menubar'] = ArcadiaMainMenu.new(@root)
615
627
  @splash.next_step(Arcadia.text('main.splash.building_extensions')) if @splash
616
628
  self.do_build
617
629
  publish('objic.action.raise_active_obj',
@@ -634,6 +646,14 @@ class Arcadia < TkApplication
634
646
  }
635
647
  load_user_control(self['toolbar'],"","e")
636
648
  load_user_control(self['menubar'],"","e")
649
+ # Platform menus
650
+ if OS.mac?
651
+ apple = TkSysMenu_Apple.new(self['menubar'].menubar)
652
+ self['menubar'].menubar.add :cascade, :menu => apple
653
+ elsif OS.windows?
654
+ sysmenu = TkSysMenu_System.new(self['menubar'].menubar)
655
+ self['menubar'].menubar.add :cascade, :menu => sysmenu
656
+ end
637
657
  @splash.next_step(Arcadia.text('main.splash.loading_runners')) if @splash
638
658
  load_runners
639
659
  do_make_clones
@@ -662,6 +682,11 @@ class Arcadia < TkApplication
662
682
  run = Hash.new.update(self['runners'][run[:runner]]).update(run)
663
683
  #self['runners'][name]=run
664
684
  end
685
+ if run[:image]
686
+ image = Arcadia.image_res(run[:image])
687
+ else
688
+ image = Arcadia.file_icon(run[:file_exts])
689
+ end
665
690
  _run_title = run[:title]
666
691
  run[:title] = nil
667
692
  run[:runner_name] = name
@@ -670,15 +695,20 @@ class Arcadia < TkApplication
670
695
  RunCmdEvent.new(self, run)
671
696
  )
672
697
  }
673
- mr.insert('0',
674
- :command ,{
675
- :image => Arcadia.file_icon(run[:file_exts]),
698
+ if run[:pos]
699
+ pos = run[:pos]
700
+ else
701
+ pos = '0'
702
+ end
703
+ args = {
704
+ :image => image,
676
705
  :label => _run_title,
677
- :font => Arcadia.conf('menu.font'),
678
706
  :compound => 'left',
679
707
  :command => _command
680
708
  }
681
- )
709
+ args[:font] = Arcadia.conf('menu.font') #if !OS.mac?
710
+
711
+ mr.insert(pos, :command , args)
682
712
  }
683
713
 
684
714
  insert_runner_instance_item = proc{|name, run|
@@ -689,23 +719,28 @@ class Arcadia < TkApplication
689
719
  _run_title = run[:title]
690
720
  run[:title] = nil
691
721
  run[:runner_name] = name
722
+ if run[:image]
723
+ image = Arcadia.image_res(run[:image])
724
+ else
725
+ image = Arcadia.file_icon(run[:file_exts])
726
+ end
727
+
692
728
  _command = proc{
693
729
  _event = Arcadia.process_event(
694
730
  RunCmdEvent.new(self, run)
695
731
  )
696
732
  }
697
- mr.insert('0',
698
- :command ,{
699
- :image => Arcadia.file_icon(run[:file_exts]),
733
+ args = {
734
+ :image => image,
700
735
  :label => _run_title,
701
- :font => Arcadia.conf('menu.font'),
702
736
  :compound => 'left',
703
737
  :command => _command
704
738
  }
705
- )
739
+ args[:font] = Arcadia.conf('menu.font') #if !OS.mac?
740
+ mr.insert('0', :command , args)
706
741
  }
707
742
 
708
- # conf runner
743
+ #conf runner
709
744
  runs=Arcadia.conf_group('runners')
710
745
  mr.insert('0', :separator) if runs && !runs.empty?
711
746
 
@@ -717,6 +752,22 @@ class Arcadia < TkApplication
717
752
  insert_runner_item.call(name, run)
718
753
  }
719
754
 
755
+
756
+ #conf exts runner
757
+ @exts.each{|ext|
758
+ if ext_active?(ext)
759
+ ext_runs=Arcadia.conf_group("#{ext}.runners")
760
+ mr.insert(self['runners'].count, :separator) if ext_runs && !ext_runs.empty?
761
+ ext_runs.each{|name, hash_string|
762
+ self['runners'][name]=eval hash_string
763
+ self['runners'][name][:pos]=self['runners'].count
764
+ insert_runner_item.call(name, self['runners'][name])
765
+ }
766
+ end
767
+ }
768
+
769
+
770
+
720
771
  # pers runner instance
721
772
  runs=Arcadia.pers_group('runners')
722
773
  mr.insert('0', :separator) if runs && !runs.empty?
@@ -725,8 +776,6 @@ class Arcadia < TkApplication
725
776
  begin
726
777
  pers_runner[name]=eval hash_string
727
778
  rescue Exception => e
728
- p Arcadia("main.e.loading_runner.title", [name])
729
- p Arcadia("main.e.loading_runner.msg", [hash_string, e.message])
730
779
  Arcadia.unpersistent("runners.#{name}")
731
780
  end
732
781
  }
@@ -887,7 +936,7 @@ class Arcadia < TkApplication
887
936
  def save_layout
888
937
  self['conf']['geometry']= geometry_refine(TkWinfo.geometry(@root))
889
938
  begin
890
- if Arcadia.is_windows?
939
+ if Arcadia.is_windows? || OS.mac?
891
940
  self['conf']['geometry.state'] = @root.state.to_s
892
941
  else
893
942
  if @root.wm_attributes('zoomed') == '1'
@@ -984,14 +1033,14 @@ class Arcadia < TkApplication
984
1033
  _event.mark
985
1034
  end
986
1035
 
987
- def Arcadia.console_input(_sender)
1036
+ def Arcadia.console_input(_sender, _pid=nil)
988
1037
  @@input_ready = true if !defined?(@@input_ready)
989
1038
  while !@@input_ready && !@@input_ready.nil?
990
1039
  sleep(0.1)
991
1040
  end
992
1041
  begin
993
1042
  @@input_ready=false
994
- @@last_input_keyboard_query_event = InputKeyboardQueryEvent.new(_sender)
1043
+ @@last_input_keyboard_query_event = InputKeyboardQueryEvent.new(_sender, :pid => _pid)
995
1044
  @@last_input_keyboard_query_event.go!
996
1045
  ret = @@last_input_keyboard_query_event.results.length > 0 ? @@last_input_keyboard_query_event.results[0].input : nil
997
1046
  ensure
@@ -1032,8 +1081,12 @@ class Arcadia < TkApplication
1032
1081
 
1033
1082
 
1034
1083
  def Arcadia.dialog(_sender, _args=Hash.new)
1035
- _event = process_event(SystemDialogEvent.new(_sender, _args))
1036
- return _event.results[0].value if _event
1084
+ if @@instance && @@instance.initialized?
1085
+ Arcadia.hinner_dialog(_sender, _args)
1086
+ else
1087
+ _event = process_event(SystemDialogEvent.new(_sender, _args))
1088
+ return _event.results[0].value if _event
1089
+ end
1037
1090
  end
1038
1091
 
1039
1092
  def Arcadia.hinner_dialog(_sender, _args=Hash.new)
@@ -1115,12 +1168,37 @@ class Arcadia < TkApplication
1115
1168
  end
1116
1169
  end
1117
1170
 
1118
- def Arcadia.open_file_dialog
1171
+ def Arcadia.open_system_file_dialog
1119
1172
  Tk.getOpenFile 'initialdir' => MonitorLastUsedDir.get_last_dir
1120
1173
  end
1121
1174
 
1175
+ def Arcadia.open_file_dialog(_initial_dir=MonitorLastUsedDir.get_last_dir)
1176
+ HinnerFileDialog.new.file(_initial_dir)
1177
+ end
1178
+
1179
+ def Arcadia.select_dir_dialog(_initial_dir=MonitorLastUsedDir.get_last_dir, must_exist = nil)
1180
+ HinnerFileDialog.new(HinnerFileDialog::SELECT_DIR_MODE, must_exist).dir(_initial_dir)
1181
+ end
1182
+
1183
+ def Arcadia.save_file_dialog(_initial_dir=MonitorLastUsedDir.get_last_dir)
1184
+ file = HinnerFileDialog.new(HinnerFileDialog::SAVE_FILE_MODE).file(_initial_dir)
1185
+ if !file.nil? && File.exists?(file)
1186
+ if (Arcadia.dialog(self, 'type'=>'yes_no',
1187
+ 'msg'=>Arcadia.text('main.d.confirm_override_file.msg', [file]),
1188
+ 'title' => Arcadia.text('main.d.confirm_override_file.title'),
1189
+ 'level' => 'question')=='yes')
1190
+ return file
1191
+ else
1192
+ return nil
1193
+ end
1194
+ else
1195
+ return file
1196
+ end
1197
+ end
1198
+
1122
1199
  def Arcadia.is_windows?
1123
- RUBY_PLATFORM =~ /mingw|mswin/
1200
+ OS.windows?
1201
+ #RUBY_PLATFORM =~ /mingw|mswin/
1124
1202
  end
1125
1203
 
1126
1204
  def Arcadia.ruby
@@ -1145,13 +1223,17 @@ class Arcadia < TkApplication
1145
1223
  end
1146
1224
  # $PATH check
1147
1225
  if _ret.nil?
1148
- ENV['PATH'].split(File::PATH_SEPARATOR).each{|_path|
1149
- _file = File.join(_path, _command)
1150
- if FileTest.exist?(_file)
1151
- _ret = _file
1152
- break
1153
- end
1154
- }
1226
+ begin
1227
+ ENV['PATH'].split(File::PATH_SEPARATOR).each{|_path|
1228
+ _file = File.join(_path, _command)
1229
+ if FileTest.exist?(_file)
1230
+ _ret = _file
1231
+ break
1232
+ end
1233
+ }
1234
+ rescue RuntimeError => e
1235
+ Arcadia.runtime_error(e)
1236
+ end
1155
1237
  end
1156
1238
  # gem path check
1157
1239
  gem_path = Gem.path
@@ -1361,28 +1443,52 @@ class ArcadiaMainToolbar < ArcadiaUserControl
1361
1443
  _hint = @hint
1362
1444
  _font = @font
1363
1445
  _caption = @caption
1364
- @item_obj = Tk::BWidget::Button.new(_args['frame'], Arcadia.style('toolbarbutton')){
1446
+ @item_obj = Arcadia.wf.toolbutton(_args['frame']){
1365
1447
  image _image if _image
1366
1448
  command _command if _command
1449
+ # height 23
1367
1450
  width 23
1368
- height 23
1369
- helptext _hint if _hint
1451
+ padding "5 0"
1370
1452
  text _caption if _caption
1371
1453
  }
1454
+ return if @item_obj.nil?
1455
+ @item_obj.hint=_hint
1456
+
1457
+ # @item_obj = Tk::BWidget::Button.new(_args['frame'], Arcadia.style('toolbarbutton')){
1458
+ # image _image if _image
1459
+ # command _command if _command
1460
+ # width 23
1461
+ # height 23
1462
+ # helptext _hint if _hint
1463
+ # #compound 'left'
1464
+ # }
1372
1465
  if _args['context_path'] && _args['last_item_for_context']
1373
1466
  @item_obj.pack('after'=>_args['last_item_for_context'].item_obj, 'side' =>'left', :padx=>2, :pady=>0)
1374
1467
  else
1375
1468
  @item_obj.pack('side' =>'left', :padx=>2, :pady=>0)
1376
1469
  end
1377
1470
  if _args['menu_button'] && _args['menu_button'] == 'yes'
1378
- @menu_button = TkMenuButton.new(_args['frame'], Arcadia.style('toolbarbutton')){|mb|
1379
- indicatoron false
1380
- menu TkMenu.new(mb, Arcadia.style('menu'))
1381
- image Arcadia.image_res(MENUBUTTON_ARROW_DOWN_GIF)
1382
- padx 0
1383
- pady 0
1471
+
1472
+ # item_menu = TkMenu.new(mb)
1473
+ # if !OS.mac?
1474
+ # item_menu.configure(Arcadia.style('menu'))
1475
+ # end
1476
+ item_menu = Arcadia.wf.menu(mb)
1477
+ @menu_button = Arcadia.wf.menubutton(_args['frame']){|mb|
1478
+ menu item_menu
1479
+ # image Arcadia.image_res(MENUBUTTON_ARROW_DOWN_GIF)
1384
1480
  pack('side'=> 'left','anchor'=> 's','pady'=>3)
1385
1481
  }
1482
+
1483
+
1484
+ # @menu_button = TkMenuButton.new(_args['frame'], Arcadia.style('toolbarbutton')){|mb|
1485
+ # indicatoron false
1486
+ # menu TkMenu.new(mb, Arcadia.style('menu'))
1487
+ # image Arcadia.image_res(MENUBUTTON_ARROW_DOWN_GIF)
1488
+ # padx 0
1489
+ # pady 0
1490
+ # pack('side'=> 'left','anchor'=> 's','pady'=>3)
1491
+ # }
1386
1492
  Arcadia.menu_root(_args['name'], @menu_button.cget('menu'))
1387
1493
  end
1388
1494
  #Tk::BWidget::Separator.new(@frame, :orient=>'vertical').pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w')
@@ -1392,7 +1498,7 @@ class ArcadiaMainToolbar < ArcadiaUserControl
1392
1498
  if _value
1393
1499
  @item_obj.state='normal'
1394
1500
  else
1395
- @item_obj.state='disable'
1501
+ @item_obj.state='disabled' if !OS.mac? # Workaround for #1100117 on mac
1396
1502
  end
1397
1503
  end
1398
1504
  end
@@ -1413,7 +1519,6 @@ class ArcadiaMainToolbar < ArcadiaUserControl
1413
1519
  def new_item(_sender, _args= nil)
1414
1520
  _context = _args['context']
1415
1521
  _context_path = _args['context_path']
1416
-
1417
1522
  if @last_context && _context != @last_context && _context_path.nil?
1418
1523
  new_separator
1419
1524
  end
@@ -1443,6 +1548,7 @@ end
1443
1548
 
1444
1549
  class ArcadiaMainMenu < ArcadiaUserControl
1445
1550
  SUF='user_menu'
1551
+ attr_reader :menubar
1446
1552
  class UserItem < UserItem
1447
1553
  attr_accessor :menu
1448
1554
  attr_accessor :underline
@@ -1452,7 +1558,7 @@ class ArcadiaMainMenu < ArcadiaUserControl
1452
1558
  item_args = Hash.new
1453
1559
  item_args[:image]=Arcadia.image_res(@image_data) if @image_data
1454
1560
  item_args[:label]=@caption
1455
- item_args[:font]=Arcadia.conf('menu.font')
1561
+ item_args[:font]=Arcadia.conf('menu.font') if !OS.mac?
1456
1562
  item_args[:underline]=@underline.to_i if @underline != nil
1457
1563
  item_args[:compound]='left'
1458
1564
  item_args[:command]=@command
@@ -1474,34 +1580,40 @@ class ArcadiaMainMenu < ArcadiaUserControl
1474
1580
  end
1475
1581
  end
1476
1582
  end
1477
-
1478
- def initialize(menu)
1479
- # create main menu
1480
- @menu = menu
1481
- build
1583
+
1584
+ def initialize(root)
1585
+ # Creating Menubar
1586
+ @menubar = Arcadia.wf.menu(root)
1587
+ # @menubar = TkMenu.new(root)
1482
1588
  begin
1483
- @menu.configure(Arcadia.style('menu'))
1589
+ # if !OS.mac?
1590
+ # @menubar.configure(Arcadia.style('menu').delete_if {|key, value| key=='tearoff'})
1591
+ # @menubar.extend(TkAutoPostMenu)
1592
+ # @menubar.event_posting_on
1593
+ # end
1594
+ root['menu'] = @menubar
1595
+ @menu_contexts = {}
1484
1596
  rescue RuntimeError => e
1485
- #p "RuntimeError : #{e.message}"
1486
1597
  Arcadia.runtime_error(e)
1487
1598
  end
1488
1599
  end
1489
-
1600
+
1490
1601
  def get_menu_context(_menubar, _context, _underline=nil)
1491
- menubuttons = _menubar[0..-1]
1492
- # cerchiamo il context
1493
- m_i = -1
1494
- menubuttons.each_with_index{|mb, i|
1495
- _t = mb[0].cget('text')
1496
- if _t==_context
1497
- m_i = i
1498
- break
1499
- end
1500
- }
1501
- if m_i > -1
1502
- _menubar[m_i][1]
1602
+ m = @menu_contexts[_context]
1603
+ if !m.nil?
1604
+ m
1503
1605
  else
1504
- _menubar.add_menu([[_context,_underline],[]])[1].delete(0)
1606
+ topmenu = Arcadia.wf.menu(_menubar)
1607
+ # topmenu = TkMenu.new(_menubar)
1608
+ # if !OS.mac?
1609
+ # topmenu.configure(Arcadia.style('menu'))
1610
+ # topmenu.extend(TkAutoPostMenu)
1611
+ # end
1612
+ opt = {:menu => topmenu, :label => _context}
1613
+ opt[:underline]=_underline if _underline
1614
+ _menubar.add(:cascade, opt)
1615
+ @menu_contexts[_context] = topmenu
1616
+ topmenu
1505
1617
  end
1506
1618
  end
1507
1619
 
@@ -1533,12 +1645,14 @@ class ArcadiaMainMenu < ArcadiaUserControl
1533
1645
  def get_sub_menu(menu_context, folder=nil)
1534
1646
  sub = ArcadiaMainMenu.sub_menu(menu_context, folder)
1535
1647
  if sub.nil?
1536
- sub = TkMenu.new(
1537
- :parent=>@pop_up,
1538
- :tearoff=>0
1539
- )
1540
- sub.configure(Arcadia.style('menu'))
1541
- sub.extend(TkAutoPostMenu)
1648
+ sub = Arcadia.wf.menu(:tearoff=>0)
1649
+ # sub = TkMenu.new(
1650
+ # :tearoff=>0
1651
+ # )
1652
+ # if !OS.mac?
1653
+ # sub.configure(Arcadia.style('menu'))
1654
+ # sub.extend(TkAutoPostMenu)
1655
+ # end
1542
1656
  #update_style(sub)
1543
1657
  menu_context.insert('end',
1544
1658
  :cascade,
@@ -1566,13 +1680,14 @@ class ArcadiaMainMenu < ArcadiaUserControl
1566
1680
 
1567
1681
  def new_item(_sender, _args= nil)
1568
1682
  return if _args.nil?
1683
+
1569
1684
  if _args['context_caption']
1570
1685
  conte = _args['context_caption']
1571
1686
  else
1572
1687
  conte = _args['context']
1573
1688
  end
1574
1689
  if _args['rif'] == 'main'
1575
- _args['menu']=make_menu_in_menubar(@menu, conte, _args['context_path'], _args['context_underline'])
1690
+ _args['menu']=make_menu_in_menubar(@menubar, conte, _args['context_path'], _args['context_underline'])
1576
1691
  else
1577
1692
  if Arcadia.menu_root(_args['rif'])
1578
1693
  _args['menu']=make_menu(Arcadia.menu_root(_args['rif']), _args['context_path'], _args['context_underline'])
@@ -1584,122 +1699,12 @@ class ArcadiaMainMenu < ArcadiaUserControl
1584
1699
  'msg'=>msg,
1585
1700
  'level'=>'error')
1586
1701
 
1587
- _args['menu']=make_menu_in_menubar(@menu, conte, _args['context_path'], _args['context_underline'])
1702
+ _args['menu']=make_menu_in_menubar(@menubar, conte, _args['context_path'], _args['context_underline'])
1588
1703
  end
1589
1704
  end
1590
1705
  super(_sender, _args)
1591
1706
  end
1592
1707
 
1593
-
1594
- def build
1595
- menu_spec_file = [
1596
- [Arcadia.text('main.menu.file'), 0],
1597
- [Arcadia.text('main.menu.file.open'), proc{Arcadia.process_event(OpenBufferEvent.new(self,'file'=>Arcadia.open_file_dialog))}, 0],
1598
- [Arcadia.text('main.menu.file.new'), proc{Arcadia.process_event(NewBufferEvent.new(self))}, 0],
1599
- #['Save', proc{EditorContract.instance.save_file_raised(self)},0],
1600
- [Arcadia.text('main.menu.file.save'), proc{Arcadia.process_event(SaveBufferEvent.new(self))},0],
1601
- [Arcadia.text('main.menu.file.save_as'), proc{Arcadia.process_event(SaveAsBufferEvent.new(self))},0],
1602
- '---',
1603
- [Arcadia.text('main.menu.file.quit'), proc{Arcadia.process_event(QuitEvent.new(self))}, 0]]
1604
-
1605
- menu_spec_edit = [[Arcadia.text('main.menu.edit'), 0],
1606
- [Arcadia.text('main.menu.edit.cut'), proc{Arcadia.process_event(CutTextEvent.new(self))}, 2],
1607
- [Arcadia.text('main.menu.edit.copy'), proc{Arcadia.process_event(CopyTextEvent.new(self))}, 0],
1608
- [Arcadia.text('main.menu.edit.paste'), proc{Arcadia.process_event(PasteTextEvent.new(self))}, 0],
1609
- [Arcadia.text('main.menu.edit.undo'), proc{Arcadia.process_event(UndoTextEvent.new(self))}, 0],
1610
- [Arcadia.text('main.menu.edit.redo'), proc{Arcadia.process_event(RedoTextEvent.new(self))}, 0],
1611
- [Arcadia.text('main.menu.edit.select_all'), proc{Arcadia.process_event(SelectAllTextEvent.new(self))}, 0],
1612
- [Arcadia.text('main.menu.edit.invert_selection'), proc{Arcadia.process_event(InvertSelectionTextEvent.new(self))}, 0],
1613
- [Arcadia.text('main.menu.edit.uppercase'), proc{Arcadia.process_event(UpperCaseTextEvent.new(self))}, 0],
1614
- [Arcadia.text('main.menu.edit.lowercase'), proc{Arcadia.process_event(LowerCaseTextEvent.new(self))}, 0],
1615
- [Arcadia.text('main.menu.edit.prettify_current'), proc{Arcadia.process_event(PrettifyTextEvent.new(self))}, 0],
1616
- '---',
1617
- [Arcadia.text('main.menu.edit.preferences'), proc{}, 0]]
1618
-
1619
- menu_spec_search = [[Arcadia.text('main.menu.search'), 0],
1620
- [Arcadia.text('main.menu.search.find_replace'), proc{Arcadia.process_event(SearchBufferEvent.new(self))}, 2],
1621
- [Arcadia.text('main.menu.search.find_in_files'), proc{Arcadia.process_event(SearchInFilesEvent.new(self))}, 2],
1622
- [Arcadia.text('main.menu.search.ack_im_file'), proc{Arcadia.process_event(AckInFilesEvent.new(self))}, 2],
1623
- [Arcadia.text('main.menu.search.go_to_line'), proc{Arcadia.process_event(GoToLineBufferEvent.new(self))}, 2]]
1624
-
1625
- menu_spec_view = [[Arcadia.text('main.menu.view'), 0],
1626
- [Arcadia.text('main.menu.view.show_hide_toolbar'), proc{$arcadia.show_hide_toolbar}, 2],
1627
- [Arcadia.text('main.menu.view.close_current_tab'), proc{Arcadia.process_event(CloseCurrentTabEvent.new(self))}, 0],
1628
- ]
1629
-
1630
- menu_spec_tools = [[Arcadia.text('main.menu.tools'), 0],
1631
- [Arcadia.text('main.menu.tools.keys_test'), $arcadia['action.test.keys'], 2],
1632
- [Arcadia.text('main.menu.tools.edit_prefs'), proc{Arcadia.process_event(OpenBufferEvent.new(self,'file'=>$arcadia.local_file_config))}, 0],
1633
- [Arcadia.text('main.menu.tools.load_from_edited_prefs'), proc{$arcadia.load_local_config}, 0]
1634
- ]
1635
- menu_spec_help = [[Arcadia.text('main.menu.help'), 0],
1636
- [Arcadia.text('main.menu.help.about'), $arcadia['action.show_about'], 2],]
1637
- begin
1638
- @menu.add_menu(menu_spec_file)
1639
- @menu.add_menu(menu_spec_edit)
1640
- @menu.add_menu(menu_spec_search)
1641
- @menu.add_menu(menu_spec_view)
1642
- @menu.add_menu(menu_spec_tools)
1643
- @menu.add_menu(menu_spec_help)
1644
- rescue RuntimeError => e
1645
- #p "RuntimeError : #{e.message}"
1646
- Arcadia.runtime_error(e)
1647
- end
1648
- # #@menu.bind_append("1", proc{
1649
- # chs = TkWinfo.children(@menu)
1650
- # hh = 25
1651
- # @last_post = nil
1652
- # chs.each{|ch|
1653
- # ch.bind_append("Enter", proc{|x,y,rx,ry|
1654
- # @last_post.unpost if @last_post && @last_post != ch.menu
1655
- # ch.menu.post(x-rx,y-ry+hh)
1656
- # @last_post=ch.menu}, "%X %Y %x %y")
1657
- # ch.bind_append("Leave", proc{
1658
- # @last_post.unpost if @last_post
1659
- # @last_post=nil
1660
- # })
1661
- # }
1662
- #
1663
- # #})
1664
-
1665
- # @menu.bind_append("Leave", proc{
1666
- # if Tk.focus != @last_menu_posted
1667
- # @last_post.unpost if @last_post
1668
- # @last_post=nil
1669
- # end
1670
- # })
1671
- #
1672
-
1673
-
1674
- # chs = TkWinfo.children(@menu)
1675
- # hh = 25
1676
- # @last_post = nil
1677
- # chs.each{|ch|
1678
- # ch.bind_append("Enter", proc{|x,y,rx,ry|
1679
- # @last_post.unpost if @last_post && @last_post != ch.menu
1680
- # ch.menu.post(x-rx,y-ry+hh)
1681
- # chmenus = TkWinfo.children(ch)
1682
- # @last_menu_posted = chmenus[0]
1683
- # @last_menu_posted.set_focus
1684
- # #@last_post=ch.menu
1685
- # }, "%X %Y %x %y")
1686
- # ch.bind_append("Leave", proc{
1687
- # @last_post.unpost if @last_post
1688
- # #@last_post=nil
1689
- # @last_post=ch.menu
1690
- # })
1691
- # }
1692
- # @menu.bind_append("Leave", proc{
1693
- # if Tk.focus != @last_menu_posted
1694
- # @last_post.unpost if @last_post
1695
- # @last_post=nil
1696
- # end
1697
- # })
1698
-
1699
- @menu.extend(TkAutoPostMenu)
1700
- @menu.event_posting_on
1701
- end
1702
-
1703
1708
  end
1704
1709
 
1705
1710
  class RunnerManager < TkFloatTitledFrame
@@ -1743,12 +1748,16 @@ class RunnerManager < TkFloatTitledFrame
1743
1748
  self.destroy
1744
1749
  end
1745
1750
  }
1746
- Tk::BWidget::Button.new(self,
1747
- 'command'=>_close_command,
1748
- 'helptext'=>@runner_hash[:file],
1749
- 'background'=>'white',
1750
- 'image'=> Arcadia.image_res(TRASH_GIF),
1751
- 'relief'=>'flat').pack('side' =>'right','padx'=>0)
1751
+ #Tk::BWidget::Button.new(self,
1752
+ b = Arcadia.wf.toolbutton(self,
1753
+ 'command'=>_close_command,
1754
+ # 'helptext'=>@runner_hash[:file],
1755
+ # 'background'=>'white',
1756
+ 'image'=> Arcadia.image_res(TRASH_GIF)
1757
+ # 'relief'=>'flat'
1758
+ ).pack('side' =>'right','padx'=>0)
1759
+ b.hint=@runner_hash[:file]
1760
+
1752
1761
  pack('side' =>'top','anchor'=>'nw','fill'=>'x','padx'=>5, 'pady'=>5)
1753
1762
  end
1754
1763
 
@@ -1825,7 +1834,7 @@ class ArcadiaAboutSplash < TkToplevel
1825
1834
  }
1826
1835
 
1827
1836
  @tkLabel2 = TkLabel.new(self){
1828
- text 'Arcadia Ide'
1837
+ text 'Arcadia IDE'
1829
1838
  background _bgcolor
1830
1839
  foreground '#ffffff'
1831
1840
  font Arcadia.instance['conf']['splash.subtitle.font']
@@ -1841,7 +1850,7 @@ class ArcadiaAboutSplash < TkToplevel
1841
1850
  place('x' => 100,'y' => 65,'height' => 19)
1842
1851
  }
1843
1852
  @tkLabel21 = TkLabel.new(self){
1844
- text Arcadia.text("main.about.by", ['Antonio Galeone - 2004/2013'])
1853
+ text Arcadia.text("main.about.by", ['Antonio Galeone - 2004/2014'])
1845
1854
  background _bgcolor
1846
1855
  foreground '#ffffff'
1847
1856
  font Arcadia.instance['conf']['splash.credits.font']
@@ -1863,7 +1872,7 @@ class ArcadiaAboutSplash < TkToplevel
1863
1872
  @tkLabelStep = TkLabel.new(self){
1864
1873
  text ''
1865
1874
  background _bgcolor
1866
- foreground 'yellow'
1875
+ foreground '#666666'
1867
1876
  font Arcadia.instance['conf']['splash.banner.font']
1868
1877
  justify 'left'
1869
1878
  anchor 'w'
@@ -1883,6 +1892,19 @@ class ArcadiaAboutSplash < TkToplevel
1883
1892
  info = TkApplication.sys_info
1884
1893
  set_sysinfo(info)
1885
1894
  Arcadia.attach_listener(self, ArcadiaProblemEvent)
1895
+ Arcadia.attach_listeners_listener(self, BuildEvent)
1896
+ end
1897
+
1898
+ def on_build(_event, _listener)
1899
+ next_step("... building #{_listener.class}")
1900
+ end
1901
+
1902
+ def on_before_build(_event, _listener)
1903
+ next_step("... pre building #{_listener.class}")
1904
+ end
1905
+
1906
+ def on_after_build(_event, _listener)
1907
+ next_step("... after building #{_listener.class}")
1886
1908
  end
1887
1909
 
1888
1910
  def problem_str
@@ -1896,7 +1918,7 @@ class ArcadiaAboutSplash < TkToplevel
1896
1918
  @tkAlert = TkLabel.new(self){
1897
1919
  image Arcadia.image_res(ALERT_GIF)
1898
1920
  background 'black'
1899
- place('x'=> 10,'y' => 150)
1921
+ place('x'=> 10,'y' => 152)
1900
1922
  }
1901
1923
 
1902
1924
  @tkLabelProblems = TkLabel.new(self){
@@ -1935,7 +1957,12 @@ class ArcadiaAboutSplash < TkToplevel
1935
1957
 
1936
1958
  def next_step(_txt = nil)
1937
1959
  @progress.numeric += 1
1938
- labelStep(_txt) if _txt
1960
+ labelStep("#{perc}% #{_txt}")
1961
+ end
1962
+
1963
+ def perc
1964
+ ret = @progress.numeric*100/@max
1965
+ ret > 100 ? 100:ret
1939
1966
  end
1940
1967
 
1941
1968
  def labelStep(_txt)
@@ -1947,9 +1974,11 @@ class ArcadiaAboutSplash < TkToplevel
1947
1974
  @progress.numeric = @max
1948
1975
  labelStep(_txt) if _txt
1949
1976
  Arcadia.detach_listener(self, ArcadiaProblemEvent)
1977
+ Arcadia.detach_listeners_listener(self, BuildEvent)
1950
1978
  end
1951
1979
  end
1952
1980
 
1981
+
1953
1982
  class ArcadiaProblemsShower
1954
1983
  def initialize(_arcadia)
1955
1984
  @arcadia = _arcadia
@@ -1971,7 +2000,7 @@ class ArcadiaProblemsShower
1971
2000
  show_problems
1972
2001
  else
1973
2002
  append_problem(_event)
1974
- @b_err.configure('text'=> button_text)
2003
+ #@b_err.configure('text'=> button_text)
1975
2004
  end
1976
2005
  end
1977
2006
  end
@@ -2000,12 +2029,12 @@ class ArcadiaProblemsShower
2000
2029
  @problems.each{|e|
2001
2030
  append_problem(e)
2002
2031
  }
2003
- if @tree.exist?('dependences_missing_node')
2004
- @tree.open_tree('dependences_missing_node', true)
2005
- end
2006
- if @tree.exist?('runtime_error_node')
2007
- @tree.open_tree('runtime_error_node', true)
2008
- end
2032
+ # if @tree.exist?('dependences_missing_node')
2033
+ # @tree.open_tree('dependences_missing_node', true)
2034
+ # end
2035
+ # if @tree.exist?('runtime_error_node')
2036
+ # @tree.open_tree('runtime_error_node', true)
2037
+ # end
2009
2038
  @showed=true
2010
2039
  rescue RuntimeError => e
2011
2040
  Arcadia.detach_listener(self, ArcadiaProblemEvent)
@@ -2020,71 +2049,66 @@ class ArcadiaProblemsShower
2020
2049
 
2021
2050
  def initialize_gui
2022
2051
  # float_frame
2023
- args = {'width'=>600, 'height'=>300, 'x'=>400, 'y'=>100}
2024
- @ff = @arcadia.layout.add_float_frame(args).hide
2025
- @ff.title(Arcadia.text("main.ps.title"))
2026
-
2027
- #tree
2028
- @tree = BWidgetTreePatched.new(@ff.frame, Arcadia.style('treepanel')){
2029
- showlines false
2030
- deltay 22
2031
- # opencmd do_open_folder_cmd
2032
- # closecmd do_close_folder_cmd
2033
- # selectcommand do_select_item
2034
- # crosscloseimage TkPhotoImage.new('dat' => PLUS_GIF)
2035
- # crossopenimage TkPhotoImage.new('dat' => MINUS_GIF)
2036
- }
2037
- @tree.extend(TkScrollableWidget).show(0,0)
2038
-
2039
- do_double_click = proc{
2040
- _selected = @tree.selected
2041
- _selected_text = @tree.itemcget(_selected, 'text')
2042
- if _selected_text
2043
- _file, _row, _other = _selected_text.split(':')
2044
- if File.exist?(_file)
2045
- begin
2046
- r = _row.strip.to_i
2047
- integer = true
2048
- rescue Exception => e
2049
- integer = false
2050
- end
2051
- if integer
2052
- OpenBufferTransientEvent.new(self,'file'=>_file, 'row'=>r).go!
2053
- end
2054
- end
2055
- end
2056
- }
2057
- @tree.textbind_append('Double-1',do_double_click)
2058
-
2059
-
2060
- # call button
2061
- command = proc{
2062
- if @ff.visible?
2063
- @ff.hide
2064
- #@visible = false
2065
- else
2066
- @ff.show
2067
- #@visible = true
2068
- end
2069
- }
2070
-
2071
- b_style = Arcadia.style('toolbarbutton')
2072
- b_style["relief"]='groove'
2073
- # b_style["borderwidth"]=2
2074
- b_style["highlightbackground"]='red'
2075
-
2076
- b_text = button_text
2077
-
2078
- @b_err = Tk::BWidget::Button.new(@arcadia['toolbar'].frame, b_style){
2079
- image Arcadia.image_res(ALERT_GIF)
2080
- compound 'left'
2081
- padx 2
2082
- command command if command
2083
- #width 100
2084
- #height 20
2085
- #helptext _hint if _hint
2086
- text b_text
2087
- }.pack('side' =>'left','before'=>@arcadia['toolbar'].items.values[0].item_obj, :padx=>2, :pady=>0)
2052
+ # args = {'width'=>600, 'height'=>300, 'x'=>400, 'y'=>100}
2053
+ # @ff = @arcadia.layout.add_float_frame(args).hide
2054
+ # @ff.title(Arcadia.text("main.ps.title"))
2055
+ #
2056
+ # #tree
2057
+ # @tree = BWidgetTreePatched.new(@ff.frame, Arcadia.style('treepanel')){
2058
+ # showlines false
2059
+ # deltay 22
2060
+ # }
2061
+ # @tree.extend(TkScrollableWidget).show(0,0)
2062
+ #
2063
+ # do_double_click = proc{
2064
+ # _selected = @tree.selected
2065
+ # _selected_text = @tree.itemcget(_selected, 'text')
2066
+ # if _selected_text
2067
+ # _file, _row, _other = _selected_text.split(':')
2068
+ # if File.exist?(_file)
2069
+ # begin
2070
+ # r = _row.strip.to_i
2071
+ # integer = true
2072
+ # rescue Exception => e
2073
+ # integer = false
2074
+ # end
2075
+ # if integer
2076
+ # OpenBufferTransientEvent.new(self,'file'=>_file, 'row'=>r).go!
2077
+ # end
2078
+ # end
2079
+ # end
2080
+ # }
2081
+ # @tree.textbind_append('Double-1',do_double_click)
2082
+ #
2083
+ #
2084
+ # # call button
2085
+ # command = proc{
2086
+ # if @ff.visible?
2087
+ # @ff.hide
2088
+ # #@visible = false
2089
+ # else
2090
+ # @ff.show
2091
+ # #@visible = true
2092
+ # end
2093
+ # }
2094
+ #
2095
+ # b_style = Arcadia.style('toolbarbutton')
2096
+ # b_style["relief"]='groove'
2097
+ # # b_style["borderwidth"]=2
2098
+ # b_style["highlightbackground"]='red'
2099
+ #
2100
+ # b_text = button_text
2101
+ #
2102
+ # @b_err = Tk::BWidget::Button.new(@arcadia['toolbar'].frame, b_style){
2103
+ # image Arcadia.image_res(ALERT_GIF)
2104
+ # compound 'left'
2105
+ # padx 2
2106
+ # command command if command
2107
+ # #width 100
2108
+ # #height 20
2109
+ # #helptext _hint if _hint
2110
+ # text b_text
2111
+ # }.pack('side' =>'left','before'=>@arcadia['toolbar'].items.values[0].item_obj, :padx=>2, :pady=>0)
2088
2112
 
2089
2113
  end
2090
2114
 
@@ -2094,78 +2118,85 @@ class ArcadiaProblemsShower
2094
2118
  end
2095
2119
 
2096
2120
  def append_problem(e)
2097
- parent_node='root'
2121
+ # parent_node='root'
2098
2122
  case e.type
2099
2123
  when ArcadiaProblemEvent::DEPENDENCE_MISSING_TYPE
2100
- parent_node='dependences_missing_node'
2124
+ # parent_node='dependences_missing_node'
2101
2125
  text = Arcadia.text("main.ps.dependences_missing")
2102
- if !@tree.exist?(parent_node)
2103
- @tree.insert('end', 'root' ,parent_node, {
2104
- 'text' => text ,
2105
- 'helptext' => text,
2106
- 'drawcross'=>'auto',
2107
- 'deltax'=>-1,
2108
- 'image'=> Arcadia.image_res(BROKEN_GIF)
2109
- }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2110
- )
2126
+ # if !@tree.exist?(parent_node)
2127
+ # @tree.insert('end', 'root' ,parent_node, {
2128
+ # 'text' => text ,
2129
+ # 'helptext' => text,
2130
+ # 'drawcross'=>'auto',
2131
+ # 'deltax'=>-1,
2132
+ # 'image'=> Arcadia.image_res(BROKEN_GIF)
2133
+ # }.update(Arcadia.style('treeitem'))
2134
+ # )
2135
+ #
2136
+ # end
2137
+ # @dmc+=1
2138
+ # @tree.itemconfigure('dependences_missing_node','text'=>"#{text} (#{@dmc})" )
2111
2139
 
2112
- end
2113
- @dmc+=1
2114
- @tree.itemconfigure('dependences_missing_node','text'=>"#{text} (#{@dmc})" )
2115
2140
  when ArcadiaProblemEvent::RUNTIME_ERROR_TYPE
2116
- parent_node='runtime_error_node'
2141
+ # parent_node='runtime_error_node'
2117
2142
  text = Arcadia.text("main.ps.runtime_errors")
2118
- if !@tree.exist?(parent_node)
2119
- @tree.insert('end', 'root' ,parent_node, {
2120
- 'text' => text ,
2121
- 'helptext' => text,
2122
- 'drawcross'=>'auto',
2123
- 'deltax'=>-1,
2124
- 'image'=> Arcadia.image_res(ERROR_GIF)
2125
- }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2126
- )
2127
- end
2128
- @rec+=1
2129
- @tree.itemconfigure('runtime_error_node','text'=>"#{text} (#{@rec})" )
2130
- end
2143
+ # if !@tree.exist?(parent_node)
2144
+ # @tree.insert('end', 'root' ,parent_node, {
2145
+ # 'text' => text ,
2146
+ # 'helptext' => text,
2147
+ # 'drawcross'=>'auto',
2148
+ # 'deltax'=>-1,
2149
+ # 'image'=> Arcadia.image_res(ERROR_GIF)
2150
+ # }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2151
+ # )
2152
+ # end
2153
+ # @rec+=1
2154
+ # @tree.itemconfigure('runtime_error_node','text'=>"#{text} (#{@rec})" )
2155
+ end
2156
+
2157
+ output_mark = Arcadia.console(self,'msg'=>"#{text} : ", 'level'=>'system_error', 'mark'=>output_mark)
2158
+
2131
2159
  title_node="node_#{new_sequence_value}"
2132
2160
  detail_node="detail_of_#{title_node}"
2133
2161
 
2134
- @tree.insert('end', parent_node ,title_node, {
2135
- 'text' => e.title ,
2136
- 'helptext' => e.title,
2137
- 'drawcross'=>'auto',
2138
- 'deltax'=>-1,
2139
- 'image'=> Arcadia.image_res(ITEM_GIF)
2140
- }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2141
- )
2142
- if e.detail.kind_of?(Array)
2143
- e.detail.each_with_index{|line,i|
2144
- @tree.insert('end', title_node , "#{detail_node}_#{i}" , {
2145
- 'text' => line ,
2146
- 'helptext' => i.to_s,
2147
- 'drawcross'=>'auto',
2148
- 'deltax'=>-1,
2149
- 'image'=> Arcadia.image_res(ITEM_DETAIL_GIF)
2150
- }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2151
- )
2162
+ # @tree.insert('end', parent_node ,title_node, {
2163
+ # 'text' => e.title ,
2164
+ # 'helptext' => e.title,
2165
+ # 'drawcross'=>'auto',
2166
+ # 'deltax'=>-1,
2167
+ # 'image'=> Arcadia.image_res(ITEM_GIF)
2168
+ # }.update(Arcadia.style('treeitem'))
2169
+ # )
2152
2170
 
2153
- }
2171
+
2172
+ if e.detail.kind_of?(Array)
2173
+ # e.detail.each_with_index{|line,i|
2174
+ # @tree.insert('end', title_node , "#{detail_node}_#{i}" , {
2175
+ # 'text' => line ,
2176
+ # 'helptext' => i.to_s,
2177
+ # 'drawcross'=>'auto',
2178
+ # 'deltax'=>-1,
2179
+ # 'image'=> Arcadia.image_res(ITEM_DETAIL_GIF)
2180
+ # }.update(Arcadia.style('treeitem'))
2181
+ # )
2182
+ # }
2154
2183
  else
2155
- @tree.insert('end', title_node , detail_node , {
2156
- 'text' => e.detail ,
2157
- 'helptext' => e.title,
2158
- 'drawcross'=>'auto',
2159
- 'deltax'=>-1,
2160
- 'image'=> Arcadia.image_res(ITEM_DETAIL_GIF)
2161
- }.update(Arcadia.style('treeitem')) #.update({'fill'=>Arcadia.conf('inactiveforeground')}))
2162
- )
2184
+ # @tree.insert('end', title_node , detail_node , {
2185
+ # 'text' => e.detail ,
2186
+ # 'helptext' => e.title,
2187
+ # 'drawcross'=>'auto',
2188
+ # 'deltax'=>-1,
2189
+ # 'image'=> Arcadia.image_res(ITEM_DETAIL_GIF)
2190
+ # }.update(Arcadia.style('treeitem'))
2191
+ # )
2163
2192
  end
2164
2193
 
2194
+ output_mark = Arcadia.console(self,'msg'=>"#{e.title}\n> #{e.detail}", 'level'=>'system_error', 'mark'=>output_mark, 'append'=>true)
2165
2195
 
2166
2196
  end
2167
2197
  end
2168
2198
 
2199
+
2169
2200
  class ArcadiaActionDispatcher
2170
2201
 
2171
2202
  def initialize(_arcadia)
@@ -2322,7 +2353,7 @@ class ArcadiaSh < TkToplevel
2322
2353
  @text.delete('0.0','end')
2323
2354
  else
2324
2355
  begin
2325
- if RUBY_PLATFORM =~ /mingw|mswin/
2356
+ if OS.windows?
2326
2357
  p = IO::popen("#{_cmd} 2>&1")
2327
2358
  out(p.read, 'response')
2328
2359
  @result = true
@@ -2411,13 +2442,13 @@ class ArcadiaGemsWizard
2411
2442
 
2412
2443
  end
2413
2444
 
2414
-
2415
2445
  class ArcadiaDialogManager
2416
2446
  DialogParams = Struct.new("DialogParams",
2417
2447
  :type,
2418
2448
  :res_array,
2419
2449
  :level,
2420
- :msg
2450
+ :msg,
2451
+ :title
2421
2452
  )
2422
2453
 
2423
2454
  def initialize(_arcadia)
@@ -2443,6 +2474,11 @@ class ArcadiaDialogManager
2443
2474
  else
2444
2475
  ret.msg = _event.msg
2445
2476
  end
2477
+ if _event.title && _event.title.length > _event.class::TITLE_MAX_CHARS
2478
+ ret.title = _event.title[0.._event.class::TITLE_MAX_CHARS]+' ...'
2479
+ else
2480
+ ret.title = _event.title
2481
+ end
2446
2482
  end
2447
2483
  ret
2448
2484
  end
@@ -2480,14 +2516,7 @@ class ArcadiaDialogManager
2480
2516
 
2481
2517
  def do_hinner_dialog(_event)
2482
2518
  par = dialog_params(_event, false)
2483
- dialog_frame = TkFrame.new(Arcadia.layout.base_frame, Arcadia.style('panel')){
2484
- #relief 'solid'
2485
- #borderwidth 3
2486
- highlightbackground Arcadia.conf('hightlight.link.foreground')
2487
- #highlightcolor 'red'
2488
- highlightthickness 1
2489
- }
2490
- dialog_frame.pack('side' =>'top','after'=>Arcadia.layout.root, 'anchor'=>'nw','fill'=>'x', 'padx'=>0, 'pady'=>0)
2519
+ dialog_frame = HinnerDialog.new
2491
2520
  max_width = 0
2492
2521
  par.res_array.each{|v|
2493
2522
  l = v.length
@@ -2495,38 +2524,27 @@ class ArcadiaDialogManager
2495
2524
  }
2496
2525
  res = nil
2497
2526
  par.res_array.reverse_each{|value|
2498
- Tk::BWidget::Button.new(dialog_frame, Arcadia.style('button')){
2499
- command proc{res = value}
2527
+ # Tk::BWidget::Button.new(dialog_frame, Arcadia.style('button')){
2528
+ Arcadia.wf.button(dialog_frame){
2529
+ command proc{res = value;dialog_frame.release}
2500
2530
  text value.capitalize
2501
- helptext value.capitalize
2531
+ #helptext value.capitalize
2502
2532
  width max_width*2
2503
- }.pack('side' =>'right','padx'=>5, 'pady'=>5)
2533
+ pack('side' =>'right','padx'=>5, 'pady'=>5)
2534
+ }.hint=value.capitalize
2504
2535
  }
2505
2536
 
2506
2537
  Tk::BWidget::Label.new(dialog_frame,Arcadia.style('label')){
2507
2538
  text par.msg
2508
- helptext _event.msg
2509
- # }.pack('fill'=>'x','side' =>'left')
2539
+ helptext _event.title
2510
2540
  }.pack('side' =>'right','padx'=>5, 'pady'=>5)
2511
2541
 
2512
- # Tk::BWidget::Label.new(dialog_frame,Arcadia.style('label')){
2513
- # compound 'left'
2514
- # Tk::Anigif.image(self, "#{Dir.pwd}/ext/ae-subprocess-inspector/process.res")
2515
- # }.pack('side' =>'right','padx'=>10)
2542
+ Tk::BWidget::Label.new(dialog_frame,Arcadia.style('label')){
2543
+ compound 'left'
2544
+ Tk::Anigif.image(self, "#{Dir.pwd}/ext/ae-subprocess-inspector/process.res")
2545
+ }.pack('side' =>'right','padx'=>10)
2516
2546
 
2517
-
2518
- Tk.update
2519
- dialog_frame.grab("set")
2520
- begin
2521
- while res == nil do
2522
- Tk.update
2523
- sleep(0.1)
2524
- end
2525
- ensure
2526
- dialog_frame.grab("release")
2527
- end
2528
- dialog_frame.destroy
2529
- Tk.update
2547
+ dialog_frame.show_modal
2530
2548
  _event.add_result(self, 'value'=>res)
2531
2549
  end
2532
2550
 
@@ -2557,13 +2575,13 @@ class ArcadiaLayout
2557
2575
  # :frame,
2558
2576
  # :ffw
2559
2577
  # )
2560
- attr_reader :base_frame
2578
+ attr_reader :parent_frame
2561
2579
  HIDDEN_DOMAIN = '-1.-1'
2562
2580
  def initialize(_arcadia, _frame, _autotab=true)
2563
2581
  @arcadia = _arcadia
2564
2582
  @frames = Array.new
2565
2583
  @frames[0] = Array.new
2566
- @base_frame = _frame
2584
+ @parent_frame = _frame
2567
2585
  @content_frame = TkFrame.new(_frame).pack('fill'=>'both', :padx=>0, :pady=>0, :expand => 'yes')
2568
2586
  # @dialog_frame = TkFrame.new(_frame)
2569
2587
 
@@ -3318,7 +3336,7 @@ class ArcadiaLayout
3318
3336
  def change_domain(_target_domain, _source_name)
3319
3337
  source_domain = @wrappers[_source_name].domain
3320
3338
  source_has_domain = !source_domain.nil?
3321
- if @arcadia.conf('layout.exchange_panel_if_no_tabbed')=='true' && source_has_domain && @panels[source_domain]['sons'].length ==1 && @panels[_target_domain]['sons'].length > 0
3339
+ if @arcadia.conf('layout.exchange_panel_if_no_tabbed')=='true' && source_has_domain && @panels[source_domain]['sons'].length == 1 && @panels[_target_domain]['sons'].length > 0
3322
3340
  # change ------
3323
3341
  ffw1 = raised_fixed_frame(_target_domain)
3324
3342
  ffw2 = @panels[source_domain]['sons'].values[0]
@@ -3331,7 +3349,7 @@ class ArcadiaLayout
3331
3349
  @panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name), @panels[source_domain]['root'].last_caption_image(ffw2.name))
3332
3350
  @panels[source_domain]['root'].save_caption(ffw1.name, @panels[_target_domain]['root'].last_caption(ffw1.name), @panels[_target_domain]['root'].last_caption_image(ffw1.name))
3333
3351
  @panels[_target_domain]['root'].restore_caption(ffw2.name)
3334
- @panels[source_domain]['root'].restore_caption(ffw1.name)
3352
+ @panels[source_domain]['root'].restore_caption(ffw1.name)
3335
3353
  @panels[_target_domain]['root'].change_adapters(ffw2.name, @panels[source_domain]['root'].forge_transient_adapter(ffw2.name))
3336
3354
  @panels[source_domain]['root'].change_adapters(ffw1.name, @panels[_target_domain]['root'].forge_transient_adapter(ffw1.name))
3337
3355
  elsif source_has_domain && @panels[source_domain]['sons'].length >= 1
@@ -3342,6 +3360,7 @@ class ArcadiaLayout
3342
3360
  @panels[_target_domain]['root'].save_caption(ffw2.name, @panels[source_domain]['root'].last_caption(ffw2.name), @panels[source_domain]['root'].last_caption_image(ffw2.name))
3343
3361
  @panels[_target_domain]['root'].restore_caption(ffw2.name)
3344
3362
  @panels[_target_domain]['root'].change_adapters(ffw2.name, @panels[source_domain]['root'].forge_transient_adapter(ffw2.name))
3363
+ #Tk.event_generate(ffw2.hinner_frame, "Map")
3345
3364
  elsif !source_has_domain
3346
3365
  ffw2 = @wrappers[_source_name]
3347
3366
  ffw2.domain = _target_domain
@@ -3357,33 +3376,6 @@ class ArcadiaLayout
3357
3376
  LayoutChangedDomainEvent.new(self, 'old_domain'=>source_domain, 'new_domain'=>_target_domain).go!
3358
3377
  end
3359
3378
 
3360
- # def change_domain_old(_dom1, _dom2, _name2)
3361
- # tt1= @panels[_dom1]['root'].top_text
3362
- # tt2= @panels[_dom2]['root'].top_text
3363
- # if @panels[_dom2]['sons'].length ==1 && @panels[_dom1]['sons'].length > 0
3364
- # # change ------
3365
- # ffw1 = raised_fixed_frame(_dom1)
3366
- # ffw2 = @panels[_dom2]['sons'].values[0]
3367
- # unregister_panel(ffw1,false,false) if ffw1
3368
- # unregister_panel(ffw2,false,false)
3369
- # ffw1.domain = _dom2 if ffw1
3370
- # ffw2.domain = _dom1
3371
- # register_panel(ffw1, ffw1.hinner_frame) if ffw1
3372
- # register_panel(ffw2, ffw2.hinner_frame)
3373
- # @panels[_dom1]['root'].top_text(tt2)
3374
- # @panels[_dom2]['root'].top_text(tt1)
3375
- # elsif @panels[_dom2]['sons'].length > 1
3376
- # ffw2 = @panels[_dom2]['sons'][_name2]
3377
- # unregister_panel(ffw2, false, false)
3378
- # ffw2.domain = _dom1
3379
- # register_panel(ffw2, ffw2.hinner_frame)
3380
- # @panels[_dom1]['root'].top_text(tt2)
3381
- # @panels[_dom2]['root'].top_text('')
3382
- # end
3383
- # # refresh -----
3384
- # build_invert_menu
3385
- # end
3386
-
3387
3379
  def sorted_menu_index(_menu, _label)
3388
3380
  index = '0'
3389
3381
  i_end = _menu.index('end').to_i - 4
@@ -3435,13 +3427,15 @@ class ArcadiaLayout
3435
3427
  submenu = ArcadiaMainMenu.sub_menu(_menu, submenu_title)
3436
3428
  end
3437
3429
  if submenu.nil?
3438
- submenu = TkMenu.new(
3430
+
3431
+ #submenu = TkMenu.new(
3432
+ submenu = Arcadia.wf.menu(
3439
3433
  :parent=>_menu,
3440
3434
  :tearoff=>0,
3441
3435
  :title => submenu_title
3442
3436
  )
3443
- submenu.extend(TkAutoPostMenu)
3444
- submenu.configure(Arcadia.style('menu'))
3437
+ #submenu.extend(TkAutoPostMenu)
3438
+ #submenu.configure(Arcadia.style('menu'))
3445
3439
  _menu.insert(ind,
3446
3440
  :cascade,
3447
3441
  :image=>Arcadia.image_res(ARROW_LEFT_GIF),
@@ -3479,7 +3473,7 @@ class ArcadiaLayout
3479
3473
  end
3480
3474
 
3481
3475
  def process_frame(_ffw)
3482
- #p "processo frame #{_ffw.title}"
3476
+ #p "process frame #{_ffw.title}"
3483
3477
  #-------
3484
3478
  is_plus = Arcadia.extension(_ffw.name).kind_of?(ArcadiaExtPlus)
3485
3479
  #-------
@@ -3749,7 +3743,20 @@ class ArcadiaLayout
3749
3743
  def view_panel
3750
3744
  end
3751
3745
 
3752
- def hide_panel
3746
+ def hide_panel(_domain, _extension)
3747
+ pan = @panels[_domain]
3748
+ if @tabbed
3749
+ if pan && pan['notebook'] != nil
3750
+ pan['notebook'].unpack
3751
+ end
3752
+ elsif pan
3753
+ pan['sons'].each{|k,v|
3754
+ if k == _extension
3755
+ v.hide
3756
+ break
3757
+ end
3758
+ }
3759
+ end
3753
3760
  end
3754
3761
 
3755
3762
  def [](_row, _col)
@@ -3757,7 +3764,7 @@ class ArcadiaLayout
3757
3764
  end
3758
3765
 
3759
3766
  def frame(_domain_name, _name)
3760
- @panels[_domain_name]['sons'][_name].frame
3767
+ @panels[_domain_name]['sons'][_name].hinner_frame
3761
3768
  end
3762
3769
 
3763
3770
  # def domain_for_frame(_domain_name, _name)
@@ -3782,6 +3789,21 @@ class ArcadiaLayout
3782
3789
  return _frame
3783
3790
  end
3784
3791
 
3792
+ def add_hinner_dialog(side='top', args=nil)
3793
+ hd = HinnerDialog.new(side, args)
3794
+ return hd
3795
+ end
3796
+
3797
+ def add_hinner_splitted_dialog(side='top', height=100, args=nil)
3798
+ hd = HinnerSplittedDialog.new(side, height, args)
3799
+ return hd
3800
+ end
3801
+
3802
+ def add_hinner_splitted_dialog_titled(title=nil, side='top', height=100, args=nil)
3803
+ hd = HinnerSplittedDialogTitled.new(title, side, height, args)
3804
+ return hd
3805
+ end
3806
+
3785
3807
  def dump_splitter(_splitter)
3786
3808
  ret = ''
3787
3809
  if _splitter.instance_of?(AGTkVSplittedFrames)
@@ -4112,4 +4134,18 @@ class ArcadiaUtils
4112
4134
  }
4113
4135
  ret.concat(subpids)
4114
4136
  end
4137
+
4138
+ def ArcadiaUtils.exec(_cmd_=nil)
4139
+ return nil if _cmd_.nil?
4140
+ to_ret = ''
4141
+ begin
4142
+ open("|#{_cmd_}", "r"){|f|
4143
+ #to_ret = f.readlines
4144
+ to_ret = f.read
4145
+ }
4146
+ rescue RuntimeError => e
4147
+ Arcadia.runtime_error(e)
4148
+ end
4149
+ to_ret
4150
+ end
4115
4151
  end