Class: Bash_Visual::VerticalScroll
- Defined in:
- lib/bash-visual/vertical_scroll.rb
Constant Summary
Constants inherited from Scroll
Scroll::BACKWARD, Scroll::BEGINNING, Scroll::ENDING, Scroll::FORWARD
Instance Attribute Summary
Attributes inherited from Scroll
Attributes included from FixedObject
Instance Method Summary collapse
- #get_y_position(available_area_height, message_size = 0) ⇒ Object
- #print_message(message, font, available_area) ⇒ Object
Methods inherited from Scroll
#add, form_block, #initialize, #prefix, #prefix=, #scroll
Methods included from FixedObject
Constructor Details
This class inherits a constructor from Bash_Visual::Scroll
Instance Method Details
#get_y_position(available_area_height, message_size = 0) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/bash-visual/vertical_scroll.rb', line 4 def get_y_position available_area_height, = 0 if (@start == BEGINNING) @y + (@height - available_area_height) else @y + available_area_height - end end |
#print_message(message, font, available_area) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/bash-visual/vertical_scroll.rb', line 12 def , font, available_area available_area_width, available_area_height = available_area msg_block_height = case when !@adapt 1 when @fixed_message_block_size @fixed_message_block_size when @max_message_block_size @max_message_block_size else available_area_height end msg_block_height -= 1 if @separator msg_block_height = available_area_height if msg_block_height > available_area_height = Scroll.form_block , [available_area_width, msg_block_height] if @separator << @separator * available_area_width end write(@x, get_y_position(available_area_height, .size), , font) [available_area_width, available_area_height - .size] end |