wxtextattrwxtextattr represents the character and paragraph attributes, or style, for a range of text in a wxtextctrl. when setting up a wxtextattr object, pass a bitlist mask to setflags to indicate which style elements should be changed. as a convenience, when you call a setter such as setfont, the relevant bit will be set. derived from no base class include files <wx/textctrl.h> typedefs wxtextpos is the type containing the index of a position in a text control. wxtextcoord contains the index of a column or a row in the control. note that although both of these types should probably have been unsigned, due to backwards compatibility reasons, are defined as long currently. their use (instead of plain long) is still encouraged as it makes the code more readable. constants the following values can be passed to setalignment to determine paragraph alignment.
these values are passed in a bitlist to setflags to determine what attributes will be considered when setting the attributes for a text control.
members
wxtextattr::wxtextattr
wxtextattr::wxtextattrwxtextattr() wxtextattr(const wxcolour& coltext, const wxcolour& colback = wxnullcolour, const wxfont& font = wxnullfont, wxtextattralignment alignment = wxtext_alignment_default) the constructors initialize one or more of the text foreground colour, background colour, font, and alignment. the values not initialized in the constructor can be set later, otherwise wxtextctrl::setstyle will use the default values for them.
wxtextattr::getalignmentwxtextattralignment getalignment() const returns the paragraph alignment.
wxtextattr::getbackgroundcolourconst wxcolour& getbackgroundcolour() const return the background colour specified by this attribute.
wxtextattr::getfontconst wxfont& getfont() const return the text font specified by this attribute.
wxtextattr::getleftindentint getleftindent() const returns the left indent in tenths of a millimetre.
wxtextattr::getleftsubindentint getleftsubindent() const returns the left sub indent for all lines but the first line in a paragraph in tenths of a millimetre.
wxtextattr::getrightindentint getrightindent() const returns the right indent in tenths of a millimetre.
wxtextattr::gettabsconst wxarrayint& gettabs() const returns the array of integers representing the tab stops. each array element specifies the tab stop in tenths of a millimetre.
wxtextattr::gettextcolourconst wxcolour& gettextcolour() const return the text colour specified by this attribute.
wxtextattr::hasalignmentbool hasalignment() const returns true if this style specifies the text alignment.
wxtextattr::hasbackgroundcolourbool hasbackgroundcolour() const returns true if this style specifies the background colour to use.
wxtextattr::hasfontbool hasfont() const returns true if this style specifies the font to use.
wxtextattr::hasleftindentbool hasleftindent() const returns true if this style specifies the left indent.
wxtextattr::hasrightindentbool hasrightindent() const returns true if this style specifies the right indent.
wxtextattr::hastabsbool hastabs() const returns true if this style specifies any tabstobs.
wxtextattr::hastextcolourbool hastextcolour() const returns true if this style specifies the foreground colour to use.
wxtextattr::getflagslong getflags() returns a bitlist indicating which attributes will be set.
wxtextattr::isdefaultbool isdefault() const returns true if this style specifies any non-default attributes.
wxtextattr::mergevoid merge(const wxtextattr& overlay) copies all defined/valid properties from overlay to current object. static wxtextattr merge(const wxtextattr& base, const wxtextattr& overlay) creates a new wxtextattr which is a merge of base and overlay. properties defined in overlay take precedence over those in base. properties undefined/invalid in both are undefined in the result.
wxtextattr::setalignmentvoid setalignment(wxtextattralignment alignment) sets the paragraph alignment.
wxtextattr::setbackgroundcolourvoid setbackgroundcolour(const wxcolour& colour) sets the background colour.
wxtextattr::setflagsvoid setflags(long flags) pass a bitlist indicating which attributes will be set.
wxtextattr::setfontvoid setfont(const wxfont& font) sets the text font.
wxtextattr::setleftindentvoid setleftindent(int indent, int subindent = 0) sets the left indent in tenths of a millimetre. subindent sets the indent for all lines but the first line in a paragraph relative to the first line.
wxtextattr::setrightindentvoid setrightindent(int indent) sets the right indent in tenths of a millimetre.
wxtextattr::settabsvoid settabs(const wxarrayint& tabs) sets the array of integers representing the tab stops. each array element specifies the tab stop in tenths of a millimetre.
wxtextattr::settextcolourvoid settextcolour(const wxcolour& colour) sets the text colour.
|