arcadia 0.1.1 → 0.1.2

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 (167) hide show
  1. data/README +126 -123
  2. data/arcadia.rb +770 -756
  3. data/base/a-contracts.rb +130 -93
  4. data/base/a-ext.rb +280 -280
  5. data/base/a-libs.rb +5 -11
  6. data/base/a-utils.rb +235 -44
  7. data/conf/arcadia.conf +20 -16
  8. data/conf/arcadia.init.rb +0 -0
  9. data/conf/arcadia.res.rb +74 -0
  10. data/ext/ae-complete-code/ae-complete-code.conf +0 -0
  11. data/ext/ae-complete-code/ae-complete-code.rb +80 -79
  12. data/ext/ae-debug/ae-debug.conf +0 -0
  13. data/ext/ae-debug/ae-debug.rb +2 -6
  14. data/ext/ae-debug/debug1.57.rb +0 -0
  15. data/ext/ae-doc-code/ae-doc-code.conf +15 -0
  16. data/ext/ae-doc-code/ae-doc-code.rb +289 -0
  17. data/ext/ae-editor/ae-editor.conf +17 -8
  18. data/ext/ae-editor/ae-editor.rb +738 -396
  19. data/ext/ae-event-log/ae-event-log.conf +0 -0
  20. data/ext/ae-event-log/ae-event-log.rb +0 -0
  21. data/ext/ae-file-history/ae-file-history.conf +2 -2
  22. data/ext/ae-file-history/ae-file-history.rb +286 -290
  23. data/ext/ae-inspector/ae-inspector.conf +0 -0
  24. data/ext/ae-inspector/ae-inspector.rb +0 -0
  25. data/ext/ae-output-event/ae-output-event.conf +2 -2
  26. data/ext/ae-output/ae-output.conf +2 -2
  27. data/ext/ae-output/ae-output.rb +173 -178
  28. data/ext/ae-palette/ae-palette.conf +0 -0
  29. data/ext/ae-palette/ae-palette.rb +0 -0
  30. data/ext/ae-shell/ae-shell.conf +0 -0
  31. data/ext/ae-shell/ae-shell.rb +54 -54
  32. data/lib/tk/al-tk.rb +3076 -3082
  33. data/lib/tk/al-tk.res.rb +0 -0
  34. data/lib/tk/al-tkarcadia.rb +0 -0
  35. data/lib/tk/al-tkcustom.rb +0 -0
  36. data/lib/tkext/al-bwidget.rb +0 -0
  37. data/lib/tkext/al-iwidgets.rb +0 -0
  38. data/lib/tkext/al-tile.rb +0 -0
  39. data/lib/tkext/al-tktable.rb +0 -0
  40. data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +276 -0
  41. data/tcl/BWidget-1.8.0/BWman/BWidget.html +228 -0
  42. data/tcl/BWidget-1.8.0/BWman/Button.html +273 -0
  43. data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +264 -0
  44. data/tcl/BWidget-1.8.0/BWman/ComboBox.html +402 -0
  45. data/tcl/BWidget-1.8.0/BWman/Dialog.html +314 -0
  46. data/tcl/BWidget-1.8.0/BWman/DragSite.html +139 -0
  47. data/tcl/BWidget-1.8.0/BWman/DropSite.html +254 -0
  48. data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +248 -0
  49. data/tcl/BWidget-1.8.0/BWman/Entry.html +341 -0
  50. data/tcl/BWidget-1.8.0/BWman/Label.html +331 -0
  51. data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +194 -0
  52. data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +144 -0
  53. data/tcl/BWidget-1.8.0/BWman/ListBox.html +678 -0
  54. data/tcl/BWidget-1.8.0/BWman/MainFrame.html +283 -0
  55. data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +218 -0
  56. data/tcl/BWidget-1.8.0/BWman/NoteBook.html +374 -0
  57. data/tcl/BWidget-1.8.0/BWman/PagesManager.html +180 -0
  58. data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +142 -0
  59. data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +153 -0
  60. data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +214 -0
  61. data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +152 -0
  62. data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +145 -0
  63. data/tcl/BWidget-1.8.0/BWman/ScrollView.html +130 -0
  64. data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +191 -0
  65. data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +116 -0
  66. data/tcl/BWidget-1.8.0/BWman/SelectColor.html +164 -0
  67. data/tcl/BWidget-1.8.0/BWman/SelectFont.html +152 -0
  68. data/tcl/BWidget-1.8.0/BWman/Separator.html +77 -0
  69. data/tcl/BWidget-1.8.0/BWman/SpinBox.html +250 -0
  70. data/tcl/BWidget-1.8.0/BWman/StatusBar.html +147 -0
  71. data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +107 -0
  72. data/tcl/BWidget-1.8.0/BWman/Tree.html +947 -0
  73. data/tcl/BWidget-1.8.0/BWman/Widget.html +502 -0
  74. data/tcl/BWidget-1.8.0/BWman/contents.html +84 -0
  75. data/tcl/BWidget-1.8.0/BWman/index.html +7 -0
  76. data/tcl/BWidget-1.8.0/BWman/navtree.html +41 -0
  77. data/tcl/BWidget-1.8.0/BWman/options.htm +458 -0
  78. data/tcl/BWidget-1.8.0/CHANGES.txt +266 -0
  79. data/tcl/BWidget-1.8.0/ChangeLog +1641 -0
  80. data/tcl/BWidget-1.8.0/LICENSE.txt +41 -0
  81. data/tcl/BWidget-1.8.0/README.txt +127 -0
  82. data/tcl/BWidget-1.8.0/arrow.tcl +551 -0
  83. data/tcl/BWidget-1.8.0/bitmap.tcl +94 -0
  84. data/tcl/BWidget-1.8.0/button.tcl +324 -0
  85. data/tcl/BWidget-1.8.0/buttonbox.tcl +403 -0
  86. data/tcl/BWidget-1.8.0/color.tcl +493 -0
  87. data/tcl/BWidget-1.8.0/combobox.tcl +809 -0
  88. data/tcl/BWidget-1.8.0/demo/basic.tcl +199 -0
  89. data/tcl/BWidget-1.8.0/demo/bwidget.xbm +46 -0
  90. data/tcl/BWidget-1.8.0/demo/demo.tcl +212 -0
  91. data/tcl/BWidget-1.8.0/demo/dnd.tcl +42 -0
  92. data/tcl/BWidget-1.8.0/demo/manager.tcl +141 -0
  93. data/tcl/BWidget-1.8.0/demo/select.tcl +59 -0
  94. data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +214 -0
  95. data/tcl/BWidget-1.8.0/demo/tree.tcl +260 -0
  96. data/tcl/BWidget-1.8.0/demo/x1.xbm +2258 -0
  97. data/tcl/BWidget-1.8.0/dialog.tcl +345 -0
  98. data/tcl/BWidget-1.8.0/dragsite.tcl +197 -0
  99. data/tcl/BWidget-1.8.0/dropsite.tcl +455 -0
  100. data/tcl/BWidget-1.8.0/dynhelp.tcl +625 -0
  101. data/tcl/BWidget-1.8.0/entry.tcl +469 -0
  102. data/tcl/BWidget-1.8.0/font.tcl +566 -0
  103. data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
  104. data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
  105. data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
  106. data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
  107. data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
  108. data/tcl/BWidget-1.8.0/images/error.gif +0 -0
  109. data/tcl/BWidget-1.8.0/images/file.gif +0 -0
  110. data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
  111. data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
  112. data/tcl/BWidget-1.8.0/images/info.gif +0 -0
  113. data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
  114. data/tcl/BWidget-1.8.0/images/minus.xbm +5 -0
  115. data/tcl/BWidget-1.8.0/images/new.gif +0 -0
  116. data/tcl/BWidget-1.8.0/images/opcopy.xbm +5 -0
  117. data/tcl/BWidget-1.8.0/images/open.gif +0 -0
  118. data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
  119. data/tcl/BWidget-1.8.0/images/oplink.xbm +5 -0
  120. data/tcl/BWidget-1.8.0/images/opmove.xbm +5 -0
  121. data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
  122. data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
  123. data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
  124. data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
  125. data/tcl/BWidget-1.8.0/images/plus.xbm +5 -0
  126. data/tcl/BWidget-1.8.0/images/print.gif +0 -0
  127. data/tcl/BWidget-1.8.0/images/question.gif +0 -0
  128. data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
  129. data/tcl/BWidget-1.8.0/images/save.gif +0 -0
  130. data/tcl/BWidget-1.8.0/images/target.xbm +9 -0
  131. data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
  132. data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
  133. data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
  134. data/tcl/BWidget-1.8.0/init.tcl +40 -0
  135. data/tcl/BWidget-1.8.0/label.tcl +271 -0
  136. data/tcl/BWidget-1.8.0/labelentry.tcl +100 -0
  137. data/tcl/BWidget-1.8.0/labelframe.tcl +160 -0
  138. data/tcl/BWidget-1.8.0/lang/da.rc +52 -0
  139. data/tcl/BWidget-1.8.0/lang/de.rc +52 -0
  140. data/tcl/BWidget-1.8.0/lang/en.rc +52 -0
  141. data/tcl/BWidget-1.8.0/lang/es.rc +53 -0
  142. data/tcl/BWidget-1.8.0/lang/fr.rc +52 -0
  143. data/tcl/BWidget-1.8.0/listbox.tcl +1638 -0
  144. data/tcl/BWidget-1.8.0/mainframe.tcl +711 -0
  145. data/tcl/BWidget-1.8.0/messagedlg.tcl +128 -0
  146. data/tcl/BWidget-1.8.0/notebook.tcl +1164 -0
  147. data/tcl/BWidget-1.8.0/pagesmgr.tcl +294 -0
  148. data/tcl/BWidget-1.8.0/panedw.tcl +381 -0
  149. data/tcl/BWidget-1.8.0/panelframe.tcl +246 -0
  150. data/tcl/BWidget-1.8.0/passwddlg.tcl +178 -0
  151. data/tcl/BWidget-1.8.0/pkgIndex.tcl +47 -0
  152. data/tcl/BWidget-1.8.0/progressbar.tcl +208 -0
  153. data/tcl/BWidget-1.8.0/progressdlg.tcl +87 -0
  154. data/tcl/BWidget-1.8.0/scrollframe.tcl +226 -0
  155. data/tcl/BWidget-1.8.0/scrollview.tcl +254 -0
  156. data/tcl/BWidget-1.8.0/scrollw.tcl +280 -0
  157. data/tcl/BWidget-1.8.0/separator.tcl +75 -0
  158. data/tcl/BWidget-1.8.0/spinbox.tcl +331 -0
  159. data/tcl/BWidget-1.8.0/statusbar.tcl +422 -0
  160. data/tcl/BWidget-1.8.0/tests/entry.test +173 -0
  161. data/tcl/BWidget-1.8.0/titleframe.tcl +170 -0
  162. data/tcl/BWidget-1.8.0/tree.tcl +2228 -0
  163. data/tcl/BWidget-1.8.0/utils.tcl +645 -0
  164. data/tcl/BWidget-1.8.0/widget.tcl +1576 -0
  165. data/tcl/BWidget-1.8.0/wizard.tcl +1028 -0
  166. data/tcl/BWidget-1.8.0/xpm2image.tcl +115 -0
  167. metadata +141 -5
File without changes
File without changes
@@ -7,8 +7,8 @@ class=Output
7
7
  MsgContract.channel=CH1
8
8
 
9
9
 
10
- font=courier 7
11
- font.bold=courier 9 bold
10
+ font=courier 10
11
+ font.bold=courier 10 bold
12
12
  i386-freebsd6::font=courier 10
13
13
  i386-freebsd6::font.bold=courier 12 bold
14
14
  i386-mswin32::font={Courier New} 9
@@ -6,8 +6,8 @@ require=ext/ae-output/ae-output
6
6
  class=Output
7
7
  MsgContract.channel=0
8
8
 
9
- font=courier 7
10
- font.bold=courier 9 bold
9
+ font=courier 10
10
+ font.bold=courier 10 bold
11
11
  i386-freebsd6::font=courier 12
12
12
  i386-freebsd6::font.bold=courier 12 bold
13
13
  i386-mswin32::font={Courier New} 9
@@ -1,178 +1,173 @@
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).place('x' => '0','y' => '0','relheight' => '1','width' => '25')
14
-
15
- @button_u = Tk::BWidget::Button.new(left_frame){
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,
27
- 'wrap'=> 'none',
28
- 'relief' => 'sunken',
29
- 'font' => parent.conf('font')
30
- ){|j|
31
- TkScrollbar.new(j){|s|
32
- command proc{|*args| j.yview(*args)}
33
- j.yscrollcommand proc{|first,last| s.set first,last}
34
- }.pack('side'=>'right', 'fill'=>'y')
35
- }.place('relwidth' => '1','x' => '25','y' => '0','relheight' => '1', 'width' => '-25')
36
- @text.tag_configure('simple_msg',
37
- 'background' => '#d9d994',
38
- 'borderwidth'=>1,
39
- 'relief'=> 'flat'
40
- )
41
- @text.tag_configure('debug_msg',
42
- 'background' => '#f6c9f6',
43
- 'foreground' => '#000000',
44
- 'borderwidth'=>1,
45
- 'relief'=> 'flat'
46
- )
47
- @text.tag_configure('error_msg',
48
- 'background' => '#f6c9f6',
49
- 'foreground' => 'red',
50
- 'borderwidth'=>1,
51
- 'relief'=> 'flat'
52
- )
53
-
54
- @text.tag_configure('bord_msg',
55
- #'foreground' => '#b9b8b9'
56
- 'foreground' => '#7c9b10'
57
- )
58
-
59
- end
60
- end
61
-
62
- class Output < ArcadiaExt
63
- attr_reader :main_frame
64
-
65
- def before_build
66
- ArcadiaContractListener.new(self, MsgContract, :do_msg_event)
67
- #_frame = @arcadia.layout.register_panel('_rome_',@name, 'Output')
68
- @main_frame = OutputView.new(self)
69
- @run_threads = Array.new
70
- @main_frame.text.tag_configure('error','foreground' => 'red')
71
- end
72
-
73
-
74
- def build
75
- #@ae_file_contract = @arcadia.retrieve_contract(self, EditorActionContract, :file_state)
76
- end
77
-
78
- def after_build
79
- MainContract.instance.raise_extension(MainContract::TMainObj.new(self,
80
- 'domain'=>@arcadia['conf'][@name+'.frame'],
81
- 'extension' =>@name,
82
- 'channel'=>conf('MsgContract.channel')
83
-
84
- ))
85
- end
86
-
87
- def format_time(_time)
88
- _time.strftime("at %a %d-%b-%Y %H:%M:%S")
89
- end
90
-
91
- def do_msg_event(_event)
92
- #p _event.context.text.class
93
- _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.context.text.strip+"\n"
94
- _index_begin = @main_frame.text.index('end')
95
- @main_frame.text.insert(_index_begin,_txt)
96
- _index_end = @main_frame.text.index('end')
97
- if _event.context.type == MsgContract::TYPE_DEBUG
98
- @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
99
- @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
100
- @main_frame.text.tag_add('debug_msg',_index_begin, _index_end+ ' lineend')
101
- parse_debug(_index_begin.split('.')[0].to_i)
102
- elsif _event.context.type == MsgContract::TYPE_ERROR
103
- @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
104
- @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
105
- @main_frame.text.tag_add('error_msg',_index_begin, _index_end+ ' lineend')
106
- parse_debug(_index_begin.split('.')[0].to_i)
107
- else
108
- @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
109
- @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
110
- @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
111
- end
112
- @main_frame.text.tag_add('bord_msg',_index_begin+' linestart', _index_begin+ ' lineend')
113
- @main_frame.text.tag_add('bord_msg',_index_end+' -1 lines linestart', _index_end+ ' -1 lines lineend')
114
- @main_frame.text.see(_index_end)
115
- end
116
-
117
- def parse_debug(_from_row=0)
118
- _row = 0
119
- _cursor = @main_frame.text.cget('cursor')
120
- @main_frame.text.value.each{|l|
121
- _row = _row+1
122
- if _row >= _from_row
123
- _end = 0
124
- m = /([\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*\.rb):(\d*)/.match(l)
125
- while m
126
- _txt = m.post_match
127
- if m[1] && m[2]
128
- _file = m[1]
129
- _line = m[2]
130
- _ibegin = _row.to_s+'.'+(m.begin(1)+_end).to_s
131
- _iend = _row.to_s+'.'+(m.end(2)+_end).to_s
132
- _end = m.end(2) + _end
133
- @main_frame.text.tag_configure(_row,
134
- 'foreground' => '#800000',
135
- 'borderwidth'=>0,
136
- 'relief'=>'flat',
137
- 'underline'=>true
138
- )
139
- @main_frame.text.tag_add(_row,_ibegin,_iend)
140
- @main_frame.text.tag_bind(_row,"Double-ButtonPress-1",
141
- proc{
142
- _tobj = EditorContract::TEditorObj.new(self)
143
- _tobj.file= _file
144
- _tobj.line= _line
145
- EditorContract.instance.open_file(_tobj)
146
- }
147
- )
148
- @main_frame.text.tag_bind(_row,"Enter",
149
- proc{@main_frame.text.configure('cursor'=> 'hand2')}
150
- )
151
- @main_frame.text.tag_bind(_row,"Leave",
152
- proc{@main_frame.text.configure('cursor'=> _cursor)}
153
- )
154
-
155
-
156
-
157
- end
158
- m = /([A-Za-z]*[\.:]{0,1}[\/\w\d]*\.rb):(\d*)/.match(_txt)
159
- end
160
- end
161
- }
162
- end
163
-
164
- def out(_txt=nil, _tag=nil)
165
- if @main_frame && _txt
166
- if _tag
167
- @main_frame.text.insert('end',_txt, _tag)
168
- else
169
- @main_frame.text.insert('end',_txt)
170
- end
171
- end
172
- end
173
-
174
- def outln(_txt=nil, _tag=nil)
175
- self.out(_txt+"\n",_tag)
176
- end
177
-
178
- end
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).place('x' => '0','y' => '0','relheight' => '1','width' => '25')
14
+
15
+ @button_u = Tk::BWidget::Button.new(left_frame){
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,
27
+ 'wrap'=> 'none',
28
+ 'relief' => 'sunken',
29
+ 'font' => parent.conf('font')
30
+ ){|j|
31
+ TkScrollbar.new(j){|s|
32
+ command proc{|*args| j.yview(*args)}
33
+ j.yscrollcommand proc{|first,last| s.set first,last}
34
+ }.pack('side'=>'right', 'fill'=>'y')
35
+ }.place('relwidth' => '1','x' => '25','y' => '0','relheight' => '1', 'width' => '-25')
36
+ @text.tag_configure('simple_msg',
37
+ 'background' => '#d9d994',
38
+ 'borderwidth'=>1,
39
+ 'relief'=> 'flat'
40
+ )
41
+ @text.tag_configure('debug_msg',
42
+ 'background' => '#f6c9f6',
43
+ 'foreground' => '#000000',
44
+ 'borderwidth'=>1,
45
+ 'relief'=> 'flat'
46
+ )
47
+ @text.tag_configure('error_msg',
48
+ 'background' => '#f6c9f6',
49
+ 'foreground' => 'red',
50
+ 'borderwidth'=>1,
51
+ 'relief'=> 'flat'
52
+ )
53
+
54
+ @text.tag_configure('bord_msg',
55
+ #'foreground' => '#b9b8b9'
56
+ 'foreground' => '#7c9b10'
57
+ )
58
+
59
+ end
60
+ end
61
+
62
+ class Output < ArcadiaExt
63
+ attr_reader :main_frame
64
+
65
+ def before_build
66
+ ArcadiaContractListener.new(self, MsgContract, :do_msg_event)
67
+ #_frame = @arcadia.layout.register_panel('_rome_',@name, 'Output')
68
+ @main_frame = OutputView.new(self)
69
+ @run_threads = Array.new
70
+ @main_frame.text.tag_configure('error','foreground' => 'red')
71
+ end
72
+
73
+
74
+ def build
75
+ #@ae_file_contract = @arcadia.retrieve_contract(self, EditorActionContract, :file_state)
76
+ end
77
+
78
+ def after_build
79
+ MainContract.instance.raise_extension(self,
80
+ 'domain'=>@arcadia['conf'][@name+'.frame'],
81
+ 'extension' =>@name,
82
+ 'channel'=>conf('MsgContract.channel'))
83
+ end
84
+
85
+ def format_time(_time)
86
+ _time.strftime("at %a %d-%b-%Y %H:%M:%S")
87
+ end
88
+
89
+ def do_msg_event(_event)
90
+ #p _event.context.text.class
91
+ _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.context.text.strip+"\n"
92
+ _index_begin = @main_frame.text.index('end')
93
+ @main_frame.text.insert(_index_begin,_txt)
94
+ _index_end = @main_frame.text.index('end')
95
+ if _event.context.type == MsgContract::TYPE_DEBUG
96
+ @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
97
+ @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
98
+ @main_frame.text.tag_add('debug_msg',_index_begin, _index_end+ ' lineend')
99
+ parse_debug(_index_begin.split('.')[0].to_i)
100
+ elsif _event.context.type == MsgContract::TYPE_ERROR
101
+ @main_frame.text.tag_remove('simple_msg',_index_begin, _index_end+ ' lineend')
102
+ @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
103
+ @main_frame.text.tag_add('error_msg',_index_begin, _index_end+ ' lineend')
104
+ parse_debug(_index_begin.split('.')[0].to_i)
105
+ else
106
+ @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
107
+ @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
108
+ @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
109
+ end
110
+ @main_frame.text.tag_add('bord_msg',_index_begin+' linestart', _index_begin+ ' lineend')
111
+ @main_frame.text.tag_add('bord_msg',_index_end+' -1 lines linestart', _index_end+ ' -1 lines lineend')
112
+ @main_frame.text.see(_index_end)
113
+ end
114
+
115
+ def parse_debug(_from_row=0)
116
+ _row = 0
117
+ _cursor = @main_frame.text.cget('cursor')
118
+ @main_frame.text.value.each{|l|
119
+ _row = _row+1
120
+ if _row >= _from_row
121
+ _end = 0
122
+ m = /([\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*\.rb):(\d*)/.match(l)
123
+ while m
124
+ _txt = m.post_match
125
+ if m[1] && m[2]
126
+ _file = m[1]
127
+ _line = m[2]
128
+ _ibegin = _row.to_s+'.'+(m.begin(1)+_end).to_s
129
+ _iend = _row.to_s+'.'+(m.end(2)+_end).to_s
130
+ _end = m.end(2) + _end
131
+ @main_frame.text.tag_configure(_row,
132
+ 'foreground' => '#800000',
133
+ 'borderwidth'=>0,
134
+ 'relief'=>'flat',
135
+ 'underline'=>true
136
+ )
137
+ @main_frame.text.tag_add(_row,_ibegin,_iend)
138
+ @main_frame.text.tag_bind(_row,"Double-ButtonPress-1",
139
+ proc{
140
+ EditorContract.instance.open_file(self, 'file'=>_file, 'line'=>_line)
141
+ }
142
+ )
143
+ @main_frame.text.tag_bind(_row,"Enter",
144
+ proc{@main_frame.text.configure('cursor'=> 'hand2')}
145
+ )
146
+ @main_frame.text.tag_bind(_row,"Leave",
147
+ proc{@main_frame.text.configure('cursor'=> _cursor)}
148
+ )
149
+
150
+
151
+
152
+ end
153
+ m = /([A-Za-z]*[\.:]{0,1}[\/\w\d]*\.rb):(\d*)/.match(_txt)
154
+ end
155
+ end
156
+ }
157
+ end
158
+
159
+ def out(_txt=nil, _tag=nil)
160
+ if @main_frame && _txt
161
+ if _tag
162
+ @main_frame.text.insert('end',_txt, _tag)
163
+ else
164
+ @main_frame.text.insert('end',_txt)
165
+ end
166
+ end
167
+ end
168
+
169
+ def outln(_txt=nil, _tag=nil)
170
+ self.out(_txt+"\n",_tag)
171
+ end
172
+
173
+ end
File without changes
File without changes
File without changes
@@ -1,54 +1,54 @@
1
- #
2
- # ae-shell.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 Shell < ArcadiaExt
10
-
11
- def build
12
- #@ae_msg_contract = @arcadia.retrieve_contract(self, MsgContract)
13
- @run_threads = Array.new
14
- end
15
-
16
- def run_last
17
- run($arcadia['pers']['run.file.last'])
18
- end
19
-
20
- def run_current
21
- current_editor = $arcadia['editor'].raised
22
- run(current_editor.file) if current_editor
23
- end
24
-
25
- def stop
26
- @run_threads.each{|t|
27
- if t.alive?
28
- t.kill
29
- end
30
- }
31
- debug_quit if @adw
32
- end
33
-
34
-
35
- def run(_filename=nil)
36
- if _filename
37
- begin
38
- $arcadia['pers']['run.file.last']=_filename
39
- @run_threads << Thread.new{
40
- @cmd = open("|"+$arcadia['conf']['shell.ruby']+" "+_filename+" 2>&1","r"){
41
- |f|
42
- MsgContract.instance.out_debug(self, f.read)
43
- #@ae_msg_contract.out_debug(f.read)
44
- }
45
- }
46
- rescue Exception => e
47
- MsgContract.instance.out_debug(self, e)
48
- #@ae_msg_contract.out_debug(e)
49
- #@main_frame.text.insert('end', "---> "+e )
50
- end
51
- end
52
- end
53
-
54
- end
1
+ #
2
+ # ae-shell.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 Shell < ArcadiaExt
10
+
11
+ def build
12
+ #@ae_msg_contract = @arcadia.retrieve_contract(self, MsgContract)
13
+ @run_threads = Array.new
14
+ end
15
+
16
+ def run_last
17
+ run($arcadia['pers']['run.file.last'])
18
+ end
19
+
20
+ def run_current
21
+ current_editor = $arcadia['editor'].raised
22
+ run(current_editor.file) if current_editor
23
+ end
24
+
25
+ def stop
26
+ @run_threads.each{|t|
27
+ if t.alive?
28
+ t.kill
29
+ end
30
+ }
31
+ debug_quit if @adw
32
+ end
33
+
34
+
35
+ def run(_filename=nil)
36
+ if _filename
37
+ begin
38
+ $arcadia['pers']['run.file.last']=_filename
39
+ @run_threads << Thread.new{
40
+ @cmd = open("|"+$arcadia['conf']['shell.ruby']+" "+_filename+" 2>&1","r"){
41
+ |f|
42
+ MsgContract.instance.out_debug(self, f.read)
43
+ #@ae_msg_contract.out_debug(f.read)
44
+ }
45
+ }
46
+ rescue Exception => e
47
+ MsgContract.instance.out_debug(self, e)
48
+ #@ae_msg_contract.out_debug(e)
49
+ #@main_frame.text.insert('end', "---> "+e )
50
+ end
51
+ end
52
+ end
53
+
54
+ end