rbhex-core 1.1.0.alpha3 → 1.1.0.alpha4

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +1 -1
  3. data/examples/atree.rb +1 -1
  4. data/examples/common/file.rb +2 -2
  5. data/examples/dbdemo.rb +1 -1
  6. data/examples/newtabbedwindow.rb +1 -1
  7. data/examples/newtesttabp.rb +4 -4
  8. data/examples/testbuttons.rb +3 -3
  9. data/examples/testcombo.rb +2 -2
  10. data/examples/testfields.rb +3 -3
  11. data/examples/testkeypress.rb +4 -4
  12. data/examples/testlistbox.rb +5 -5
  13. data/examples/testmessagebox.rb +4 -4
  14. data/examples/testprogress.rb +1 -1
  15. data/examples/testree.rb +3 -3
  16. data/examples/testwsshortcuts.rb +2 -2
  17. data/examples/testwsshortcuts2.rb +3 -3
  18. data/lib/rbhex/core/include/action.rb +2 -2
  19. data/lib/rbhex/core/include/actionmanager.rb +1 -1
  20. data/lib/rbhex/core/include/appmethods.rb +4 -4
  21. data/lib/rbhex/core/include/bordertitle.rb +6 -6
  22. data/lib/rbhex/core/include/chunk.rb +1 -1
  23. data/lib/rbhex/core/include/io.rb +2 -2
  24. data/lib/rbhex/core/include/listbindings.rb +2 -2
  25. data/lib/rbhex/core/include/listcellrenderer.rb +3 -3
  26. data/lib/rbhex/core/include/listscrollable.rb +1 -1
  27. data/lib/rbhex/core/include/listselectable.rb +13 -13
  28. data/lib/rbhex/core/include/multibuffer.rb +5 -5
  29. data/lib/rbhex/core/include/ractionevent.rb +4 -4
  30. data/lib/rbhex/core/include/rchangeevent.rb +3 -3
  31. data/lib/rbhex/core/include/rhistory.rb +1 -1
  32. data/lib/rbhex/core/include/rinputdataevent.rb +6 -6
  33. data/lib/rbhex/core/include/vieditable.rb +1 -1
  34. data/lib/rbhex/core/include/widgetmenu.rb +1 -1
  35. data/lib/rbhex/core/system/colormap.rb +1 -1
  36. data/lib/rbhex/core/system/ncurses.rb +1 -1
  37. data/lib/rbhex/core/system/window.rb +1 -1
  38. data/lib/rbhex/core/util/ansiparser.rb +1 -1
  39. data/lib/rbhex/core/util/app.rb +7 -7
  40. data/lib/rbhex/core/util/basestack.rb +20 -20
  41. data/lib/rbhex/core/util/bottomline.rb +2 -2
  42. data/lib/rbhex/core/util/colorparser.rb +1 -1
  43. data/lib/rbhex/core/util/focusmanager.rb +1 -1
  44. data/lib/rbhex/core/util/padreader.rb +2 -2
  45. data/lib/rbhex/core/util/rcommandwindow.rb +2 -2
  46. data/lib/rbhex/core/util/rdialogs.rb +7 -7
  47. data/lib/rbhex/core/util/viewer.rb +5 -5
  48. data/lib/rbhex/core/util/widgetshortcuts.rb +3 -3
  49. data/lib/rbhex/core/version.rb +1 -1
  50. data/lib/rbhex/core/widgets/applicationheader.rb +2 -2
  51. data/lib/rbhex/core/widgets/box.rb +3 -3
  52. data/lib/rbhex/core/widgets/divider.rb +2 -2
  53. data/lib/rbhex/core/widgets/keylabelprinter.rb +2 -2
  54. data/lib/rbhex/core/widgets/rcombo.rb +5 -5
  55. data/lib/rbhex/core/widgets/rcontainer.rb +2 -2
  56. data/lib/rbhex/core/widgets/rlink.rb +1 -1
  57. data/lib/rbhex/core/widgets/rlist.rb +1 -1
  58. data/lib/rbhex/core/widgets/rmenu.rb +15 -15
  59. data/lib/rbhex/core/widgets/rmenulink.rb +1 -1
  60. data/lib/rbhex/core/widgets/rmessagebox.rb +6 -6
  61. data/lib/rbhex/core/widgets/rprogress.rb +2 -2
  62. data/lib/rbhex/core/widgets/rtabbedpane.rb +3 -3
  63. data/lib/rbhex/core/widgets/rtabbedwindow.rb +2 -2
  64. data/lib/rbhex/core/widgets/rtextarea.rb +2 -2
  65. data/lib/rbhex/core/widgets/rtextview.rb +3 -3
  66. data/lib/rbhex/core/widgets/rtree.rb +6 -6
  67. data/lib/rbhex/core/widgets/rwidget.rb +12 -12
  68. data/lib/rbhex/core/widgets/scrollbar.rb +2 -2
  69. data/lib/rbhex/core/widgets/statusline.rb +1 -1
  70. data/lib/rbhex/core/widgets/tabular.rb +32 -32
  71. data/lib/rbhex/core/widgets/tabularwidget.rb +3 -3
  72. data/lib/rbhex/core/widgets/textpad.rb +3 -3
  73. data/lib/rbhex/core/widgets/tree/treecellrenderer.rb +3 -3
  74. data/lib/rbhex/core/widgets/tree/treemodel.rb +3 -3
  75. metadata +11 -11
@@ -1,5 +1,5 @@
1
1
  require 'rbhex/core/widgets/rwidget'
2
- module RubyCurses
2
+ module Rbhex
3
3
 
4
4
  ##
5
5
  # 2010-09-27 11:06 : i have modified this quite a bit, to calculate some stuff
@@ -10,8 +10,8 @@ module RubyCurses
10
10
  # NOTE: this class is being extended by many other classes. Careful while making
11
11
  # sweeping changes.
12
12
  class ListCellRenderer
13
- include RubyCurses::ConfigSetup
14
- include RubyCurses::Utils
13
+ include Rbhex::ConfigSetup
14
+ include Rbhex::Utils
15
15
  dsl_accessor :justify # :right, :left, :center # added 2008-12-22 19:02
16
16
  dsl_accessor :display_length # please give this to ensure the we only print this much
17
17
  dsl_accessor :height # if you want a multiline label.
@@ -7,7 +7,7 @@
7
7
  # @toprow : set to 0 for starters, top row to be displayed
8
8
  # @pcol (used for horiz scrolling, starts at 0)
9
9
  #
10
- module RubyCurses
10
+ module Rbhex
11
11
  module ListScrollable
12
12
  attr_reader :search_found_ix, :find_offset, :find_offset1
13
13
  attr_accessor :show_caret # 2010-01-23 23:06 our own fake insertion point
@@ -1,4 +1,4 @@
1
- # File created: 2010-10-29 14:09
1
+ # File created: 2010-10-29 14:09
2
2
  # Author : rkumar
3
3
  #
4
4
  # this is a new, simpler version of listselectable
@@ -7,7 +7,7 @@
7
7
  # Currently being used by rbasiclistbox (rlist) and now tabularwidget.
8
8
  # NOTE: pls define @_header_adjustment to 0 if you don't use it or know what it means.
9
9
  # TODO: of course we need to fire events so user can do something.
10
- module RubyCurses
10
+ module Rbhex
11
11
  module NewListSelectable
12
12
 
13
13
  # @group selection related
@@ -21,7 +21,7 @@ module RubyCurses
21
21
  def toggle_row_selection crow=@current_index-@_header_adjustment
22
22
  @last_clicked = crow
23
23
  @repaint_required = true
24
- case @selection_mode
24
+ case @selection_mode
25
25
  when :multiple
26
26
  @widget_scrolled = true # FIXME we need a better name
27
27
  if @selected_indices.include? crow
@@ -34,14 +34,14 @@ module RubyCurses
34
34
  fire_handler :LIST_SELECTION_EVENT, lse
35
35
  end
36
36
  else
37
- if @selected_index == crow
37
+ if @selected_index == crow
38
38
  @old_selected_index = @selected_index # 2011-10-15 so we can unhighlight
39
39
  @selected_index = nil
40
40
  lse = ListSelectionEvent.new(crow, crow, self, :DELETE)
41
41
  fire_handler :LIST_SELECTION_EVENT, lse
42
42
  else
43
43
  @old_selected_index = @selected_index # 2011-10-15 so we can unhighlight
44
- @selected_index = crow
44
+ @selected_index = crow
45
45
  lse = ListSelectionEvent.new(crow, crow, self, :INSERT)
46
46
  fire_handler :LIST_SELECTION_EVENT, lse
47
47
  end
@@ -58,7 +58,7 @@ module RubyCurses
58
58
  @last_clicked ||= crow
59
59
  min = [@last_clicked, crow].min
60
60
  max = [@last_clicked, crow].max
61
- case @selection_mode
61
+ case @selection_mode
62
62
  when :multiple
63
63
  @widget_scrolled = true # FIXME we need a better name
64
64
  if @selected_indices.include? crow
@@ -92,7 +92,7 @@ module RubyCurses
92
92
  @widget_scrolled = true # FIXME we need a better name
93
93
  end
94
94
  def is_row_selected crow=@current_index-@_header_adjustment
95
- case @selection_mode
95
+ case @selection_mode
96
96
  when :multiple
97
97
  @selected_indices.include? crow
98
98
  else
@@ -102,7 +102,7 @@ module RubyCurses
102
102
  alias :is_selected? is_row_selected
103
103
  # FIXME add adjustment and test
104
104
  def goto_next_selection
105
- return if selected_rows().length == 0
105
+ return if selected_rows().length == 0
106
106
  row = selected_rows().sort.find { |i| i > @current_index }
107
107
  row ||= @current_index
108
108
  @current_index = row
@@ -110,7 +110,7 @@ module RubyCurses
110
110
  end
111
111
  # FIXME add adjustment and test
112
112
  def goto_prev_selection
113
- return if selected_rows().length == 0
113
+ return if selected_rows().length == 0
114
114
  row = selected_rows().sort{|a,b| b <=> a}.find { |i| i < @current_index }
115
115
  row ||= @current_index
116
116
  @current_index = row
@@ -148,20 +148,20 @@ module RubyCurses
148
148
  # this, and the default should be zero.
149
149
  def select_all start_row=0 #+@_header_adjustment
150
150
  @repaint_required = true
151
- # don't select header row - need to make sure this works for all cases. we may
151
+ # don't select header row - need to make sure this works for all cases. we may
152
152
  # need a variable instead of hardoded value
153
153
  add_row_selection_interval start_row, row_count()
154
154
  end
155
155
  def invert_selection start_row=0 #+@_header_adjustment
156
156
  start_row.upto(row_count()){|i| invert_row_selection i }
157
157
  end
158
-
158
+
159
159
  def invert_row_selection row=@current_index-@_header_adjustment
160
160
  @repaint_required = true
161
161
  if is_selected? row
162
162
  remove_row_selection_interval(row, row)
163
163
  else
164
- add_row_selection_interval(row, row)
164
+ add_row_selection_interval(row, row)
165
165
  end
166
166
  end
167
167
  # selects all rows with the values given, leaving existing selections
@@ -204,7 +204,7 @@ module RubyCurses
204
204
  end # mod
205
205
  # Applications may call this or just copy and modify
206
206
 
207
- ##
207
+ ##
208
208
  # bindings related to selection
209
209
  #
210
210
  def list_bindings
@@ -1,13 +1,13 @@
1
- module RubyCurses
1
+ module Rbhex
2
2
  # this module makes it possible for a textview to maintain multiple buffers
3
- # The first buffer has been placed using set_content(lines, config).
3
+ # The first buffer has been placed using set_content(lines, config).
4
4
  # After this, additional buffers mst be supplied with add_content text, config.
5
- # Also, please note that after you call set_content the first time, you must call
5
+ # Also, please note that after you call set_content the first time, you must call
6
6
  # add_content so the buffer can be accessed while cycling. will try to fix this.
7
7
  # (I don't want to touch textview, would prefer not to write a decorator).
8
8
 
9
9
  # TODO allow setting of a limit, so in some cases where we keep adding
10
- # programatically, the
10
+ # programatically, the
11
11
  module MultiBuffers
12
12
  extend self
13
13
 
@@ -61,7 +61,7 @@ module RubyCurses
61
61
  @graphic.ungetch(?q.ord)
62
62
  end
63
63
  # display a menu so user can do buffer management
64
- # However, how can application add to these. Or disable, such as when we
64
+ # However, how can application add to these. Or disable, such as when we
65
65
  # add buffer delete or buffer insert or edit
66
66
  def buffer_menu
67
67
  menu = PromptMenu.new self do
@@ -3,16 +3,16 @@
3
3
  * Description: Event used to notify interested parties that an action has happened on component
4
4
  Usually a button press. Nothing more.
5
5
  * Author: rkumar (arunachalesha)
6
-
6
+
7
7
  --------
8
- * Date: 2010-09-12 18:53
8
+ * Date: 2010-09-12 18:53
9
9
  * License:
10
10
  Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
11
11
 
12
12
  =end
13
13
 
14
14
  # Event created when state changed (as in ViewPort)
15
- module RubyCurses
15
+ module Rbhex
16
16
  # source - as always is the object whose event has been fired
17
17
  # id - event identifier (seems redundant since we bind events often separately.
18
18
  # event - is :PRESS
@@ -20,7 +20,7 @@ module RubyCurses
20
20
  ActionEvent = Struct.new(:source, :event, :action_command) do
21
21
  # This should always return the most relevant text associated with this object
22
22
  # so the user does not have to go through the source object's documentation.
23
- # It should be a user-friendly string
23
+ # It should be a user-friendly string
24
24
  # @return text associated with source (label of button)
25
25
  def text
26
26
  source.text
@@ -2,16 +2,16 @@
2
2
  * Name: ChangeEvent
3
3
  * Description: Event used to notify interested parties that state of component has changed
4
4
  * Author: rkumar (arunachalesha)
5
-
5
+
6
6
  --------
7
- * Date: 2010-02-26 11:32
7
+ * Date: 2010-02-26 11:32
8
8
  * License:
9
9
  Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
10
10
 
11
11
  =end
12
12
 
13
13
  # Event created when state changed (as in ViewPort)
14
- module RubyCurses
14
+ module Rbhex
15
15
  class ChangeEvent
16
16
  attr_accessor :source
17
17
  def initialize source
@@ -17,7 +17,7 @@
17
17
  # otherwise it should implement *text()* for getting and setting value
18
18
  # and a *CHANGED* event for when user has modified a value and moved out
19
19
  # You can externally set $history_key to any unused key, otherwise it is M-h
20
- module RubyCurses
20
+ module Rbhex
21
21
  extend self
22
22
  module FieldHistory
23
23
  def self.extended(obj)
@@ -2,9 +2,9 @@
2
2
  * Name: InputDataEvent
3
3
  * Description: Event created when data modified in Field or TextEdit
4
4
  * Author: rkumar (arunachalesha)
5
-
5
+
6
6
  --------
7
- * Date: 2008-12-24 17:27
7
+ * Date: 2008-12-24 17:27
8
8
  * License:
9
9
  Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
10
10
 
@@ -15,8 +15,8 @@ http://blog.grayproductions.net/articles/all_about_struct
15
15
  =end
16
16
 
17
17
  # Event created when data modified in Field or TextEdit
18
- # 2008-12-24 17:54
19
- module RubyCurses
18
+ # 2008-12-24 17:54
19
+ module Rbhex
20
20
  class InputDataEvent
21
21
  attr_accessor :index0, :index1, :source, :type, :row, :text
22
22
  def initialize index0, index1, source, type, row, text
@@ -37,9 +37,9 @@ module RubyCurses
37
37
  #"#{@type.to_s}, #{@source}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
38
38
  "#{@type.to_s}, ind0:#{@index0}, ind1:#{@index1}, row:#{@row}, text:#{@text}"
39
39
  end
40
- # this is so that earlier applications were getting source in the block, not an event. they
40
+ # this is so that earlier applications were getting source in the block, not an event. they
41
41
  # were doing a fld.getvalue, so we must keep those apps running
42
- # @since 1.2.0 added 2010-09-11 12:25
42
+ # @since 1.2.0 added 2010-09-11 12:25
43
43
  def getvalue
44
44
  @source.getvalue
45
45
  end
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
  require 'rbhex/core/include/listeditable'
12
- module RubyCurses
12
+ module Rbhex
13
13
  module ViEditable
14
14
  include ListEditable
15
15
 
@@ -12,7 +12,7 @@
12
12
  #
13
13
  # Provide a system for us to define a menu for customizing a widget, such that
14
14
  # applicatin can also add more menuitems
15
- module RubyCurses
15
+ module Rbhex
16
16
  extend self
17
17
  module WidgetMenu
18
18
  include Io # added 2011-12-26
@@ -1,6 +1,6 @@
1
1
  require 'rbhex/core/system/ncurses'
2
2
 
3
- module RubyCurses
3
+ module Rbhex
4
4
  module ColorMap
5
5
  # 2010-09-20 12:22 changed colors from string to symbol
6
6
  ## private
@@ -127,7 +127,7 @@ module VER
127
127
  $stderr.puts @last_error, *@last_error.backtrace
128
128
  end
129
129
  require 'rbhex/core/system/colormap'
130
- include RubyCurses::ColorMap
130
+ include Rbhex::ColorMap
131
131
  end
132
132
  module Ncurses
133
133
  extend self
@@ -68,7 +68,7 @@ module VER
68
68
  #$error_message_row = $status_message_row = Ncurses.LINES-1
69
69
  $error_message_row ||= Ncurses.LINES-1
70
70
  $error_message_col ||= 1 # ask (bottomline) uses 0 as default so you can have mismatch. XXX
71
- $status_message ||= RubyCurses::Variable.new # in case not an App
71
+ $status_message ||= Rbhex::Variable.new # in case not an App
72
72
 
73
73
  $key_map ||= :vim
74
74
  $esc_esc = true; # gove me double esc as 2727 so i can map it.
@@ -13,7 +13,7 @@
13
13
  # - perhaps we can compile the regexp once and reuse
14
14
  #
15
15
 
16
- module RubyCurses
16
+ module Rbhex
17
17
  class AnsiParser
18
18
 
19
19
  # NOTE: Experimental and minimal
@@ -18,10 +18,10 @@ require 'logger'
18
18
  require 'rbhex/core'
19
19
  require 'rbhex/core/util/widgetshortcuts'
20
20
 
21
- include RubyCurses
22
- include RubyCurses::Utils
21
+ include Rbhex
22
+ include Rbhex::Utils
23
23
  include Io
24
- module RubyCurses
24
+ module Rbhex
25
25
  extend self
26
26
  ##
27
27
  #
@@ -69,7 +69,7 @@ module RubyCurses
69
69
  # This is the Application class which does the job of setting up the
70
70
  # environment, and closing it at the end.
71
71
  class App
72
- include RubyCurses::WidgetShortcuts
72
+ include Rbhex::WidgetShortcuts
73
73
  attr_reader :config
74
74
  attr_reader :form
75
75
  attr_reader :window
@@ -458,7 +458,7 @@ module RubyCurses
458
458
  # or
459
459
  #@blk = block # for later execution using @blk.call()
460
460
  #colorlabel = Label.new @form, {'text' => "Select a color:", "row" => row, "col" => col, "color"=>"cyan", "mnemonic" => 'S'}
461
- #var = RubyCurses::Label.new @form, {'text_variable' => $results, "row" => r, "col" => fc}
461
+ #var = Rbhex::Label.new @form, {'text_variable' => $results, "row" => r, "col" => fc}
462
462
 
463
463
  def OLDlabel *args
464
464
  events = block_event = nil
@@ -945,7 +945,7 @@ module RubyCurses
945
945
  # Use either say_with_pause, or put $status_message in command of statusline
946
946
  # @deprecated please use {#status_line} instead of a message label
947
947
  def create_message_label row=Ncurses.LINES-1
948
- @message_label = RubyCurses::Label.new @form, {:text_variable => @message, :name=>"message_label",:row => row, :col => 0, :display_length => Ncurses.COLS, :height => 1, :color => :white}
948
+ @message_label = Rbhex::Label.new @form, {:text_variable => @message, :name=>"message_label",:row => row, :col => 0, :display_length => Ncurses.COLS, :height => 1, :color => :white}
949
949
  end
950
950
 
951
951
  def run &block
@@ -1107,7 +1107,7 @@ module RubyCurses
1107
1107
  end # class
1108
1108
  end # module
1109
1109
  if $0 == __FILE__
1110
- include RubyCurses
1110
+ include Rbhex
1111
1111
  #app = App.new
1112
1112
  #window = app.window
1113
1113
  #window.printstring 2, 30, "Demo of Listbox - rbhex", $normalcolor, 'reverse'
@@ -1,4 +1,4 @@
1
- #
1
+ #
2
2
  # Common stack flow functionality
3
3
  # * Name: basestack.rb
4
4
  # * Description: Classes that allow user to stack and flow components
@@ -6,7 +6,7 @@
6
6
  # * Date: 30.10.11 - 12:57
7
7
  # * Last update: 2014-05-02 19:16
8
8
  #
9
- module RubyCurses
9
+ module Rbhex
10
10
  module ModStack
11
11
  #
12
12
  # Base class for stacks and flows.
@@ -30,10 +30,10 @@ module RubyCurses
30
30
  # We check the actual variables which config sets in init
31
31
  %w[ parent_component width height weight row col orientation margin_top margin_bottom margin_left margin_right].each { |e|
32
32
  eval(
33
- "def #{e}
33
+ "def #{e}
34
34
  @config[:#{e}]
35
35
  end
36
- def #{e}=(val)
36
+ def #{e}=(val)
37
37
  @config[:#{e}]=val
38
38
  instance_variable_set \"@#{e}\", val
39
39
  @calc_needed = true
@@ -72,21 +72,21 @@ module RubyCurses
72
72
  r = row + @margin_top
73
73
  rem = 0
74
74
  ht = height - (@margin_top + @margin_bottom)
75
- if @orientation == :bottom
75
+ if @orientation == :bottom
76
76
  mult = -1
77
77
  comps = @components.reverse
78
78
  r = row + height - @margin_bottom
79
-
79
+
80
80
  else
81
81
  mult = 1
82
82
  comps = @components
83
-
83
+
84
84
  end
85
- comps.each { |e|
85
+ comps.each { |e|
86
86
  # should only happen if expandable FIXME
87
87
  e.margin_top ||= 0
88
88
  e.margin_bottom ||= 0
89
- e.height = 0.01 * e.weight * (ht - (e.margin_top + e.margin_bottom))
89
+ e.height = 0.01 * e.weight * (ht - (e.margin_top + e.margin_bottom))
90
90
  hround = e.height.floor
91
91
  rem += e.height - hround
92
92
  e.height = hround #- (@margin_top + @margin_bottom)
@@ -103,9 +103,9 @@ module RubyCurses
103
103
  r += e.margin_top
104
104
  if @orientation == :bottom
105
105
  r += e.height * mult
106
- e.row = r
106
+ e.row = r
107
107
  else
108
- e.row = r
108
+ e.row = r
109
109
  r += e.height + 0
110
110
  end
111
111
  e.margin_left ||= 0
@@ -133,7 +133,7 @@ module RubyCurses
133
133
  comps = @components
134
134
  $log.debug "XXX: ORIENT2f recalc #{@orientation} "
135
135
  end
136
- comps.each { |e|
136
+ comps.each { |e|
137
137
  e.width = e.weight * wd * 0.01
138
138
  wround = e.width.floor
139
139
  rem += e.width - wround
@@ -276,11 +276,11 @@ module RubyCurses
276
276
  def repaint; @widget.repaint; end
277
277
  %w[ form parent parent_component width height row col row_offset col_offset focusable].each { |e|
278
278
  eval(
279
- "def #{e}
280
- @widget.#{e}
279
+ "def #{e}
280
+ @widget.#{e}
281
281
  end
282
- def #{e}=(val)
283
- @widget.#{e}=val
282
+ def #{e}=(val)
283
+ @widget.#{e}=val
284
284
  end"
285
285
  )
286
286
  }
@@ -294,7 +294,7 @@ module RubyCurses
294
294
  def traverse c, &block
295
295
  if c.is_a? BaseStack
296
296
  yield c
297
- c.components.each { |e|
297
+ c.components.each { |e|
298
298
  yield e
299
299
  }
300
300
  c.components.each { |e| traverse(e, &block) }
@@ -319,7 +319,7 @@ module RubyCurses
319
319
  end
320
320
  _add s
321
321
  @active << s
322
- yield_or_eval &block if block_given?
322
+ yield_or_eval &block if block_given?
323
323
  @active.pop
324
324
  # if active is empty then this is where we could calculate
325
325
  # percentatges and do recalc, thus making it independent
@@ -365,8 +365,8 @@ module RubyCurses
365
365
  $log.debug "XXX: calc COMP COUNT #{sz} "
366
366
  # calculate how much weightage has been given by user
367
367
  # so we can allocate average to other components
368
- components.each { |e|
369
- if e.config[:weight]
368
+ components.each { |e|
369
+ if e.config[:weight]
370
370
  wt += e.config[:weight]
371
371
  cnt += 1
372
372
  end