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

Defines the base of all UI Controls. More...

#include <ckControl.h>

Inheritance diagram for CKControl:
CKObject CKCanvas CKControlToolbox CKLabel CKButton CKCheckbox CKDropdown CKTextField CKRadiobox CKTextArea

Public Member Functions

 CKControl (const CKControlInitParams &params, CKControlType type=CKControlType::Unknown)
 
virtual ~CKControl ()
 
virtual void AddedToWindow (CKWindow *window)
 
virtual void RemovedFromWindow ()
 
virtual void MarkAsDirty ()
 
virtual void RaisePropertyChange (const char *propertyName)
 
- 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 Attributes

CKProperty< CKWindow * > owner = nullptr
 
CKProperty< CKRectrect
 
CKProperty< bool > enabled = true
 
CKProperty< bool > visible
 

Protected Member Functions

virtual void Redraw ()
 

Friends

class CKWindow
 

Additional Inherited Members

- Protected Attributes inherited from CKObject
std::map< CKEventType, CKEventHandlerFunc__handlers
 
CKPropertyObserverFunc propertyObserverCB = nullptr
 

Detailed Description

Defines the base of all UI Controls.

Constructor & Destructor Documentation

◆ CKControl()

CKControl::CKControl ( const CKControlInitParams params,
CKControlType  type = CKControlType::Unknown 
)

◆ ~CKControl()

CKControl::~CKControl ( )
virtual

Member Function Documentation

◆ AddedToWindow()

void CKControl::AddedToWindow ( CKWindow window)
virtual

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

Reimplemented in CKControlToolbox, CKDropdown, and CKLabel.

◆ MarkAsDirty()

void CKControl::MarkAsDirty ( )
virtual

Once changes are made to the control, we need to mark it or its area as dirty so it can it can be redrawn later. This function does this - call once you make changes.

◆ RaisePropertyChange()

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

Reimplemented from CKObject.

Reimplemented in CKControlToolbox, CKDropdown, CKLabel, and CKTextArea.

◆ Redraw()

void CKControl::Redraw ( )
protectedvirtual

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 in CKButton, CKCanvas, CKControlToolbox, CKLabel, CKTextArea, and CKTextField.

◆ RemovedFromWindow()

void CKControl::RemovedFromWindow ( )
virtual

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

Reimplemented in CKLabel.

Friends And Related Symbol Documentation

◆ CKWindow

friend class CKWindow
friend

Member Data Documentation

◆ enabled

CKProperty<bool> CKControl::enabled = true

◆ owner

CKProperty<CKWindow*> CKControl::owner = nullptr

◆ rect

CKProperty<CKRect> CKControl::rect

◆ visible

CKProperty<bool> CKControl::visible

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