Version: 2.9.4
Public Member Functions
wxStaticText Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/stattext.h>

Inheritance diagram for wxStaticText:

Detailed Description

A static text control displays one or more lines of read-only text.

wxStaticText supports the three classic text alignments, label ellipsization i.e. replacing parts of the text with the ellipsis ("...") if the label doesn't fit into the provided space and also formatting markup with wxControl::SetLabelMarkup().

Styles

This class supports the following styles:

Library:  wxCore
Category:  Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
参照:
wxStaticBitmap, wxStaticBox

Public Member Functions

 wxStaticText ()
 Default constructor.
 wxStaticText (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxStaticTextNameStr)
 Constructor, creating and showing a text control.
bool Create (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxStaticTextNameStr)
 Creation function, for two-step construction.
bool IsEllipsized () const
 Returns true if the window styles for this control contains one of the wxST_ELLIPSIZE_START, wxST_ELLIPSIZE_MIDDLE or wxST_ELLIPSIZE_END styles.
void Wrap (int width)
 This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long).

List of all members.


Constructor & Destructor Documentation

wxStaticText::wxStaticText ( )

Default constructor.

wxStaticText::wxStaticText ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxString name = wxStaticTextNameStr 
)

Constructor, creating and showing a text control.

Parameters:
parentParent window. Should not be NULL.
idControl identifier. A value of -1 denotes a default value.
labelText label.
posWindow position.
sizeWindow size.
styleWindow style. See wxStaticText.
nameWindow name.
参照:
Create()

Member Function Documentation

bool wxStaticText::Create ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxString name = wxStaticTextNameStr 
)

Creation function, for two-step construction.

For details see wxStaticText().

bool wxStaticText::IsEllipsized ( ) const

Returns true if the window styles for this control contains one of the wxST_ELLIPSIZE_START, wxST_ELLIPSIZE_MIDDLE or wxST_ELLIPSIZE_END styles.

void wxStaticText::Wrap ( int  width)

This functions wraps the controls label so that each of its lines becomes at most 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 width is negative, no wrapping is done. Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the controls border style) may be added.

Since:
2.6.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines