Home | Trees | Indices | Help |
|
---|
|
object --+ | util.IEventListener --+ | terminal.paintable.IPaintable --+ | object --+ | | | terminal.variable_owner.IVariableOwner --+ | object --+ | | | terminal.sizeable.ISizeable --+ | component.IComponent --+ | object --+ | | | event.method_event_source.IMethodEventSource --+ | abstract_component.AbstractComponent --+ | object --+ | | | util.IEventListener --+ | | | terminal.paintable.IPaintable --+ | | | object --+ | | | | | terminal.variable_owner.IVariableOwner --+ | | | object --+ | | | | | terminal.sizeable.ISizeable --+ | | | component.IComponent --+ | | | component_container.IComponentContainer --+ | abstract_component_container.AbstractComponentContainer --+ | object --+ | | | util.IEventListener --+ | | | terminal.paintable.IPaintable --+ | | | object --+ | | | | | terminal.variable_owner.IVariableOwner --+ | | | object --+ | | | | | terminal.sizeable.ISizeable --+ | | | component.IComponent --+ | | | component_container.IComponentContainer --+ | | | layout.ILayout --+ | object --+ | | | layout.IMarginHandler --+ | abstract_layout.AbstractLayout --+ | object --+ | | | layout.IAlignmentHandler --+ | object --+ | | | layout.ISpacingHandler --+ | object --+ | | | event.layout_events.ILayoutClickNotifier --+ | GridLayout
A container that consists of components with certain coordinates (cell position) on a grid. It also maintains cursor for adding component in left to right, top to bottom order.
Each component in a GridLayout
uses a certain area
(column1,row1,column2,row2) from the grid. One should not add components
that would overlap with the existing components because in such case an
OverlapsException is thrown. Adding component with
cursor automatically extends the grid by increasing the grid height.
Version: 1.1.2
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
CLIENT_WIDGET = None hash(x) |
|||
_CLICK_EVENT =
|
|||
_ALIGNMENT_DEFAULT = Alignment((Bits.ALIGNMENT_TOP+ Bits.ALIGN
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
Constructor for grid of given size (number of cells). Note that grid's final size depends on the items that are added into the grid. Grid grows if you add components outside the grid's area.
|
Adds a component with a specified area to the grid. The area the new component should take is defined by specifying the upper left corner (column1, row1) and the lower right corner (column2, row2) of the area. If the new component overlaps with any of the existing components already present in the grid the operation will fail and an OverlapsException is thrown. Alternatively, adds the component into this container to cells column1,row1 (NortWest corner of the area.) End coordinates (SouthEast corner of the area) are the same as column1,row1. Component width and height is 1. Finally, adds the component into this container to the cursor position. If the cursor position is already occupied, the cursor is moved forwards to find free position. If the cursor goes out from the bottom of the grid, the grid is automatically extended.
|
Tests if the given area overlaps with any of the items already on the grid.
|
Force the next component to be added to the beginning of the next line. By calling this function user can ensure that no more components are added to the right of the previous component. See Also: space |
Moves the cursor forwards by one. If the cursor goes out of the right grid border, move it to next line. See Also: newLine |
Removes the given component from this container or removes the component specified with it's cell index.
|
Gets an iterator to the component container contents. Using the Iterator it's possible to step through the contents of the container.
|
Gets the number of contained components. Consistent with the iterator returned by getComponentIterator.
|
Paints the contents of this component.
|
Returns the current Alignment of given component.
|
Sets the number of columns in the grid. The column count can not be reduced if there are any areas that would be outside of the shrunk grid.
|
Get the number of columns in the grid.
|
Sets the number of rows in the grid. The number of rows can not be reduced if there are any areas that would be outside of the shrunk grid.
|
Get the number of rows in the grid.
|
Gets the current cursor x-position. The cursor position points the position for the next component that is added without specifying its coordinates (grid cell). When the cursor position is occupied, the next component will be added to first free position after the cursor.
|
Sets the current cursor x-position. This is usually handled automatically by GridLayout. |
Gets the current cursor y-position. The cursor position points the position for the next component that is added without specifying its coordinates (grid cell). When the cursor position is occupied, the next component will be added to first free position after the cursor.
|
Sets the current cursor y-position. This is usually handled automatically by GridLayout. |
Replaces the component in the container with another one without changing position. This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. IComponent attach and detach events should be taken care as with add and remove.
|
Removes all components from the container. This should probably be re-implemented in extending classes for a more powerful implementation.
|
Sets the component alignment using a short hand string notation.
Deprecated: Replaced by setComponentAlignment |
Enable spacing between child components within this layout. NOTE: This will only affect the space between components, not the space around all the components in the layout (i.e. do not confuse this with the cellspacing attribute of a HTML Table). Use setMargin to add space around the layout. See the reference manual for more information about CSS rules for defining the amount of spacing to use.
|
|
|
Inserts an empty row at the chosen position in the grid.
|
Removes row and all components in the row. Components which span over several rows are removed if the selected row is the component's first row. If the last row is removed then all remaining components will be removed and the grid will be reduced to one row. The cursor will be moved to the upper left cell of the grid.
|
Sets the expand ratio of given column. Expand ratio defines how excess space is distributed among columns. Excess space means the space not consumed by non relatively sized components. By default excess space is distributed evenly. Note, that width needs to be defined for this method to have any effect. See Also: setWidth |
Returns the expand ratio of given column
See Also: setColumnExpandRatio |
Sets the expand ratio of given row. Expand ratio defines how excess space is distributed among rows. Excess space means the space not consumed by non relatively sized components. By default excess space is distributed evenly. Note, that height needs to be defined for this method to have any effect. See Also: setHeight |
Returns the expand ratio of given row.
See Also: setRowExpandRatio |
Gets the Component at given index.
|
Returns information about the area where given component is layed in the GridLayout.
|
Registers a new (generic) component event listener for the component: class Listening(CustomComponent, IListener): # Stored for determining the source of an event ok = None status = None # For displaying info about the event def __init__(self): layout = VerticalLayout() # Some miscellaneous component name = TextField("Say it all here") name.addListener(self) name.setImmediate(true) layout.addComponent(name) # Handle button clicks as generic events instead # of Button.ClickEvent events ok = new Button("OK") ok.addListener(self) layout.addComponent(ok) # For displaying information about an event status = new Label("") layout.addComponent(status) setCompositionRoot(layout) def componentEvent(event): # Act according to the source of the event if (event.getSource() == ok): getWindow().showNotification("Click!") status.setValue("Event from " + event.getSource().__class__.__name__ + ": " + event.__class__.__name__) listening = Listening() layout.addComponent(listening)
|
|
Removes a previously registered component event listener from this component.
|
|
|
_ALIGNMENT_DEFAULT
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jul 6 19:32:56 2013 | http://epydoc.sourceforge.net |