Attributes
- direction
The direction of resizability associated with this SizePrefs object. If this SizePrefs is sizing along the X-axis, then direction should be "h", and correspondingly for the Y-axis.
direction = Enum('h', 'v')
- fixed_lengths
The maximum size of non-resizable elements in the span. If an element of this array is 0, then its corresponding span had no non-resizable components.
fixed_lengths = Array
- index
The index into a size tuple corresponding to our orientation (0 for horizontal, 1 for vertical). This is derived from direction in the constructor.
index = Int(0)
- resizable_lengths
The maximum preferred size of resizable elements in the span. If an element of this array is 0, then its corresponding span had no resizable components with a non-zero preferred size.
resizable_lengths = Array
Method summary
- __init__(self, length, direction)
- compute_size_array(self, size)
- get_preferred_size(self)
- update_from_component(self, component, index)
- update_from_pref_size(self, pref_length, index, resizable)
Methods
- __init__(self, length, direction)
Initializes this prefs object with empty arrays of the given length and with the given direction.
- compute_size_array(self, size)
Given a length along the axis corresponding to this SizePref, returns an array of lengths to assign each cell, taking into account resizability and preferred sizes.
- get_preferred_size(self)
- update_from_component(self, component, index)
Given a component at a particular index along this SizePref's axis, integrates the component's resizability and sizing information into self.fixed_lengths and self.resizable_lengths.
- update_from_pref_size(self, pref_length, index, resizable)