added XRCSIZERITEM() allowing to directly retrieve the sizer from XRC by name (patch 1782080)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -274,6 +274,18 @@ Use parameter \arg{recursive} to search in subsizers too.
|
||||
|
||||
Returns pointer to item or NULL.
|
||||
|
||||
\membersection{wxSizer::GetItemById}\label{wxsizergetitembyid}
|
||||
|
||||
\func{wxSizerItem *}{GetItemById}{\param{int }{id}, \param{bool }{recursive = false}}
|
||||
|
||||
Finds item of the sizer which has the given \arg{id}. This \arg{id} is not the
|
||||
window id but the id of the wxSizerItem itself. This is mainly useful for
|
||||
retrieving the sizers created from XRC resources.
|
||||
|
||||
Use parameter \arg{recursive} to search in subsizers too.
|
||||
|
||||
Returns pointer to item or \NULL.
|
||||
|
||||
|
||||
\membersection{wxSizer::GetSize}\label{wxsizergetsize}
|
||||
|
||||
|
@@ -88,6 +88,13 @@ Return the border attribute.
|
||||
|
||||
Return the flags attribute.
|
||||
|
||||
\membersection{wxSizerItem::GetId}\label{wxsizeritemgetid}
|
||||
|
||||
\constfunc{int}{GetId}{\void}
|
||||
|
||||
Return the numeric id of wxSizerItem, or \texttt{wxID\_NONE} if the id has
|
||||
not been set.
|
||||
|
||||
|
||||
\membersection{wxSizerItem::GetMinSize}\label{wxsizeritemgetminsize}
|
||||
|
||||
@@ -205,6 +212,12 @@ taking alignment and borders into account.
|
||||
|
||||
Set the flag item attribute.
|
||||
|
||||
\membersection{wxSizerItem::SetId}\label{wxsizeritemSetId}
|
||||
|
||||
\func{void}{SetId}{\param{int}{id}}
|
||||
|
||||
Sets the numeric id of the wxSizerItem to \arg{id}.
|
||||
|
||||
|
||||
\membersection{wxSizerItem::SetInitSize}\label{wxsizeritemsetinitsize}
|
||||
|
||||
|
@@ -506,7 +506,22 @@ END_EVENT_TABLE()
|
||||
|
||||
\end{verbatim}
|
||||
|
||||
It is also possible to access the wxSizerItem of a sizer that is part of
|
||||
a resource. This can be done using {\tt XRCSIZERITEM} as shown. The
|
||||
resource file can have something like this for a sizer item.
|
||||
|
||||
\begin{verbatim}
|
||||
<object class="spacer" name="area">
|
||||
<size>400, 300</size>
|
||||
</object>
|
||||
\end{verbatim}
|
||||
|
||||
The code can then access the sizer item by using {\tt XRCSIZERITEM} and
|
||||
{\tt XRCID} together.
|
||||
|
||||
\begin{verbatim}
|
||||
wxSizerItem* item = XRCSIZERITEM(*this, XRCID("area"));
|
||||
\end{verbatim}
|
||||
|
||||
\subsection{Adding new resource handlers}\label{newresourcehandlers}
|
||||
|
||||
|
Reference in New Issue
Block a user