.TH wxSizerItem 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxSizerItem \- Functions for wxSizerItem class .SH DESCRIPTION .LP The \fIwxSizerItem\fR\& class is used to track the position, size and other attributes of each item managed by a \fIwxSizer\fR\&\&. .LP 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\&. .LP wxWidgets docs: wxSizerItem .SH DATA TYPES .nf \fBwxSizerItem()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B new(Window) -> wxSizerItem() .br .fi .br .RS .LP Types: .RS 3 Window = wxWindow:wxWindow() | wxSizer:wxSizer() .br .RE .RE .LP .nf .B new(Width, Height) -> wxSizerItem() .br .fi .br .nf .B new(Window, Flags) -> wxSizerItem() .br .fi .br .nf .B new(Window, Height :: [Option]) -> wxSizerItem() .br .fi .br .RS .LP Types: .RS 3 Window = wxWindow:wxWindow() | wxSizer:wxSizer() .br Option = .br {proportion, integer()} | .br {flag, integer()} | .br {border, integer()} | .br {userData, wx:wx_object()} .br .RE .RE .RS .RE .LP .nf .B new(Width, Height, Options :: [Option]) -> wxSizerItem() .br .fi .br .RS .LP Types: .RS 3 Width = Height = integer() .br Option = .br {proportion, integer()} | .br {flag, integer()} | .br {border, integer()} | .br {userData, wx:wx_object()} .br .RE .RE .RS .LP Construct a sizer item for tracking a spacer\&. .RE .LP .nf .B destroy(This :: wxSizerItem()) -> ok .br .fi .br .RS .LP Deletes the user data and subsizer, if any\&. .RE .LP .nf .B calcMin(This) -> {W :: integer(), H :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Calculates the minimum desired size for the item, including any space needed by borders\&. .RE .LP .nf .B deleteWindows(This) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Destroy the window or the windows in a subsizer, depending on the type of item\&. .RE .LP .nf .B detachSizer(This) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Enable deleting the SizerItem without destroying the contained sizer\&. .RE .LP .nf .B getBorder(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Return the border attribute\&. .RE .LP .nf .B getFlag(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Return the flags attribute\&. .LP See \fIwxSizer flags list\fR\& (not implemented in wx) for details\&. .RE .LP .nf .B getMinSize(This) -> {W :: integer(), H :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the minimum size needed for the item\&. .RE .LP .nf .B getPosition(This) -> {X :: integer(), Y :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP What is the current position of the item, as set in the last Layout\&. .RE .LP .nf .B getProportion(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the proportion item attribute\&. .RE .LP .nf .B getRatio(This) -> number() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the ratio item attribute\&. .RE .LP .nf .B getRect(This) -> .B {X :: integer(), .B Y :: integer(), .B W :: integer(), .B H :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the rectangle of the item on the parent window, excluding borders\&. .RE .LP .nf .B getSize(This) -> {W :: integer(), H :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the current size of the item, as set in the last Layout\&. .RE .LP .nf .B getSizer(This) -> wxSizer:wxSizer() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP If this item is tracking a sizer, return it\&. .LP NULL otherwise\&. .RE .LP .nf .B getSpacer(This) -> {W :: integer(), H :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP If this item is tracking a spacer, return its size\&. .RE .LP .nf .B getUserData(This) -> wx:wx_object() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Get the userData item attribute\&. .RE .LP .nf .B getWindow(This) -> wxWindow:wxWindow() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP If this item is tracking a window then return it\&. .LP NULL otherwise\&. .RE .LP .nf .B isSizer(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Is this item a sizer? .RE .LP .nf .B isShown(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP 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\&. .LP In other words, for sizer items, all of the child elements must be hidden for the sizer itself to be considered hidden\&. .LP As an exception, if the \fIwxRESERVE_SPACE_EVEN_IF_HIDDEN\fR\& flag was used for this sizer item, then \fIisShown/1\fR\& always returns true for it (see \fIwxSizerFlags::ReserveSpaceEvenIfHidden()\fR\& (not implemented in wx))\&. .RE .LP .nf .B isSpacer(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Is this item a spacer? .RE .LP .nf .B isWindow(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br .RE .RE .RS .LP Is this item a window? .RE .LP .nf .B setBorder(This, Border) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Border = integer() .br .RE .RE .RS .LP Set the border item attribute\&. .RE .LP .nf .B setDimension(This, Pos, Size) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Pos = {X :: integer(), Y :: integer()} .br Size = {W :: integer(), H :: integer()} .br .RE .RE .RS .LP 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\&. .RE .LP .nf .B setFlag(This, Flag) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Flag = integer() .br .RE .RE .RS .LP Set the flag item attribute\&. .RE .LP .nf .B setInitSize(This, X, Y) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br X = Y = integer() .br .RE .RE .RS .LP Sets the minimum size to be allocated for this item\&. .LP This is identical to \fIsetMinSize/3\fR\&, prefer to use the other function, as its name is more clear\&. .RE .LP .nf .B setMinSize(This, Size) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Size = {W :: integer(), H :: integer()} .br .RE .RE .RS .LP Sets the minimum size to be allocated for this item\&. .LP If this item is a window, the \fIsize\fR\& is also passed to \fIwxWindow:setMinSize/2\fR\&\&. .RE .LP .nf .B setMinSize(This, X, Y) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br X = Y = integer() .br .RE .RE .RS .LP This is an overloaded member function, provided for convenience\&. It differs from the above function only in what argument(s) it accepts\&. .RE .LP .nf .B setProportion(This, Proportion) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Proportion = integer() .br .RE .RE .RS .LP Set the proportion item attribute\&. .RE .LP .nf .B setRatio(This, Ratio) -> ok .br .fi .br .nf .B setRatio(This, Size) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Size = {W :: integer(), H :: integer()} .br .RE .RE .RS .RE .LP .nf .B setRatio(This, Width, Height) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Width = Height = integer() .br .RE .RE .RS .LP Set the ratio item attribute\&. .RE .LP .nf .B assignSizer(This, Sizer) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Sizer = wxSizer:wxSizer() .br .RE .RE .RS .LP Set the sizer tracked by this item\&. .LP Old sizer, if any, is deleted\&. .RE .LP .nf .B assignSpacer(This, Size) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Size = {W :: integer(), H :: integer()} .br .RE .RE .RS .LP Set the size of the spacer tracked by this item\&. .LP Old spacer, if any, is deleted\&. .RE .LP .nf .B assignSpacer(This, W, H) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br W = H = integer() .br .RE .RE .RS .RE .LP .nf .B assignWindow(This, Window) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Window = wxWindow:wxWindow() .br .RE .RE .RS .LP Set the window to be tracked by this item\&. .LP Note: This is a low-level method which is dangerous if used incorrectly, avoid using it if possible, i\&.e\&. if higher level methods such as \fIwxSizer:replace/4\fR\& can be used instead\&. .LP If the sizer item previously contained a window, it is dissociated from the sizer containing this sizer item (if any), but this object doesn\&'t have the pointer to the containing sizer and so it\&'s the caller\&'s responsibility to call \fIwxWindow:setContainingSizer/2\fR\& on \fIwindow\fR\&\&. Failure to do this can result in memory corruption when the window is destroyed later, so it is crucial to not forget to do it\&. .LP Also note that the previously contained window is \fInot\fR\& deleted, so it\&'s also the callers responsibility to do it, if necessary\&. .RE .LP .nf .B show(This, Show) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxSizerItem() .br Show = boolean() .br .RE .RE .RS .LP Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not\&. .LP If the item is tracking a window then it is shown or hidden as needed\&. .RE