8 #include "cparamdisplay.h" 9 #include "../cstring.h" 21 CTextLabel (
const CRect& size, UTF8StringPtr txt =
nullptr,
CBitmap* background =
nullptr,
const int32_t style = 0);
47 void drawStyleChanged ()
override;
54 void calculateTruncatedText ();
57 bool onWheel (
const CPoint& where,
const CMouseWheelAxis& axis,
const float& distance,
const CButtonState& buttons)
override {
return false; }
80 LineLayout getLineLayout ()
const {
return lineLayout; }
97 void setValue (
float val)
override;
99 void drawStyleChanged ()
override;
101 void recalculateHeight ();
103 bool autoHeight {
false};
111 using Lines = std::vector<Line>;
no characters will be removed
Definition: ctextlabel.h:32
Rect structure.
Definition: crect.h:17
LineLayout
Definition: ctextlabel.h:74
a text label
Definition: ctextlabel.h:18
virtual void setTextTruncateMode(TextTruncateMode mode)
set text truncate mode
Definition: ctextlabel.cpp:55
void draw(CDrawContext *pContext) override
called if the view should draw itself
Definition: ctextlabel.cpp:91
characters will be removed from the beginning of the text
Definition: ctextlabel.h:33
virtual const UTF8String & getText() const
read only access to text
Definition: ctextlabel.cpp:85
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
Definition: ctextlabel.h:68
void valueChanged() override
notifies listener and dependent objects
Definition: ctextlabel.cpp:138
CCoord getMaxLineWidth()
Definition: ctextlabel.cpp:197
clip lines overflowing the view size width
Encapsulates various platform depended kinds of bitmaps.
Definition: cbitmap.h:21
Definition: customcontrols.cpp:8
bool onWheel(const CPoint &where, const CMouseWheelAxis &axis, const float &distance, const CButtonState &buttons) override
called if a mouse wheel event is happening over this view
Definition: ctextlabel.h:57
void setViewSize(const CRect &rect, bool invalid=true) override
set views size
Definition: ctextlabel.cpp:290
virtual void setText(const UTF8String &txt)
set text
Definition: ctextlabel.cpp:44
bool sizeToFit() override
resize view to optimal size
Definition: ctextlabel.cpp:256
bool sizeToFit() override
resize view to optimal size
Definition: ctextlabel.cpp:99
truncate lines overflowing the view size width
void setViewSize(const CRect &rect, bool invalid=true) override
set views size
Definition: ctextlabel.cpp:117
bool getAutoHeight() const
Definition: ctextlabel.h:87
void drawRect(CDrawContext *pContext, const CRect &updateRect) override
called if the view should draw itself
Definition: ctextlabel.cpp:211
void setText(const UTF8String &txt) override
set text
Definition: ctextlabel.cpp:262
const UTF8String & getTruncatedText() const
get the truncated text
Definition: ctextlabel.h:39
TextTruncateMode
Definition: ctextlabel.h:31
holds an UTF8 encoded string and a platform representation of it
Definition: cstring.h:56
bool onWheel(const CPoint &where, const float &distance, const CButtonState &buttons) override
called if a mouse wheel event is happening over this view
Definition: ctextlabel.h:56
virtual void invalid()
mark whole view as invalid
Definition: cview.h:63
TextTruncateMode getTextTruncateMode() const
get text truncate mode
Definition: ctextlabel.h:38
Point structure.
Definition: cpoint.h:17
characters will be removed from the end of the text
Definition: ctextlabel.h:34
CTextLabel(const CRect &size, UTF8StringPtr txt=nullptr, CBitmap *background=nullptr, const int32_t style=0)
Definition: ctextlabel.cpp:28
a parameter display
Definition: cparamdisplay.h:24
void setTextTruncateMode(TextTruncateMode mode) override
set text truncate mode
Definition: ctextlabel.cpp:171
wrap overflowing words to next line
static IdStringPtr kMsgTruncatedTextChanged
message which is send to dependent objects when the truncated text changes
Definition: ctextlabel.h:42
void setAutoHeight(bool state)
Definition: ctextlabel.cpp:187