Class: ArcadiaDebug::ArcadiaDebugInfo

Inherits:
Object
  • Object
show all
Defined in:
ext/ae-debug/ae-debug.rb

Instance Method Summary collapse

Constructor Details

#initialize(_parent = nil) ⇒ ArcadiaDebugInfo

Returns a new instance of ArcadiaDebugInfo.



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'ext/ae-debug/ae-debug.rb', line 224

def initialize(_parent=nil)
  @nb = Tk::BWidget::NoteBook.new(_parent){
    tabbevelsize 0
    internalborderwidth 2
    activeforeground 'red'
    activebackground 'yellow'
    borderwidth 1
    side $arcadia['conf']['editor.tabs.side']
    font $arcadia['conf']['editor.tabs.font']
    pack('fill'=>'both', :expand => 'yes')
  }

  @nb_variables = @nb.insert('end','var' ,'text'=>'Variables' )

  @hsplitter = AGTkOSplittedFrames.new(@nb_variables,220)

  @hsplitter2 = AGTkOSplittedFrames.new(@hsplitter.top_frame,80)
  @vvl=VariablesViewText.new(@hsplitter2.top_frame,'Local')
  @vvi=VariablesViewText.new(@hsplitter2.bottom_frame,'Instance(self)')
  @vvg=VariablesViewText.new(@hsplitter.bottom_frame,'Global')
  font = $arcadia['conf']['inspectors.debug.tabs.font']
  font_b = $arcadia['conf']['inspectors.debug.tabs.font.bold']
  @vvl.text.tag_configure('key',
    'foreground' => 'blue',
    'font'=> font
  )
  @vvl.text.tag_configure('value',
    'foreground' => 'black',
    'font'=> font
  )
  @vvl.text.tag_configure('sep',
    'foreground' => 'gray',
    'font'=> font
  )

  @vvi.text.tag_configure('key',
    'foreground' => 'blue',
    'font'=> font
  )

  @vvi.text.tag_configure('value',
    'foreground' => 'black',
    'font'=> font
  )

  @vvi.text.tag_configure('sep',
    'foreground' => 'gray',
    'font'=> font
  )

  @vvg.text.tag_configure('key',
    'foreground' => '#018869',
    'font'=> font
  )

  @vvg.text.tag_configure('value',
    'foreground' => 'black' ,
    'font'=> font
  )

  @vvg.text.tag_configure('sep',
    'foreground' => 'gray',
    'font'=> font
  )

  @nb.raise('var')
end

Instance Method Details

#hash_to_str(_hash, _ind = 0) ⇒ Object



292
293
294
295
296
297
298
299
300
301
# File 'ext/ae-debug/ae-debug.rb', line 292

def hash_to_str(_hash, _ind=0)
  str = ''
  _hash.each{|key,val|
    str = str + "/s"*_ind+ key.to_s+' => '+val.to_s+"\n"
    if val.kind_of?(Hash)
      str = str + hash_to_str(val,_ind+2)
    end
  }
  return str
end

#update_globals(_vars) ⇒ Object



303
304
305
306
307
308
309
310
311
312
313
# File 'ext/ae-debug/ae-debug.rb', line 303

def update_globals(_vars)
  @vvg.text.delete('1.0','end')
  if _vars != nil
    str = ''
    _vars.each{|key,val|
      @vvg.text.insert('end',key.to_s.ljust(18),'key')
      @vvg.text.insert('end','','sep')
      @vvg.text.insert('end',val.to_s+"\n",'value')
    }
  end
end

#update_instances(_vars) ⇒ Object



326
327
328
329
330
331
332
333
334
335
# File 'ext/ae-debug/ae-debug.rb', line 326

def update_instances(_vars)
  @vvi.text.delete('1.0','end')
  if _vars != nil
    _vars.each{|key,val|
      @vvi.text.insert('end',key.to_s.ljust(18),'key')
      @vvi.text.insert('end','','sep')
      @vvi.text.insert('end',val.to_s+"\n",'value')
    }
  end
end

#update_locals(_vars) ⇒ Object



314
315
316
317
318
319
320
321
322
323
324
# File 'ext/ae-debug/ae-debug.rb', line 314

def update_locals(_vars)
  @vvl.text.delete('1.0','end')
  if _vars != nil
    #				@vvl.inspector.updatelines(_vars)
    _vars.each{|key,val|
      @vvl.text.insert('end',key.to_s.ljust(18),'key')
      @vvl.text.insert('end','','sep')
      @vvl.text.insert('end',val.to_s+"\n",'value')
    }
  end
end