arcadia 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ #
2
+ # ae-event-log.rb - Arcadia Ruby ide
3
+ # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
+ #
1
5
 
2
6
 
3
7
  class EventLog < ArcadiaExt
@@ -15,30 +19,34 @@ class EventLog < ArcadiaExt
15
19
 
16
20
  def do_event(_event)
17
21
  if _event.context.sender!=self
18
- message = ''
19
- #message = _event.context.sender.class.to_s+" => "
22
+ message = event_message(_event)
23
+ MsgContract.instance.out_simple(self, message,'CH1')
24
+ end
25
+ end
26
+
27
+
28
+ def event_message(_event, _ind="")
29
+ message = _ind
20
30
  if _event.is_action?
21
31
  message = message + 'ACTION::'
22
32
  end
23
- message = message +_event.signature+" $ "
24
- #message = message + 'CONTEXT : '
33
+ message = message +_event.signature+" :\n"
25
34
  if _event.context
26
- _event.context.instance_variables.each do |key|
27
- _value = _event.context.send(key.gsub('@',''))
35
+ _event.context.instance_variables.sort.each do |key|
36
+ _obj_value = _event.context.send(key.gsub('@',''))
37
+ _value = _obj_value
28
38
  if _value == nil
29
39
  _value = 'nil'
30
40
  else !_value.instance_of?(String)
31
41
  _value = _value.to_s
32
42
  end
33
- message = message + ' -'+key+':'+_value
43
+ message = message + _ind + "\s"*2 + key+' = '+_value+"\n"
44
+ if _obj_value != nil && _obj_value.kind_of?(ArcadiaContract::ContractEvent)
45
+ message = message + event_message(_obj_value, _ind+"\s"*4)
46
+ end
34
47
  end
35
48
  end
36
- MsgContract.instance.out_simple(self, message,'CH1')
37
- # if @ae_msg_contract
38
- # @ae_msg_contract.out_simple(message)
39
- # else
40
- # p message
41
- # end
42
- end
43
- end
49
+ return message
50
+ end
51
+
44
52
  end
@@ -11,7 +11,7 @@ font=courier 9
11
11
  font.bold=courier 9 bold
12
12
  color.background=#ffffff
13
13
  color.foreground=#000000
14
- i386-freebsd6:font=courier 12 italic
15
- i386-freebsd6:font.bold=courier 12 bold
16
- i386-mswin32:font={Courier New} 9
17
- i386-mswin32:font.bold={Courier New} 9 bold
14
+ i386-freebsd6::font=courier 12 italic
15
+ i386-freebsd6::font.bold=courier 12 bold
16
+ i386-mswin32::font={Courier New} 9
17
+ i386-mswin32::font.bold={Courier New} 9 bold
@@ -1,3 +1,10 @@
1
+ #
2
+ # ae-file-history.rb - Arcadia Ruby ide
3
+ # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
+ #
5
+ require "base/a-ext"
6
+
7
+
1
8
  class TreeNode
2
9
  attr_reader :sons
3
10
  attr_reader :parent
@@ -51,17 +58,24 @@ end
51
58
 
52
59
 
53
60
  class FileH < ArcadiaExt
54
- attr_reader :htext
55
- #attr_reader :last_add
61
+ attr_reader :htree
56
62
 
57
63
  def before_build
58
- #ArcadiaContractListener.new(self, EditorContract, :do_editor_event)
59
64
  end
60
65
 
61
66
  def build
62
67
  @h_stack = Array.new
63
68
  do_select_item = proc{|_self|
64
- _dir, _file = _self.selection_get[0].split('@@@')
69
+ if _self.selection_get[0].length >0
70
+ _selected = ""
71
+ _self.selection_get[0].each{|_block|
72
+ _selected = _selected + _block.to_s + "\s"
73
+ }
74
+ _selected = _selected.strip
75
+ else
76
+ _selected = _self.selection_get[0]
77
+ end
78
+ _dir, _file = _selected.split('@@@')
65
79
  if _file
66
80
  _file = File.expand_path( _file , _dir )
67
81
  else
@@ -77,13 +91,12 @@ class FileH < ArcadiaExt
77
91
  @font_b = conf('font.bold')
78
92
 
79
93
  @htree = Tk::BWidget::Tree.new(self.frame){
80
- background '#FFFFFF'
81
94
  relief 'flat'
82
95
  showlines false
83
96
  deltay 18
84
97
  background _background
85
98
  crossfill _foreground
86
- dragenabled true
99
+ #dragenabled true
87
100
  selectcommand proc{ do_select_item.call(self) }
88
101
  place('relwidth' => 1,'relx' => 0,'x' => '0','y' => '0','relheight' => '1')
89
102
  }
@@ -145,8 +158,6 @@ class FileH < ArcadiaExt
145
158
  end
146
159
  end
147
160
 
148
-
149
-
150
161
  file_dir.keys.sort.each{|_dir|
151
162
  node = root.dir(_dir)
152
163
  file_dir[_dir].each{|file|
@@ -170,7 +181,7 @@ class FileH < ArcadiaExt
170
181
  'helptext' => _d,
171
182
  'deltax'=>-1,
172
183
  'fill' => _foreground,
173
- 'font'=>$arcadia['conf']['editor.explorer_panel.tree.font'],
184
+ 'font'=>@font,
174
185
  'window'=> window('KDir')
175
186
  }
176
187
  )
@@ -182,7 +193,7 @@ class FileH < ArcadiaExt
182
193
  'helptext' => _f,
183
194
  'deltax'=>-1,
184
195
  'fill' => _foreground,
185
- 'font'=>@font,
196
+ 'font'=>@font_b,
186
197
  'window'=> window('KFile',_f)
187
198
  }
188
199
  )
@@ -195,8 +206,7 @@ class FileH < ArcadiaExt
195
206
  _foreground = conf('color.foreground')
196
207
 
197
208
  if _kind == 'KDir'
198
- return TkLabel.new(@tree_exp){
199
- #image TkPhotoImage.new('dat' => FOLDER_GIF)
209
+ return TkLabel.new(self.frame){
200
210
  image TkPhotoImage.new('dat' => BOOK_GIF)
201
211
  background(_background)
202
212
  foreground(_foreground)
@@ -207,7 +217,7 @@ class FileH < ArcadiaExt
207
217
  else
208
218
  _image = DOCUMENT_GIF
209
219
  end
210
- return TkLabel.new(@tree_exp){
220
+ return TkLabel.new(self.frame){
211
221
  image TkPhotoImage.new('dat' => _image)
212
222
  background(_background)
213
223
  foreground(_foreground)
@@ -560,7 +560,7 @@ class InspectList
560
560
  @right_text.configure('selectbackground'=>@right_text.cget('background'))
561
561
  # @left_text = TkText.new(@pwind.left_frame, 'relief'=>'flat').pack('expand'=>'yes', 'fill'=>'both')
562
562
  # @right_text = TkText.new(@pwind.right_frame, 'relief'=>'flat').pack('expand'=>'yes', 'fill'=>'both')
563
- @bar.command(proc { |args|
563
+ @bar.command(proc { |*args|
564
564
  @left_text.yview(*args)
565
565
  @right_text.yview(*args)
566
566
  })
@@ -1199,7 +1199,7 @@ class Obji
1199
1199
 
1200
1200
  def select(me, _activate_me=true)
1201
1201
  return if @active_object == me
1202
- me.activate if _activate_me
1202
+ me.activate #if _activate_me
1203
1203
  @active_object = me
1204
1204
  @inspect_core.recicle_inspects(me)
1205
1205
  @lb.select(me)
@@ -1322,12 +1322,12 @@ class ObjiController < ArcadiaExt
1322
1322
  obji.select(_event.context.wrapper, false)
1323
1323
  when InspectorContract::DELETE_WRAPPER
1324
1324
  obji.delete(_event.context.wrapper)
1325
- # when InspectorContract::UPDATE_PROPERTY
1326
- # obji.inspect_core.update_property(_event.context.wrapper, _event.context.property_family, _event.context.property_name, _event.context.property_value)
1327
1325
  when InspectorContract::DELETE_INSPECTOR
1328
1326
  self.del(obji)
1329
1327
  when InspectorContract::RAISE_ACTIVE_TOPLEVEL
1330
1328
  self.active.raise_toplevel if active
1329
+ when InspectorContract::RAISE_LAST_WIDGET
1330
+ self.active.select_last(true) if active
1331
1331
  end
1332
1332
  end
1333
1333
 
@@ -9,7 +9,7 @@ MsgContract.channel=CH1
9
9
 
10
10
  font=courier 7
11
11
  font.bold=courier 9 bold
12
- i386-freebsd6:font=courier 10
13
- i386-freebsd6:font.bold=courier 12 bold
14
- i386-mswin32:font={Courier New} 9
15
- i386-mswin32:font.bold={Courier New} 9 bold
12
+ i386-freebsd6::font=courier 10
13
+ i386-freebsd6::font.bold=courier 12 bold
14
+ i386-mswin32::font={Courier New} 9
15
+ i386-mswin32::font.bold={Courier New} 9 bold
@@ -8,7 +8,7 @@ MsgContract.channel=0
8
8
 
9
9
  font=courier 7
10
10
  font.bold=courier 9 bold
11
- i386-freebsd6:font=courier 12
12
- i386-freebsd6:font.bold=courier 12 bold
13
- i386-mswin32:font={Courier New} 9
14
- i386-mswin32:font.bold={Courier New} 9 bold
11
+ i386-freebsd6::font=courier 12
12
+ i386-freebsd6::font.bold=courier 12 bold
13
+ i386-mswin32::font={Courier New} 9
14
+ i386-mswin32::font.bold={Courier New} 9 bold
@@ -24,6 +24,7 @@ class OutputView
24
24
 
25
25
  #@splitted_frame = AGTkVSplittedFrames.new(parent.frame,20)
26
26
  @text = TkText.new(parent.frame,
27
+ 'wrap'=> 'none',
27
28
  'relief' => 'sunken',
28
29
  'font' => parent.conf('font')
29
30
  ){|j|
@@ -43,6 +44,13 @@ class OutputView
43
44
  'borderwidth'=>1,
44
45
  'relief'=> 'flat'
45
46
  )
47
+ @text.tag_configure('error_msg',
48
+ 'background' => '#f6c9f6',
49
+ 'foreground' => 'red',
50
+ 'borderwidth'=>1,
51
+ 'relief'=> 'flat'
52
+ )
53
+
46
54
  @text.tag_configure('bord_msg',
47
55
  #'foreground' => '#b9b8b9'
48
56
  'foreground' => '#7c9b10'
@@ -81,15 +89,23 @@ class Output < ArcadiaExt
81
89
  end
82
90
 
83
91
  def do_msg_event(_event)
92
+ #p _event.context.text.class
84
93
  _txt = "\n+--- "+format_time(_event.time)+" ---+\n"+_event.context.text.strip+"\n"
85
94
  _index_begin = @main_frame.text.index('end')
86
95
  @main_frame.text.insert(_index_begin,_txt)
87
96
  _index_end = @main_frame.text.index('end')
88
97
  if _event.context.type == MsgContract::TYPE_DEBUG
89
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')
90
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')
91
106
  parse_debug(_index_begin.split('.')[0].to_i)
92
107
  else
108
+ @main_frame.text.tag_remove('error_msg',_index_begin, _index_end+ ' lineend')
93
109
  @main_frame.text.tag_remove('debug_msg',_index_begin, _index_end+ ' lineend')
94
110
  @main_frame.text.tag_add('simple_msg',_index_begin, _index_end+ ' lineend')
95
111
  end
@@ -3,7 +3,6 @@
3
3
  # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
4
  #
5
5
 
6
- #require 'ext/ae-inspector/ae-inspector'
7
6
  require 'base/a-libs'
8
7
  require 'lib/tk/al-tk'
9
8
  require 'tk'
@@ -21,15 +20,11 @@ class Palette < ArcadiaExt
21
20
  end
22
21
 
23
22
  def build
24
- #@ae_inspector_action_contract = @arcadia.retrieve_contract(self, InspectorActionContract)
25
- #@main_frame = @arcadia.layout.register_panel('_tokyo_','libman', 'Libman')
26
23
  @buttons = Hash.new
27
24
  create_palettes
28
25
  end
29
26
 
30
27
  def after_build
31
- #p @ae_inspector_talker.info
32
- #exit
33
28
  end
34
29
 
35
30
  def do_inspector_event(_event)
@@ -37,7 +32,6 @@ class Palette < ArcadiaExt
37
32
  when InspectorContract::SELECT_WRAPPER
38
33
  @selected_wrapper=_event.context.wrapper
39
34
  end
40
-
41
35
  end
42
36
 
43
37
  def do_palette_event(_event)
@@ -64,19 +58,12 @@ class Palette < ArcadiaExt
64
58
  eval(cod)
65
59
  end
66
60
 
67
- # def eval_file_saved(_filename=nil)
68
- # if _filename && (_filename.length > 0)
69
- # @arcadia.objects('editor').open_file(_filename)
70
- # end
71
- # end
72
-
73
61
  def create_palettes
74
62
  @cc = WrapperContainer.new(self){
75
63
  border 0
76
64
  borderwidth 1
77
65
  }
78
66
  @cc.pack('side' =>'left', 'fill' =>'both', 'anchor'=>'nw', :padx=>2, :pady=>2)
79
- #place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1)
80
67
  @arcadia.libs.list.each{|lib|
81
68
  @cc.add_palette(lib)
82
69
  }
@@ -112,9 +99,6 @@ class WrapperContainer < TkFrame
112
99
  @button_m = Tk::BWidget::Button.new(frame){
113
100
  _command = proc{
114
101
  require 'tk/clipboard'
115
- #objiinfo = _owner.ae_inspector_talker.info
116
- #_code = $arcadia['objic'].active.active_object.renderer.class_code.to_s
117
- #_code = objiinfo.active_wrapper.renderer.class_code.to_s
118
102
  _code = AG.active.renderer.class_code.to_s if AG.active
119
103
  TkClipboard::set(_code)
120
104
  eval(_code)
@@ -218,9 +202,12 @@ class WrapperContainer < TkFrame
218
202
  @classes_panel = @familyts.insert('end',_name,
219
203
  'text'=>_name#,
220
204
  )
221
-
205
+
206
+ _background = @classes_panel.cget('background')
207
+
222
208
  @tpanel = TkText.new(@classes_panel){
223
209
  relief 'flat'
210
+ background _background
224
211
  }.pack('side' =>'left', 'anchor'=>'nw', :padx=>2, :pady=>2)
225
212
 
226
213
 
@@ -5,7 +5,7 @@ class=Shell
5
5
 
6
6
 
7
7
  #:::::::::::::::: output ::::::::::::::::::::::<begin>
8
- ruby=ruby1.8
9
- i386-freebsd6:ruby=ruby
10
- i386-mswin32:ruby=ruby
8
+ ruby=ruby
9
+ i386-freebsd6::ruby=ruby
10
+ i386-mswin32::ruby=ruby
11
11
  #:::::::::::::::: output ::::::::::::::::::::::<end>
@@ -44,6 +44,7 @@ class AGTkObjRect
44
44
  def do_enter(x, y)
45
45
  @oldcursor = @r.cget('cursor')
46
46
  @r.configure('cursor'=> @cursor)
47
+
47
48
  end
48
49
 
49
50
  def do_leave
@@ -263,6 +264,7 @@ class AGTkPlaceManager
263
264
  end
264
265
 
265
266
  def refresh
267
+ Tk.update
266
268
  getx0x3
267
269
  activate(false)
268
270
  end
@@ -901,8 +903,8 @@ class AGTk < AG
901
903
  attr_writer :x0, :y0, :x3, :y3
902
904
 
903
905
  def initialize(_ag_parent = nil, _object = nil)
906
+ #Tk.update if _object != nil && _ag_parent == nil
904
907
  super(_ag_parent, _object)
905
-
906
908
  if (defined? @obj)
907
909
  if @ag_parent != nil
908
910
  ppress = proc{
@@ -931,7 +933,7 @@ class AGTk < AG
931
933
 
932
934
  def update_property(_sender, _family,_name,_value)
933
935
  super
934
- if _sender != self && ['x','y','width','height'].include?(_name)
936
+ if _sender != self && ['x','y','width','height','text'].include?(_name)
935
937
  @l_manager.refresh
936
938
  end
937
939
 
@@ -941,7 +943,7 @@ class AGTk < AG
941
943
  def popup_items(_popup_menu)
942
944
  _popup_menu.insert('end',
943
945
  :command,
944
- :label=>@obj.class.to_s,
946
+ :label=>self.class.class_wrapped.to_s,
945
947
  :background => 'white',
946
948
  :hidemargin => false
947
949
  )
@@ -1051,19 +1053,19 @@ class AGTk < AG
1051
1053
  __FILE__
1052
1054
  end
1053
1055
 
1054
- def updatep(_family, prop, value, _call_from_inspector=false)
1055
- if _call_from_inspector && ['place','pack','grid','layout_man'].include?(_family)
1056
- @l_manager.deactivate
1057
- end
1058
- super(_family, prop,value, _call_from_inspector)
1059
- if _call_from_inspector && _family == 'place'
1060
- @l_manager.place_manager.initx0x3
1061
- end
1062
- if _call_from_inspector && ['place','pack','grid','layout_man'].include?(_family)
1063
- @l_manager.activate
1064
- end
1065
- Tk.update
1066
- end
1056
+ # def updatep(_family, prop, value, _call_from_inspector=false)
1057
+ # if _call_from_inspector && ['place','pack','grid','layout_man'].include?(_family)
1058
+ # @l_manager.deactivate
1059
+ # end
1060
+ # super(_family, prop,value, _call_from_inspector)
1061
+ # if _call_from_inspector && _family == 'place'
1062
+ # @l_manager.place_manager.initx0x3
1063
+ # end
1064
+ # if _call_from_inspector && ['place','pack','grid','layout_man'].include?(_family)
1065
+ # @l_manager.activate
1066
+ # end
1067
+ # Tk.update
1068
+ # end
1067
1069
 
1068
1070
  def activate
1069
1071
  super
@@ -1189,7 +1191,10 @@ class Revparsel
1189
1191
  if m
1190
1192
  _c,_class_name,_c,_class = m[0].split
1191
1193
  _obj_name = _class_name.sub(/^./) { $&.downcase}
1192
- cod = _code + "\n@"+ _obj_name + "="+ _class_name+".new\n"
1194
+ cod = _code + "\n@"+ _obj_name + "="+ _class_name+".new('class'=>"+_class+")\n"
1195
+ cod = cod +"Tk.update\n"
1196
+ eval(cod)
1197
+ cod = ''
1193
1198
  cod = cod + '@ag'+ _obj_name + "="+'AG'+ _class+".new(nil,@"+_obj_name+"){\n"
1194
1199
  cod = cod + "|_self|\n"
1195
1200
  cod = cod + " _self.i_name='"+_obj_name+"' \n"
@@ -2082,9 +2087,11 @@ module TkProperties
2082
2087
 
2083
2088
  def TkProperties.class(_obj)
2084
2089
  {'name'=>'class',
2090
+ 'default'=> AG.near_class_wrapped(_obj).to_s,
2085
2091
  'get'=> proc{_obj.cget('class')},
2086
2092
  'set'=> proc{|r| _obj.configure('class'=>r)},
2087
- 'def'=> ""
2093
+ 'def'=> "",
2094
+ 'kind'=>'on-create'
2088
2095
  }
2089
2096
  end
2090
2097
 
@@ -2443,9 +2450,6 @@ class AGTkBaseContainer < AGTkLayoutManaged
2443
2450
  _tobj = PaletteContract::TPaletteObj.new(self)
2444
2451
  _tobj.parent = self
2445
2452
  PaletteContract.instance.make_selected(_tobj)
2446
- #Arcadia.instance.retrieve_contract(self, PaletteActionContract).make_selected(PaletteActionContract::TObj.new(self))
2447
- #$arcadia.objects('palette').give_me_obj(self)
2448
- #@obj.callback_break
2449
2453
  }
2450
2454
  @obj.bind_append("ButtonRelease-1", p1)
2451
2455
 
@@ -2477,7 +2481,7 @@ class AGTkToplevel < AGTkContainer
2477
2481
 
2478
2482
  def form2code
2479
2483
  tobj = EditorContract::TEditorObj.new(self)
2480
- tobj.title = @i_name
2484
+ tobj.title = @i_name+'.rb'
2481
2485
  tobj.text = @renderer.class_code.to_s
2482
2486
  EditorContract.instance.open_text(tobj)
2483
2487
  #Arcadia.instance.retrieve_contract(self, EditorActionContract).open_text(tobj)