The SizerItem class is used to track the position, size and other attributes of each item managed by a Sizer.
It is not usually necessary to use this class because the sizer elements can also be identified by their positions or window or sizer pointers but sometimes it may be more convenient to use it directly.
__init__ | Construct a sizer item for tracking a window. |
AssignSizer | Set the sizer tracked by this item. |
AssignSpacer | Set the size of the spacer tracked by this item. |
AssignWindow | Set the window to be tracked by this item. |
CalcMin | Calculates the minimum desired size for the item, including any space needed by borders. |
DeleteWindows | Destroy the window or the windows in a subsizer, depending on the type of item. |
DetachSizer | Enable deleting the SizerItem without destroying the contained sizer. |
GetBorder | Return the border attribute. |
GetFlag | Return the flags attribute. |
GetId | Return the numeric id of SizerItem, or ID_NONE if the id has not been set. |
GetMinSize | Get the minimum size needed for the item. |
GetPosition | What is the current position of the item, as set in the last Layout. |
GetProportion | Get the proportion item attribute. |
GetRatio | Get the ration item attribute. |
GetRect | Get the rectangle of the item on the parent window, excluding borders. |
GetSize | Get the current size of the item, as set in the last Layout. |
GetSizer | If this item is tracking a sizer, return it. |
GetSpacer | If this item is tracking a spacer, return its size. |
GetUserData | Get the userData item attribute. |
GetWindow | If this item is tracking a window then return it. |
IsShown | Returns True if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden. |
IsSizer | Is this item a sizer? |
IsSpacer | Is this item a spacer? |
IsWindow | Is this item a window? |
SetBorder | Set the border item attribute. |
SetDimension | Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account. |
SetFlag | Set the flag item attribute. |
SetId | Sets the numeric id of the SizerItem to id. |
SetInitSize | |
SetMinSize | Sets the minimum size to be allocated for this item. |
SetProportion | Set the proportion item attribute. |
SetRatio | Set the ratio item attribute. |
SetUserData | |
Show | Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not. |
Border | See GetBorder and SetBorder |
Flag | See GetFlag and SetFlag |
Id | See GetId and SetId |
MinSize | See GetMinSize and SetMinSize |
Position | See GetPosition |
Proportion | See GetProportion and SetProportion |
Ratio | See GetRatio and SetRatio |
Rect | See GetRect |
Size | See GetSize |
Sizer | See GetSizer |
Spacer | See GetSpacer |
UserData | See GetUserData and SetUserData |
Window | See GetWindow |
The SizerItem class is used to track the position, size and other attributes of each item managed by a Sizer.
Possible constructors:
SizerItem(window, flags)
SizerItem(window, proportion=0, flag=0, border=0, userData=None)
SizerItem(sizer, flags)
SizerItem(sizer, proportion=0, flag=0, border=0, userData=None)
SizerItem(width, height, proportion=0, flag=0, border=0, userData=None)
Overloaded Implementations:
__init__ (self, window, flags)
Construct a sizer item for tracking a window.
Parameters: |
|
---|
__init__ (self, window, proportion=0, flag=0, border=0, userData=None)
Construct a sizer item for tracking a window.
Parameters: |
|
---|
__init__ (self, sizer, flags)
Construct a sizer item for tracking a subsizer.
Parameters: |
|
---|
__init__ (self, sizer, proportion=0, flag=0, border=0, userData=None)
Construct a sizer item for tracking a subsizer.
Parameters: |
|
---|
__init__ (self, width, height, proportion=0, flag=0, border=0, userData=None)
Construct a sizer item for tracking a spacer.
Parameters: |
|
---|
Set the sizer tracked by this item.
Old sizer, if any, is deleted.
Parameters: | sizer (Sizer) – |
---|
Set the size of the spacer tracked by this item.
Old spacer, if any, is deleted.
Overloaded Implementations:
AssignSpacer (self, size)
Parameters: | size (Size) – |
---|
AssignSpacer (self, w, h)
Parameters: |
|
---|
Set the window to be tracked by this item.
The old window isn’t deleted as it is now owned by the sizer item.
Parameters: | window (Window) – |
---|
Calculates the minimum desired size for the item, including any space needed by borders.
Return type: | Size |
---|
Destroy the window or the windows in a subsizer, depending on the type of item.
Enable deleting the SizerItem without destroying the contained sizer.
Return the border attribute.
Return type: | int |
---|
Return the flags attribute.
See Sizer flags list for details.
Return type: | int |
---|
Return the numeric id of SizerItem, or ID_NONE if the id has not been set.
Return type: | int |
---|
What is the current position of the item, as set in the last Layout.
Return type: | Point |
---|
Get the proportion item attribute.
Return type: | int |
---|
Get the ration item attribute.
Return type: | float |
---|
Get the rectangle of the item on the parent window, excluding borders.
Return type: | Rect |
---|
Get the userData item attribute.
Return type: | PyUserData |
---|
If this item is tracking a window then return it.
None otherwise.
Return type: | Window |
---|
Returns True if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden.
In other words, for sizer items, all of the child elements must be hidden for the sizer itself to be considered hidden.
As an exception, if the RESERVE_SPACE_EVEN_IF_HIDDEN flag was used for this sizer item, then IsShown always returns True for it (see SizerFlags.ReserveSpaceEvenIfHidden ).
Return type: | bool |
---|
Is this item a sizer?
Return type: | bool |
---|
Is this item a spacer?
Return type: | bool |
---|
Is this item a window?
Return type: | bool |
---|
Set the border item attribute.
Parameters: | border (int) – |
---|
Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account.
Parameters: |
---|
Set the flag item attribute.
Parameters: | flag (int) – |
---|
Parameters: |
|
---|
Todo
docme.
Overloaded Implementations:
SetMinSize (self, size)
Sets the minimum size to be allocated for this item.
If this item is a window, the size is also passed to Window.SetMinSize .
Parameters: | size (Size) – |
---|
SetMinSize (self, x, y)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Parameters: |
|
---|
Set the proportion item attribute.
Parameters: | proportion (int) – |
---|
Set the ratio item attribute.
Overloaded Implementations:
SetRatio (self, width, height)
Parameters: |
|
---|
SetRatio (self, size)
Parameters: | size (Size) – |
---|
SetRatio (self, ratio)
Parameters: | ratio (float) – |
---|
Parameters: | userData (PyUserData) – |
---|
Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.
If the item is tracking a window then it is shown or hidden as needed.
Parameters: | show (bool) – |
---|
See GetMinSize and SetMinSize
See GetPosition
See GetProportion and SetProportion
See GetUserData and SetUserData