arcadia 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/README +8 -10
  2. data/bin/arcadia +13 -13
  3. data/bin/arcadia.bat +0 -0
  4. data/conf/arcadia.conf +35 -18
  5. data/conf/arcadia.init.rb +0 -0
  6. data/conf/arcadia.res.rb +10 -0
  7. data/ext/ae-breakpoints/ae-breakpoints.conf +0 -0
  8. data/ext/ae-breakpoints/ae-breakpoints.rb +368 -349
  9. data/ext/ae-editor/ae-editor.conf +2 -2
  10. data/ext/ae-editor/ae-editor.rb +1248 -445
  11. data/ext/ae-editor/langs/conf.lang +0 -0
  12. data/ext/ae-editor/langs/lang.lang.bind +0 -0
  13. data/ext/ae-editor/langs/rb.lang +0 -0
  14. data/ext/ae-editor/langs/rbw.lang.bind +0 -0
  15. data/ext/ae-file-history/ae-file-history.conf +1 -1
  16. data/ext/ae-file-history/ae-file-history.rb +23 -17
  17. data/ext/ae-output/ae-output.conf +0 -0
  18. data/ext/ae-output/ae-output.rb +262 -200
  19. data/ext/ae-rad/ae-rad-inspector.rb +34 -26
  20. data/ext/ae-rad/ae-rad-libs.rb +0 -0
  21. data/ext/ae-rad/ae-rad-palette.rb +0 -0
  22. data/ext/ae-rad/ae-rad.conf +0 -0
  23. data/ext/ae-rad/ae-rad.rb +0 -0
  24. data/ext/ae-rad/lib/tk/al-tk.rb +6 -2
  25. data/ext/ae-rad/lib/tk/al-tk.res.rb +0 -0
  26. data/ext/ae-rad/lib/tk/al-tkarcadia.rb +0 -0
  27. data/ext/ae-rad/lib/tk/al-tkcustom.rb +0 -0
  28. data/ext/ae-rad/lib/tkext/al-bwidget.rb +0 -0
  29. data/ext/ae-rad/lib/tkext/al-iwidgets.rb +0 -0
  30. data/ext/ae-rad/lib/tkext/al-tile.rb +0 -0
  31. data/ext/ae-rad/lib/tkext/al-tktable.rb +0 -0
  32. data/ext/ae-ruby-debug/ae-ruby-debug.conf +0 -0
  33. data/ext/ae-ruby-debug/ae-ruby-debug.rb +1 -0
  34. data/ext/ae-search-in-files/ae-search-in-files.conf +0 -0
  35. data/ext/ae-search-in-files/ae-search-in-files.rb +14 -10
  36. data/ext/ae-shell/ae-shell.conf +0 -0
  37. data/ext/ae-shell/ae-shell.rb +1 -1
  38. data/ext/ae-shell/sh.rb +0 -0
  39. data/lib/a-commons.rb +5 -1
  40. data/lib/a-contracts.rb +1 -0
  41. data/lib/a-core.rb +40 -9
  42. data/lib/a-tkcommons.rb +229 -1
  43. data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +0 -0
  44. data/tcl/BWidget-1.8.0/BWman/BWidget.html +0 -0
  45. data/tcl/BWidget-1.8.0/BWman/Button.html +0 -0
  46. data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +0 -0
  47. data/tcl/BWidget-1.8.0/BWman/ComboBox.html +0 -0
  48. data/tcl/BWidget-1.8.0/BWman/Dialog.html +0 -0
  49. data/tcl/BWidget-1.8.0/BWman/DragSite.html +0 -0
  50. data/tcl/BWidget-1.8.0/BWman/DropSite.html +0 -0
  51. data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +0 -0
  52. data/tcl/BWidget-1.8.0/BWman/Entry.html +0 -0
  53. data/tcl/BWidget-1.8.0/BWman/Label.html +0 -0
  54. data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +0 -0
  55. data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +0 -0
  56. data/tcl/BWidget-1.8.0/BWman/ListBox.html +0 -0
  57. data/tcl/BWidget-1.8.0/BWman/MainFrame.html +0 -0
  58. data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +0 -0
  59. data/tcl/BWidget-1.8.0/BWman/NoteBook.html +0 -0
  60. data/tcl/BWidget-1.8.0/BWman/PagesManager.html +0 -0
  61. data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +0 -0
  62. data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +0 -0
  63. data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +0 -0
  64. data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +0 -0
  65. data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +0 -0
  66. data/tcl/BWidget-1.8.0/BWman/ScrollView.html +0 -0
  67. data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +0 -0
  68. data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +0 -0
  69. data/tcl/BWidget-1.8.0/BWman/SelectColor.html +0 -0
  70. data/tcl/BWidget-1.8.0/BWman/SelectFont.html +0 -0
  71. data/tcl/BWidget-1.8.0/BWman/Separator.html +0 -0
  72. data/tcl/BWidget-1.8.0/BWman/SpinBox.html +0 -0
  73. data/tcl/BWidget-1.8.0/BWman/StatusBar.html +0 -0
  74. data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +0 -0
  75. data/tcl/BWidget-1.8.0/BWman/Tree.html +0 -0
  76. data/tcl/BWidget-1.8.0/BWman/Widget.html +0 -0
  77. data/tcl/BWidget-1.8.0/BWman/contents.html +0 -0
  78. data/tcl/BWidget-1.8.0/BWman/index.html +0 -0
  79. data/tcl/BWidget-1.8.0/BWman/navtree.html +0 -0
  80. data/tcl/BWidget-1.8.0/BWman/options.htm +0 -0
  81. data/tcl/BWidget-1.8.0/CHANGES.txt +0 -0
  82. data/tcl/BWidget-1.8.0/ChangeLog +0 -0
  83. data/tcl/BWidget-1.8.0/LICENSE.txt +0 -0
  84. data/tcl/BWidget-1.8.0/README.txt +0 -0
  85. data/tcl/BWidget-1.8.0/arrow.tcl +0 -0
  86. data/tcl/BWidget-1.8.0/bitmap.tcl +0 -0
  87. data/tcl/BWidget-1.8.0/button.tcl +0 -0
  88. data/tcl/BWidget-1.8.0/buttonbox.tcl +0 -0
  89. data/tcl/BWidget-1.8.0/color.tcl +0 -0
  90. data/tcl/BWidget-1.8.0/combobox.tcl +0 -0
  91. data/tcl/BWidget-1.8.0/demo/basic.tcl +0 -0
  92. data/tcl/BWidget-1.8.0/demo/bwidget.xbm +0 -0
  93. data/tcl/BWidget-1.8.0/demo/demo.tcl +0 -0
  94. data/tcl/BWidget-1.8.0/demo/dnd.tcl +0 -0
  95. data/tcl/BWidget-1.8.0/demo/manager.tcl +0 -0
  96. data/tcl/BWidget-1.8.0/demo/select.tcl +0 -0
  97. data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +0 -0
  98. data/tcl/BWidget-1.8.0/demo/tree.tcl +0 -0
  99. data/tcl/BWidget-1.8.0/demo/x1.xbm +0 -0
  100. data/tcl/BWidget-1.8.0/dialog.tcl +0 -0
  101. data/tcl/BWidget-1.8.0/dragsite.tcl +0 -0
  102. data/tcl/BWidget-1.8.0/dropsite.tcl +0 -0
  103. data/tcl/BWidget-1.8.0/dynhelp.tcl +0 -0
  104. data/tcl/BWidget-1.8.0/entry.tcl +0 -0
  105. data/tcl/BWidget-1.8.0/font.tcl +0 -0
  106. data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
  107. data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
  108. data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
  109. data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
  110. data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
  111. data/tcl/BWidget-1.8.0/images/error.gif +0 -0
  112. data/tcl/BWidget-1.8.0/images/file.gif +0 -0
  113. data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
  114. data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
  115. data/tcl/BWidget-1.8.0/images/info.gif +0 -0
  116. data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
  117. data/tcl/BWidget-1.8.0/images/minus.xbm +0 -0
  118. data/tcl/BWidget-1.8.0/images/new.gif +0 -0
  119. data/tcl/BWidget-1.8.0/images/opcopy.xbm +0 -0
  120. data/tcl/BWidget-1.8.0/images/open.gif +0 -0
  121. data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
  122. data/tcl/BWidget-1.8.0/images/oplink.xbm +0 -0
  123. data/tcl/BWidget-1.8.0/images/opmove.xbm +0 -0
  124. data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
  125. data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
  126. data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
  127. data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
  128. data/tcl/BWidget-1.8.0/images/plus.xbm +0 -0
  129. data/tcl/BWidget-1.8.0/images/print.gif +0 -0
  130. data/tcl/BWidget-1.8.0/images/question.gif +0 -0
  131. data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
  132. data/tcl/BWidget-1.8.0/images/save.gif +0 -0
  133. data/tcl/BWidget-1.8.0/images/target.xbm +0 -0
  134. data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
  135. data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
  136. data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
  137. data/tcl/BWidget-1.8.0/init.tcl +0 -0
  138. data/tcl/BWidget-1.8.0/label.tcl +0 -0
  139. data/tcl/BWidget-1.8.0/labelentry.tcl +0 -0
  140. data/tcl/BWidget-1.8.0/labelframe.tcl +0 -0
  141. data/tcl/BWidget-1.8.0/lang/da.rc +0 -0
  142. data/tcl/BWidget-1.8.0/lang/de.rc +0 -0
  143. data/tcl/BWidget-1.8.0/lang/en.rc +0 -0
  144. data/tcl/BWidget-1.8.0/lang/es.rc +0 -0
  145. data/tcl/BWidget-1.8.0/lang/fr.rc +0 -0
  146. data/tcl/BWidget-1.8.0/listbox.tcl +0 -0
  147. data/tcl/BWidget-1.8.0/mainframe.tcl +0 -0
  148. data/tcl/BWidget-1.8.0/messagedlg.tcl +0 -0
  149. data/tcl/BWidget-1.8.0/notebook.tcl +0 -0
  150. data/tcl/BWidget-1.8.0/pagesmgr.tcl +0 -0
  151. data/tcl/BWidget-1.8.0/panedw.tcl +0 -0
  152. data/tcl/BWidget-1.8.0/panelframe.tcl +0 -0
  153. data/tcl/BWidget-1.8.0/passwddlg.tcl +0 -0
  154. data/tcl/BWidget-1.8.0/pkgIndex.tcl +0 -0
  155. data/tcl/BWidget-1.8.0/progressbar.tcl +0 -0
  156. data/tcl/BWidget-1.8.0/progressdlg.tcl +0 -0
  157. data/tcl/BWidget-1.8.0/scrollframe.tcl +0 -0
  158. data/tcl/BWidget-1.8.0/scrollview.tcl +0 -0
  159. data/tcl/BWidget-1.8.0/scrollw.tcl +0 -0
  160. data/tcl/BWidget-1.8.0/separator.tcl +0 -0
  161. data/tcl/BWidget-1.8.0/spinbox.tcl +0 -0
  162. data/tcl/BWidget-1.8.0/statusbar.tcl +0 -0
  163. data/tcl/BWidget-1.8.0/tests/entry.test +0 -0
  164. data/tcl/BWidget-1.8.0/titleframe.tcl +0 -0
  165. data/tcl/BWidget-1.8.0/tree.tcl +0 -0
  166. data/tcl/BWidget-1.8.0/utils.tcl +0 -0
  167. data/tcl/BWidget-1.8.0/widget.tcl +0 -0
  168. data/tcl/BWidget-1.8.0/wizard.tcl +0 -0
  169. data/tcl/BWidget-1.8.0/xpm2image.tcl +0 -0
  170. metadata +2 -25
  171. data/ext/ae-complete-code/ae-complete-code.conf +0 -6
  172. data/ext/ae-complete-code/ae-complete-code.rb +0 -74
  173. data/ext/ae-doc-code/ae-doc-code.conf +0 -15
  174. data/ext/ae-doc-code/ae-doc-code.rb +0 -300
  175. data/ext/ae-event-log/ae-event-log.conf +0 -5
  176. data/ext/ae-event-log/ae-event-log.rb +0 -46
  177. data/ext/ae-flag/ae-flag.conf +0 -6
  178. data/ext/ae-flag/ae-flag.rb +0 -12
  179. data/ext/ae-output-event/ae-output-event.conf +0 -15
File without changes
File without changes
File without changes
File without changes
@@ -6,7 +6,7 @@ require=ext/ae-file-history/ae-file-history
6
6
  class=FilesHistrory
7
7
 
8
8
  file.name=arcadia.history
9
- length=34
9
+ length=35
10
10
  font=courier 11
11
11
  font.bold=courier 11 bold
12
12
  color.background=#ffffff
@@ -2,6 +2,11 @@
2
2
  # ae-file-history.rb - Arcadia Ruby ide
3
3
  # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
4
  #
5
+ # §require_dir_ref=../..
6
+ # §require_omissis=conf/arcadia.init
7
+ # §require_omissis=lib/a-commons
8
+ # §require_omissis=lib/a-tkcommons
9
+ # §require_omissis=lib/a-core
5
10
 
6
11
 
7
12
  class TreeNode
@@ -163,27 +168,28 @@ class FilesHistrory < ArcadiaExt
163
168
  @font_b = "#{Arcadia.conf('treeitem.font')} bold"
164
169
 
165
170
  @htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
166
- #relief 'flat'
167
171
  showlines false
168
172
  deltay 18
169
- #background _background
170
- #crossfill _foreground
171
- #dragenabled true
172
173
  selectcommand proc{ do_select_item.call(self) }
173
- place('relwidth' => 1,'relheight' => '1', 'x' => '0','y' => '22', 'height' => -22)
174
+ # place('relwidth' => 1,'relheight' => '1', 'x' => '0','y' => '22', 'height' => -22)
174
175
  }
175
- _scrollcommand = proc{|*args| @htree.yview(*args)}
176
- _scrollbar = TkScrollbar.new(self.frame.hinner_frame, Arcadia.style('scrollbar')){|s|
177
- width 8
178
- command _scrollcommand
179
- }.pack('side'=>'right', 'fill'=>'y')
180
- @htree.yscrollcommand proc{|first,last| _scrollbar.set(first,last)}
176
+ _wrapper = TkScrollWidget.new(@htree)
177
+ _wrapper.show(0,22)
178
+ _wrapper.show_v_scroll
179
+ _wrapper.show_h_scroll
180
+ # _scrollcommand = proc{|*args| @htree.yview(*args)}
181
+ # _scrollbar = TkScrollbar.new(self.frame.hinner_frame, Arcadia.style('scrollbar')){|s|
182
+ # width 8
183
+ # command _scrollcommand
184
+ # }.pack('side'=>'right', 'fill'=>'y')
185
+ # @htree.yscrollcommand proc{|first,last| _scrollbar.set(first,last)}
181
186
 
182
187
  self.build_tree
183
188
  end
184
189
 
185
190
  def on_after_build(_event)
186
191
  Arcadia.attach_listener(self, OpenBufferEvent)
192
+ self.frame.show
187
193
  #Arcadia.attach_listener(self, CloseBufferEvent)
188
194
  end
189
195
 
@@ -201,12 +207,12 @@ class FilesHistrory < ArcadiaExt
201
207
  end
202
208
  end
203
209
 
204
- def on_after_close_buffer(_event)
205
- if _event.file
206
- self.add2history(_event.file)
207
- add_to_tree(_event.file)
208
- end
209
- end
210
+ # def on_after_close_buffer(_event)
211
+ # if _event.file
212
+ # self.add2history(_event.file)
213
+ # add_to_tree(_event.file)
214
+ # end
215
+ # end
210
216
 
211
217
  def select_file_without_event(_file)
212
218
  _d, _f = File.split(File.expand_path(_file))
File without changes
@@ -1,200 +1,262 @@
1
- #
2
- # ae-output.rb - Arcadia Ruby ide
3
- # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
- #
5
-
6
- require "tk"
7
- #require "base/a-utils"
8
-
9
- class OutputView
10
- attr_reader :text
11
- def initialize(parent=nil)
12
-
13
- left_frame = TkFrame.new(parent.frame.hinner_frame, Arcadia.style('panel')).place('x' => '0','y' => '0','relheight' => '1','width' => '25')
14
-
15
- @button_u = Tk::BWidget::Button.new(left_frame, Arcadia.style('toolbarbutton')){
16
- image TkPhotoImage.new('dat' => CLEAR_GIF)
17
- helptext 'Clear'
18
- #foreground 'blue'
19
- command proc{parent.main_frame.text.delete('1.0','end')}
20
- #relief 'groove'
21
- pack('side' =>'top', 'anchor'=>'n',:padx=>0, :pady=>0)
22
- }
23
-
24
-
25
- #@splitted_frame = AGTkVSplittedFrames.new(parent.frame,20)
26
- @text = TkText.new(parent.frame.hinner_frame,
27
- {'wrap'=> 'none'}.update(Arcadia.style('edit'))
28
- ){|j|
29
- TkScrollbar.new(j, Arcadia.style('scrollbar')){|s|
30
- command proc{|*args| j.yview(*args)}
31
- j.yscrollcommand proc{|first,last| s.set first,last}
32
- }.pack('side'=>'right', 'fill'=>'y')
33
- }.place('relwidth' => '1','x' => '25','y' => '0','relheight' => '1', 'width' => '-25')
34
- @text.tag_configure('simple_msg',
35
- 'background' => '#d9d994',
36
- 'borderwidth'=>1,
37
- 'relief'=> 'flat'
38
- )
39
- @text.tag_configure('debug_msg',
40
- 'background' => '#f6c9f6',
41
- 'foreground' => '#000000',
42
- 'borderwidth'=>1,
43
- 'relief'=> 'flat'
44
- )
45
- @text.tag_configure('error_msg',
46
- 'background' => '#f6c9f6',
47
- 'foreground' => 'red',
48
- 'borderwidth'=>1,
49
- 'relief'=> 'flat'
50
- )
51
-
52
- @text.tag_configure('bord_msg',
53
- #'foreground' => '#b9b8b9'
54
- 'foreground' => '#7c9b10'
55
- )
56
- @text.tag_configure('sel',
57
- 'background'=>parent.conf('hightlight.sel.color.background'),
58
- 'foreground'=>parent.conf('hightlight.sel.color.foreground'))
59
-
60
- end
61
- end
62
-
63
- class Output < ArcadiaExt
64
- attr_reader :main_frame
65
-
66
- def on_before_build(_event)
67
- #ArcadiaContractListener.new(self, MsgContract, :do_msg_event)
68
- Arcadia.attach_listener(self, MsgEvent)
69
- #_frame = @arcadia.layout.register_panel('_rome_',@name, 'Output')
70
- @main_frame = OutputView.new(self)
71
- @run_threads = Array.new
72
- end
73
-
74
-
75
- def on_after_build(_event)
76
- self.frame.show
77
- # MainContract.instance.raise_extension(self,
78
- # 'domain'=>@arcadia['conf'][@name+'.frame'],
79
- # 'extension' =>@name,
80
- # 'channel'=>conf('MsgContract.channel'))
81
- end
82
-
83
- def format_time(_time)
84
- _time.strftime("at %a %d-%b-%Y %H:%M:%S")
85
- end
86
-
87
- def on_msg(_event)
88
- self.frame.show
89
- _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.msg.strip+"\n"
90
- _index_begin = @main_frame.text.index('end')
91
- @main_frame.text.insert(_index_begin,_txt)
92
- _index_end = @main_frame.text.index('end')
93
- case _event.level
94
- when 'debug'
95
- @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
96
- @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
97
- @main_frame.text.tag_add('debug_msg',_index_begin, _index_end+ ' lineend')
98
- parse_debug(_index_begin.split('.')[0].to_i)
99
- when 'error'
100
- @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
101
- @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
102
- @main_frame.text.tag_add('error_msg',_index_begin, _index_end+ ' lineend')
103
- parse_debug(_index_begin.split('.')[0].to_i)
104
- else
105
- @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
106
- @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
107
- @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
108
- end
109
- @main_frame.text.tag_add('bord_msg',_index_begin+' linestart', _index_begin+ ' lineend')
110
- @main_frame.text.tag_add('bord_msg',_index_end+' -1 lines linestart', _index_end+ ' -1 lines lineend')
111
- @main_frame.text.see(_index_end)
112
- end
113
-
114
- # def do_msg_event(_event)
115
- # self.frame_raise
116
- # #p _event.context.text.class
117
- # _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.context.text.strip+"\n"
118
- # _index_begin = @main_frame.text.index('end')
119
- # @main_frame.text.insert(_index_begin,_txt)
120
- # _index_end = @main_frame.text.index('end')
121
- # if _event.context.type == MsgContract::TYPE_DEBUG
122
- # @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
123
- # @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
124
- # @main_frame.text.tag_add('debug_msg',_index_begin, _index_end+ ' lineend')
125
- # parse_debug(_index_begin.split('.')[0].to_i)
126
- # elsif _event.context.type == MsgContract::TYPE_ERROR
127
- # @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
128
- # @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
129
- # @main_frame.text.tag_add('error_msg',_index_begin, _index_end+ ' lineend')
130
- # parse_debug(_index_begin.split('.')[0].to_i)
131
- # else
132
- # @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
133
- # @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
134
- # @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
135
- # end
136
- # @main_frame.text.tag_add('bord_msg',_index_begin+' linestart', _index_begin+ ' lineend')
137
- # @main_frame.text.tag_add('bord_msg',_index_end+' -1 lines linestart', _index_end+ ' -1 lines lineend')
138
- # @main_frame.text.see(_index_end)
139
- # end
140
-
141
- def parse_debug(_from_row=0)
142
- _row = 0
143
- _cursor = @main_frame.text.cget('cursor')
144
- @main_frame.text.value.each{|l|
145
- _row = _row+1
146
- if _row >= _from_row
147
- _end = 0
148
- m = /([\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*\.rb):(\d*)/.match(l)
149
- while m
150
- _txt = m.post_match
151
- if m[1] && m[2]
152
- _file = m[1]
153
- _line = m[2]
154
- _ibegin = _row.to_s+'.'+(m.begin(1)+_end).to_s
155
- _iend = _row.to_s+'.'+(m.end(2)+_end).to_s
156
- _end = m.end(2) + _end
157
- @main_frame.text.tag_configure(_row,
158
- 'foreground' => '#800000',
159
- 'borderwidth'=>0,
160
- 'relief'=>'flat',
161
- 'underline'=>true
162
- )
163
- @main_frame.text.tag_add(_row,_ibegin,_iend)
164
- @main_frame.text.tag_bind(_row,"Double-ButtonPress-1",
165
- proc{
166
- Arcadia.process_event(OpenBufferEvent.new(self,'file'=>_file, 'row'=>_line))
167
- #EditorContract.instance.open_file(self, 'file'=>_file, 'line'=>_line)
168
- }
169
- )
170
- @main_frame.text.tag_bind(_row,"Enter",
171
- proc{@main_frame.text.configure('cursor'=> 'hand2')}
172
- )
173
- @main_frame.text.tag_bind(_row,"Leave",
174
- proc{@main_frame.text.configure('cursor'=> _cursor)}
175
- )
176
-
177
-
178
-
179
- end
180
- m = /([A-Za-z]*[\.:]{0,1}[\/\w\d]*\.rb):(\d*)/.match(_txt)
181
- end
182
- end
183
- }
184
- end
185
-
186
- def out(_txt=nil, _tag=nil)
187
- if @main_frame && _txt
188
- if _tag
189
- @main_frame.text.insert('end',_txt, _tag)
190
- else
191
- @main_frame.text.insert('end',_txt)
192
- end
193
- end
194
- end
195
-
196
- def outln(_txt=nil, _tag=nil)
197
- self.out(_txt+"\n",_tag)
198
- end
199
-
200
- end
1
+ #
2
+ # ae-output.rb - Arcadia Ruby ide
3
+ # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
+ #
5
+ # §require_dir_ref=../..
6
+ # §require_omissis=conf/arcadia.init
7
+ # §require_omissis=lib/a-commons
8
+
9
+ require "tk"
10
+ #require "base/a-utils"
11
+
12
+ class OutputView
13
+ attr_reader :text
14
+ def initialize(parent=nil)
15
+ left_frame = TkFrame.new(parent.frame.hinner_frame, Arcadia.style('panel')).place('x' => '0','y' => '0','relheight' => '1','width' => '25')
16
+ right_frame = TkFrame.new(parent.frame.hinner_frame, Arcadia.style('panel')).place('x' => '25','y' => '0','relheight' => '1','relwidth' => '1','width' => '-25')
17
+
18
+ @button_u = Tk::BWidget::Button.new(left_frame, Arcadia.style('toolbarbutton')){
19
+ image TkPhotoImage.new('dat' => CLEAR_GIF)
20
+ helptext 'Clear'
21
+ #foreground 'blue'
22
+ command proc{parent.main_frame.text.delete('1.0','end')}
23
+ #relief 'groove'
24
+ pack('side' =>'top', 'anchor'=>'n',:padx=>0, :pady=>0)
25
+ }
26
+
27
+ @text = TkScrollText.new(right_frame,
28
+ {'wrap'=> 'none'}.update(Arcadia.style('edit'))
29
+ )
30
+ @text.show
31
+ @text.show_v_scroll
32
+ @text.show_h_scroll
33
+
34
+ @text.tag_configure('simple_msg',
35
+ # 'background' => '#d9d994',
36
+ 'borderwidth'=>1,
37
+ 'relief'=> 'flat'
38
+ )
39
+ @text.tag_configure('debug_msg',
40
+ # 'background' => '#f6c9f6',
41
+ # 'foreground' => '#000000',
42
+ 'borderwidth'=>1,
43
+ 'relief'=> 'flat'
44
+ )
45
+ @text.tag_configure('error_msg',
46
+ # 'background' => '#f6c9f6',
47
+ 'foreground' => 'red',
48
+ 'borderwidth'=>1,
49
+ 'relief'=> 'flat'
50
+ )
51
+
52
+ @text.tag_configure('bord_msg',
53
+ #'foreground' => '#b9b8b9'
54
+ 'foreground' => '#7c9b10'
55
+ )
56
+ @text.tag_configure('sel',
57
+ 'background'=>parent.conf('hightlight.sel.color.background'),
58
+ 'foreground'=>parent.conf('hightlight.sel.color.foreground')
59
+ )
60
+ pop_up_menu
61
+ end
62
+
63
+ def pop_up_menu
64
+ @pop_up = TkMenu.new(
65
+ :parent=>@text,
66
+ :tearoff=>0,
67
+ :title => 'Menu'
68
+ )
69
+ @pop_up.configure(Arcadia.style('menu'))
70
+
71
+ @pop_up.insert('end',
72
+ :command,
73
+ :state=>'disabled',
74
+ :label=>'Output',
75
+ :background=>Arcadia.conf('titlelabel.background'),
76
+ :font => "#{Arcadia.conf('menu.font')} bold",
77
+ :hidemargin => true
78
+ )
79
+
80
+
81
+ #Arcadia.instance.main_menu.update_style(@pop_up)
82
+ @pop_up.insert('end',
83
+ :command,
84
+ :label=>'Save',
85
+ :hidemargin => false,
86
+ :command=> proc{save_as}
87
+ )
88
+
89
+
90
+
91
+ @pop_up.insert('end',
92
+ :command,
93
+ :label=>'Set wrap',
94
+ :hidemargin => false,
95
+ :command=> proc{@text.configure('wrap'=>'word');@text.hide_h_scroll}
96
+ )
97
+
98
+ @pop_up.insert('end',
99
+ :command,
100
+ :label=>'Set no wrap',
101
+ :hidemargin => false,
102
+ :command=> proc{@text.configure('wrap'=>'none');@text.show_h_scroll}
103
+ )
104
+
105
+
106
+
107
+
108
+ @text.bind("Button-3",
109
+ proc{|x,y|
110
+ _x = TkWinfo.pointerx(@text)
111
+ _y = TkWinfo.pointery(@text)
112
+ @pop_up.popup(_x,_y)
113
+ },
114
+ "%x %y")
115
+ end
116
+
117
+ def save
118
+ if !@file
119
+ save_as
120
+ else
121
+ f = File.new(@file, "w")
122
+ begin
123
+ if f
124
+ f.syswrite(@text.value)
125
+ end
126
+ ensure
127
+ f.close unless f.nil?
128
+ end
129
+ #EditorContract.instance.file_saved(self,'file' =>@file)
130
+ end
131
+ end
132
+
133
+ def save_as
134
+ @file = Tk.getSaveFile("filetypes"=>[["Ruby Files", [".rb", ".rbw"]],["All Files", [".*"]]])
135
+ @file = nil if @file == "" # cancelled
136
+ if @file
137
+ save
138
+ end
139
+ end
140
+
141
+
142
+ end
143
+
144
+ class Output < ArcadiaExt
145
+ attr_reader :main_frame
146
+
147
+ def on_before_build(_event)
148
+ #ArcadiaContractListener.new(self, MsgContract, :do_msg_event)
149
+ Arcadia.attach_listener(self, MsgEvent)
150
+ #_frame = @arcadia.layout.register_panel('_rome_',@name, 'Output')
151
+ @main_frame = OutputView.new(self)
152
+ @run_threads = Array.new
153
+ end
154
+
155
+
156
+ def on_after_build(_event)
157
+ self.frame.show
158
+ end
159
+
160
+ def format_time(_time)
161
+ _time.strftime("at %a %d-%b-%Y %H:%M:%S")
162
+ end
163
+
164
+ def on_msg(_event)
165
+ self.frame.show
166
+ _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.msg.strip+"\n"
167
+ _index_begin = @main_frame.text.index('end')
168
+ @main_frame.text.insert(_index_begin,_txt)
169
+ _index_end = @main_frame.text.index('end')
170
+ case _event.level
171
+ when 'debug'
172
+ @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
173
+ @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
174
+ @main_frame.text.tag_add('debug_msg',_index_begin, _index_end+ ' lineend')
175
+ parse_debug(_index_begin.split('.')[0].to_i)
176
+ when 'error'
177
+ @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
178
+ @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
179
+ @main_frame.text.tag_add('error_msg',_index_begin, _index_end+ ' lineend')
180
+ parse_debug(_index_begin.split('.')[0].to_i)
181
+ else
182
+ @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
183
+ @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
184
+ @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
185
+ end
186
+ @main_frame.text.tag_add('bord_msg',_index_begin+' linestart', _index_begin+ ' lineend')
187
+ @main_frame.text.tag_add('bord_msg',_index_end+' -1 lines linestart', _index_end+ ' -1 lines lineend')
188
+ @main_frame.text.see(_index_end)
189
+ end
190
+
191
+ def parse_debug(_from_row=0)
192
+ _row = 0
193
+ @cursor = @main_frame.text.cget('cursor')
194
+ @j=0
195
+ file_tag=Hash.new
196
+ @main_frame.text.value.each{|l|
197
+ _row = _row+1
198
+ if _row >= _from_row
199
+ _end = 0
200
+ #m = /([\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*\.rb):(\d*)/.match(l)
201
+ re = Regexp.new('([\w\:]*[\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*):(\d*)')
202
+ m = re.match(l)
203
+ #m = /([\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*):(\d*)/.match(l)
204
+ while m
205
+ _txt = m.post_match
206
+ if m[1] && m[2]
207
+ _file = m[1]
208
+ if File.exist?(_file)
209
+ @j=@j+1
210
+ _line = m[2]
211
+ _ibegin = _row.to_s+'.'+(m.begin(1)+_end).to_s
212
+ _iend = _row.to_s+'.'+(m.end(2)+_end).to_s
213
+ file_binding(_file, _line, _ibegin, _iend)
214
+ end
215
+ _end = m.end(2) + _end
216
+
217
+
218
+ end
219
+ m = re.match(_txt)
220
+ end
221
+ end
222
+ }
223
+ end
224
+
225
+ def file_binding(_file, _line, _ibegin, _iend)
226
+ tag_name = "tag_#{@j}"
227
+ @main_frame.text.tag_configure(tag_name,
228
+ 'foreground' => '#800000',
229
+ 'borderwidth'=>0,
230
+ 'relief'=>'flat',
231
+ 'underline'=>true
232
+ )
233
+ @main_frame.text.tag_add(tag_name,_ibegin,_iend)
234
+ @main_frame.text.tag_bind(tag_name,"Double-ButtonPress-1",
235
+ proc{
236
+ Arcadia.process_event(OpenBufferEvent.new(self,'file'=>_file, 'row'=>_line))
237
+ }
238
+ )
239
+ @main_frame.text.tag_bind(tag_name,"Enter",
240
+ proc{@main_frame.text.configure('cursor'=> 'hand2')}
241
+ )
242
+ @main_frame.text.tag_bind(tag_name,"Leave",
243
+ proc{@main_frame.text.configure('cursor'=> @cursor)}
244
+ )
245
+
246
+ end
247
+
248
+ def out(_txt=nil, _tag=nil)
249
+ if @main_frame && _txt
250
+ if _tag
251
+ @main_frame.text.insert('end',_txt, _tag)
252
+ else
253
+ @main_frame.text.insert('end',_txt)
254
+ end
255
+ end
256
+ end
257
+
258
+ def outln(_txt=nil, _tag=nil)
259
+ self.out(_txt+"\n",_tag)
260
+ end
261
+
262
+ end