X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36b3b54ad8431bca0fa53fa8acae5ba6d4c3e9c7..11ef729d54ee338a1d569b5a238c2feb84d488ff:/docs/latex/wx/stattext.tex diff --git a/docs/latex/wx/stattext.tex b/docs/latex/wx/stattext.tex index 20854fadcd..82ea780b8e 100644 --- a/docs/latex/wx/stattext.tex +++ b/docs/latex/wx/stattext.tex @@ -2,10 +2,6 @@ A static text control displays one or more lines of read-only text. -TODO: should a static text have a validator? E.g. if you wanted -to use it to initialise the control with some text taken from -the validator. - \wxheading{Derived from} \helpref{wxControl}{wxcontrol}\\ @@ -13,9 +9,24 @@ the validator. \helpref{wxEvtHandler}{wxevthandler}\\ \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Window styles} -There are no special styles for this control. +\twocolwidtha{5cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{\windowstyle{wxALIGN\_LEFT}}{Align the text to the left} +\twocolitem{\windowstyle{wxALIGN\_RIGHT}}{Align the text to the right} +\twocolitem{\windowstyle{wxALIGN\_CENTRE}}{Center the text (horizontally)} +\twocolitem{\windowstyle{wxST\_NO\_AUTORESIZE}}{By default, the control will +adjust its size to exactly fit to the size of the text when +\helpref{SetLabel}{wxstatictextsetlabel} is called. If this style flag is +given, the control will not change its size (this style is especially useful +with controls which also have wxALIGN\_RIGHT or CENTER style because otherwise +they won't make sense any longer after a call to SetLabel)} +\end{twocollist} See also \helpref{window styles overview}{windowstyles}. @@ -25,6 +36,7 @@ See also \helpref{window styles overview}{windowstyles}. \latexignore{\rtfignore{\wxheading{Members}}} + \membersection{wxStaticText::wxStaticText}\label{wxstatictextconstr} \func{}{wxStaticText}{\void} @@ -32,7 +44,7 @@ See also \helpref{window styles overview}{windowstyles}. Default constructor. \func{}{wxStaticText}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp -\param{const wxString\& }{label = ``"}, \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp +\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp \param{long}{ style = 0}, \param{const wxString\& }{name = ``staticText"}} Constructor, creating and showing a text control. @@ -57,28 +69,43 @@ Constructor, creating and showing a text control. \helpref{wxStaticText::Create}{wxstatictextcreate} + \membersection{wxStaticText::Create}\label{wxstatictextcreate} \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp -\param{const wxString\& }{label = ``"}, \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp +\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp \param{long}{ style = 0}, \param{const wxString\& }{name = ``staticText"}} Creation function, for two-step construction. For details see \helpref{wxStaticText::wxStaticText}{wxstatictextconstr}. + \membersection{wxStaticText::GetLabel}\label{wxstatictextgetlabel} \constfunc{wxString}{GetLabel}{\void} Returns the contents of the control. + \membersection{wxStaticText::SetLabel}\label{wxstatictextsetlabel} \func{virtual void}{SetLabel}{\param{const wxString\& }{ label}} -Sets the static text label. +Sets the static text label and updates the controls size to exactly fit the +label unless the control has wxST\_NO\_AUTORESIZE flag. \wxheading{Parameters} \docparam{label}{The new label to set. It may contain newline characters.} +\membersection{wxStaticText::Wrap}\label{wxstatictextwrpa} + +\func{void}{Wrap}{\param{int }{width}} + +This functions wraps the controls label so that each of its lines becomes at +most \arg{width} pixels wide if possible (the lines are broken at words +boundaries so it might not be the case if words are too long). If \arg{width} +is negative, no wrapping is done. + +\newsince{2.6.2} +