Clapkit
Loading...
Searching...
No Matches
CKLabel Class Reference

Defines a text label. More...

#include <ckLabel.h>

Inheritance diagram for CKLabel:
CKControl CKTextableControl CKObject CKTextField CKTextArea

Public Member Functions

 CKLabel (const CKControlInitParams &params)
 
virtual ~CKLabel ()
 
virtual void AddedToWindow (CKWindow *window)
 
virtual void RemovedFromWindow ()
 
virtual void PrepareForDraw ()
 
virtual void Redraw ()
 
virtual void SetText (const char *text)
 
virtual const char * GetText ()
 
void AutoHeight (int maxHeight=0)
 Increase the height until it fits.
 
void SetFont (short fontId)
 
short GetFont ()
 
void DoTEIdle ()
 
virtual void RaisePropertyChange (const char *propertyName)
 
- Public Member Functions inherited from CKControl
 CKControl (const CKControlInitParams &params, CKControlType type=CKControlType::Unknown)
 
virtual ~CKControl ()
 
virtual void MarkAsDirty ()
 
- Public Member Functions inherited from CKObject
 CKObject ()
 
virtual ~CKObject ()
 
virtual void AddHandler (CKEventType type, CKEventHandlerFunc cb)
 
virtual void RemoveHandler (CKEventType type)
 
virtual bool HasHandler (CKEventType type) const
 
virtual bool HandleEvent (const CKEvent &evt)
 
virtual void SetPropertyObserver (CKPropertyObserverFunc cb)
 
virtual void UnsetPropertyObserver ()
 
- Public Member Functions inherited from CKTextableControl
 CKTextableControl ()
 
virtual ~CKTextableControl ()
 

Public Attributes

CKProperty< bool > bold = false
 
CKProperty< bool > italic = false
 
CKProperty< bool > underline = false
 
CKProperty< bool > multiline = false
 
CKProperty< CKColorcolor
 
CKProperty< int > fontSize
 
CKProperty< CKTextJustificationjustification
 
- Public Attributes inherited from CKControl
CKProperty< CKWindow * > owner = nullptr
 
CKProperty< CKRectrect
 
CKProperty< bool > enabled = true
 
CKProperty< bool > visible
 

Protected Member Functions

virtual void TECreated ()
 
virtual void ResizeTE ()
 

Protected Attributes

short __fontNumber
 
TEHandle __teHandle = nullptr
 
char * __tempTextStorage = nullptr
 
bool __needsPreparing = true
 
- Protected Attributes inherited from CKObject
std::map< CKEventType, CKEventHandlerFunc__handlers
 
CKPropertyObserverFunc propertyObserverCB = nullptr
 
- Protected Attributes inherited from CKTextableControl
char * __text
 

Detailed Description

Defines a text label.

Constructor & Destructor Documentation

◆ CKLabel()

CKLabel::CKLabel ( const CKControlInitParams params)

◆ ~CKLabel()

CKLabel::~CKLabel ( )
virtual

Member Function Documentation

◆ AddedToWindow()

void CKLabel::AddedToWindow ( CKWindow window)
virtual

Called by CKApp when the control has been added to a window.

Reimplemented from CKControl.

◆ AutoHeight()

void CKLabel::AutoHeight ( int  maxHeight = 0)

Increase the height until it fits.

Parameters
maxHeightIf set to non-zero value, will limit maximum height.

◆ DoTEIdle()

void CKLabel::DoTEIdle ( )
inline

◆ GetFont()

short CKLabel::GetFont ( )

◆ GetText()

const char * CKLabel::GetText ( )
virtual

Reimplemented from CKTextableControl.

◆ PrepareForDraw()

void CKLabel::PrepareForDraw ( )
virtual

Reimplemented in CKTextArea, and CKTextField.

◆ RaisePropertyChange()

void CKLabel::RaisePropertyChange ( const char *  propertyName)
virtual

Reimplemented from CKControl.

Reimplemented in CKTextArea.

◆ Redraw()

void CKLabel::Redraw ( )
virtual

Called by CKApp when the control needs to (re-)draw itself, usually due to an event like mouseDown or updateEvt.

YOU MOST LIKELY DO NOT NEED TO CALL THIS. USE MarkAsDirty!

Reimplemented from CKControl.

Reimplemented in CKTextArea, and CKTextField.

◆ RemovedFromWindow()

void CKLabel::RemovedFromWindow ( )
virtual

Called by CKApp when the control has been removed from a window.

Reimplemented from CKControl.

◆ ResizeTE()

void CKLabel::ResizeTE ( )
protectedvirtual

Reimplemented in CKTextArea.

◆ SetFont()

void CKLabel::SetFont ( short  fontId)

◆ SetText()

void CKLabel::SetText ( const char *  text)
virtual

Reimplemented from CKTextableControl.

◆ TECreated()

void CKLabel::TECreated ( )
protectedvirtual

Reimplemented in CKTextArea, and CKTextField.

Member Data Documentation

◆ __fontNumber

short CKLabel::__fontNumber
protected

◆ __needsPreparing

bool CKLabel::__needsPreparing = true
protected

◆ __teHandle

TEHandle CKLabel::__teHandle = nullptr
protected

◆ __tempTextStorage

char* CKLabel::__tempTextStorage = nullptr
protected

◆ bold

CKProperty<bool> CKLabel::bold = false

◆ color

CKProperty<CKColor> CKLabel::color

◆ fontSize

CKProperty<int> CKLabel::fontSize

◆ italic

CKProperty<bool> CKLabel::italic = false

◆ justification

CKProperty<CKTextJustification> CKLabel::justification

◆ multiline

CKProperty<bool> CKLabel::multiline = false

◆ underline

CKProperty<bool> CKLabel::underline = false

The documentation for this class was generated from the following files: