]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxStaticText}}\label{wxstatictext} |
2 | ||
3 | A static text control displays one or more lines of read-only text. | |
4 | ||
a660d684 KB |
5 | \wxheading{Derived from} |
6 | ||
7 | \helpref{wxControl}{wxcontrol}\\ | |
8 | \helpref{wxWindow}{wxwindow}\\ | |
9 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
10 | \helpref{wxObject}{wxobject} | |
11 | ||
954b8ae6 JS |
12 | \wxheading{Include files} |
13 | ||
14 | <wx/stattext.h> | |
15 | ||
a660d684 KB |
16 | \wxheading{Window styles} |
17 | ||
717a57c2 VZ |
18 | \twocolwidtha{5cm} |
19 | \begin{twocollist}\itemsep=0pt | |
20 | \twocolitem{\windowstyle{wxALIGN\_LEFT}}{Align the text to the left} | |
21 | \twocolitem{\windowstyle{wxALIGN\_RIGHT}}{Align the text to the right} | |
22 | \twocolitem{\windowstyle{wxALIGN\_CENTRE}}{Center the text (horisontally)} | |
23 | \twocolitem{\windowstyle{wxST\_NO\_AUTORESIZE}}{By default, the control will | |
24 | adjust its size to exactly fit to the size of the text when | |
25 | \helpref{SetLabel}{wxstatictextsetlabel} is called. If this style flag is | |
26 | given, the control will not change its size (this style is especially useful | |
27 | with controls which also have wxALIGN\_RIGHT or CENTER style because otherwise | |
28 | they won't make sense any longer after a call to SetLabel)} | |
29 | \end{twocollist} | |
a660d684 KB |
30 | |
31 | See also \helpref{window styles overview}{windowstyles}. | |
32 | ||
33 | \wxheading{See also} | |
34 | ||
35 | \helpref{wxStaticBitmap}{wxstaticbitmap}, \helpref{wxStaticBox}{wxstaticbox} | |
36 | ||
37 | \latexignore{\rtfignore{\wxheading{Members}}} | |
38 | ||
39 | \membersection{wxStaticText::wxStaticText}\label{wxstatictextconstr} | |
40 | ||
41 | \func{}{wxStaticText}{\void} | |
42 | ||
43 | Default constructor. | |
44 | ||
eaaa6a06 | 45 | \func{}{wxStaticText}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp |
f6bcfd97 | 46 | \param{const wxString\& }{label}, \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 47 | \param{long}{ style = 0}, \param{const wxString\& }{name = ``staticText"}} |
a660d684 KB |
48 | |
49 | Constructor, creating and showing a text control. | |
50 | ||
51 | \wxheading{Parameters} | |
52 | ||
53 | \docparam{parent}{Parent window. Should not be NULL.} | |
54 | ||
55 | \docparam{id}{Control identifier. A value of -1 denotes a default value.} | |
56 | ||
57 | \docparam{label}{Text label.} | |
58 | ||
59 | \docparam{pos}{Window position.} | |
60 | ||
61 | \docparam{size}{Window size.} | |
62 | ||
63 | \docparam{style}{Window style. See \helpref{wxStaticText}{wxstatictext}.} | |
64 | ||
65 | \docparam{name}{Window name.} | |
66 | ||
67 | \wxheading{See also} | |
68 | ||
69 | \helpref{wxStaticText::Create}{wxstatictextcreate} | |
70 | ||
71 | \membersection{wxStaticText::Create}\label{wxstatictextcreate} | |
72 | ||
eaaa6a06 | 73 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp |
f6bcfd97 | 74 | \param{const wxString\& }{label}, \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 75 | \param{long}{ style = 0}, \param{const wxString\& }{name = ``staticText"}} |
a660d684 KB |
76 | |
77 | Creation function, for two-step construction. For details see \helpref{wxStaticText::wxStaticText}{wxstatictextconstr}. | |
78 | ||
79 | \membersection{wxStaticText::GetLabel}\label{wxstatictextgetlabel} | |
80 | ||
81 | \constfunc{wxString}{GetLabel}{\void} | |
82 | ||
83 | Returns the contents of the control. | |
84 | ||
85 | \membersection{wxStaticText::SetLabel}\label{wxstatictextsetlabel} | |
86 | ||
87 | \func{virtual void}{SetLabel}{\param{const wxString\& }{ label}} | |
88 | ||
717a57c2 VZ |
89 | Sets the static text label and updates the controls size to exactly fit the |
90 | label unless the control has wxST\_NO\_AUTORESIZE flag. | |
a660d684 KB |
91 | |
92 | \wxheading{Parameters} | |
93 | ||
94 | \docparam{label}{The new label to set. It may contain newline characters.} | |
95 |