Class: UI::VerticalContainer

Inherits:
GenericContainer show all
Defined in:
lib/ektoplayer/ui/widgets/container.rb

Direct Known Subclasses

Ektoplayer::Views::MainWindow

Instance Attribute Summary

Attributes inherited from GenericContainer

#selected, #selected_index, #widgets

Attributes inherited from Widget

#pos, #size

Instance Method Summary collapse

Methods inherited from GenericContainer

#add, #draw, #initialize, #mouse_click, #on_key_press, #refresh, #remove, #select_next, #select_prev, #visible_widgets, #win

Methods inherited from Widget

#display, #draw, #events, #initialize, #invisible!, #invisible?, #key_press, #keys, #lock, #mouse, #mouse_click, #mouse_event_transform, #mouse_section, #on_key_press, #on_widget_raise, #raise_widget, #refresh, #sub, #unlock, #visible!, #visible=, #visible?, #want_layout, #want_redraw, #want_refresh, #with_lock

Constructor Details

This class inherits a constructor from UI::GenericContainer

Instance Method Details

#layoutObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/ektoplayer/ui/widgets/container.rb', line 113

def layout
   yoff = 0
   visible_widgets.each do |widget|
      widget.with_lock do
         widget.size=(widget.size.update(width: @size.width))
         widget.pos=(@pos.calc(y: yoff))
         fail WidgetSizeError if widget.size.width > @size.width
         fail WidgetSizeError if yoff + widget.size.height > @size.height
         yoff += widget.size.height
      end
   end

   super
end