Class: Wads::BorderLayout
- Inherits:
-
SectionLayout
- Object
- WadsLayout
- SectionLayout
- Wads::BorderLayout
- Defined in:
- lib/wads/widgets.rb
Overview
The layout sections are as follows:
+-------------------------------------------------+
+ SECTION_NORTH +
+-------------------------------------------------+
+ | | +
+ SECTION_WEST | SECTION_CENTER | SECTION_EAST +
+ | | +
+-------------------------------------------------+
+ SECTION_SOUTH +
+-------------------------------------------------+
Instance Attribute Summary
Attributes inherited from SectionLayout
Attributes inherited from WadsLayout
#args, #border_coords, #parent_widget
Instance Method Summary collapse
-
#initialize(x, y, width, height, parent_widget, args = {}) ⇒ BorderLayout
constructor
A new instance of BorderLayout.
Methods inherited from SectionLayout
#add_east_west_panel, #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 = {}) ⇒ BorderLayout
Returns a new instance of BorderLayout.
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 |
# File 'lib/wads/widgets.rb', line 940 def initialize(x, y, width, height, , 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 middle_section_y_start = y + 100 bottom_section_y_start = y + height - 100 height_middle_section = bottom_section_y_start - middle_section_y_start middle_section_x_start = x + 100 right_section_x_start = x + width - 100 width_middle_section = right_section_x_start - middle_section_x_start @container_map[SECTION_NORTH] = GuiContainer.new(x, y, width, 100) @container_map[SECTION_WEST] = GuiContainer.new( x, middle_section_y_start, 100, height_middle_section, FILL_VERTICAL_STACK) @container_map[SECTION_CENTER] = GuiContainer.new( middle_section_x_start, middle_section_y_start, width_middle_section, height_middle_section, FILL_VERTICAL_STACK) @container_map[SECTION_EAST] = GuiContainer.new( right_section_x_start, middle_section_y_start, 100, height_middle_section, FILL_VERTICAL_STACK) @container_map[SECTION_SOUTH] = GuiContainer.new(x, bottom_section_y_start, width, 100) end |