Class: Wads::HeaderContentLayout

Inherits:
SectionLayout show all
Defined in:
lib/wads/widgets.rb

Overview

The layout sections are as follows:

+-------------------------------------------------+
+                  SECTION_NORTH                  +
+-------------------------------------------------+
+                                                 +
+                  SECTION_CENTER                 +
+                                                 +
+-------------------------------------------------+

Instance Attribute Summary

Attributes inherited from SectionLayout

#container_map

Attributes inherited from WadsLayout

#args, #border_coords, #parent_widget

Instance Method Summary collapse

Methods inherited from SectionLayout

#get_coordinates

Methods inherited from WadsLayout

#add_button, #add_document, #add_graph_display, #add_horizontal_panel, #add_image, #add_max_panel, #add_multi_select_table, #add_plot, #add_single_select_table, #add_table, #add_text, #add_text_input, #add_vertical_panel, #add_widget, #get_coordinates, #internal_add_panel

Constructor Details

#initialize(x, y, width, height, parent_widget, args = {}) ⇒ HeaderContentLayout

Returns a new instance of HeaderContentLayout.



820
821
822
823
824
825
826
827
828
829
830
831
832
# File 'lib/wads/widgets.rb', line 820

def initialize(x, y, width, height, parent_widget, args = {})
    super
    # Divide the height into 100, 100, and the middle gets everything else
    # Right now we are using 100 pixels rather than a percentage for the borders
    header_section_height = 100
    if args[ARG_DESIRED_HEIGHT]
        header_section_height = args[ARG_DESIRED_HEIGHT]
    end
    middle_section_y_start = y + header_section_height
    height_middle_section = height - header_section_height
    @container_map[SECTION_NORTH] = GuiContainer.new(x, y, width, header_section_height)
    @container_map[SECTION_CENTER] = GuiContainer.new(x, middle_section_y_start, width, height_middle_section, FILL_VERTICAL_STACK)
end