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

Defines a drawable canvas. More...

#include <ckCanvas.h>

Inheritance diagram for CKCanvas:
CKControl CKObject

Public Member Functions

 CKCanvas (const CKControlInitParams &params)
 
virtual ~CKCanvas ()
 
virtual void Redraw ()
 
const GWorldPtr GetOSPointer ()
 
void Clear ()
 
void FillRect (CKRect rect, CKColor c)
 
void Fill (CKColor c)
 
void SetPixel (CKPoint p, CKColor c)
 
void DrawLine (CKPoint start, CKPoint end, CKColor c)
 
bool DrawResourceIcon (short resourceId, CKPoint where)
 
- Public Member Functions inherited from CKControl
 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 ()
 

Additional Inherited Members

- Public Attributes inherited from CKControl
CKProperty< CKWindow * > owner = nullptr
 
CKProperty< CKRectrect
 
CKProperty< bool > enabled = true
 
CKProperty< bool > visible
 
- Protected Attributes inherited from CKObject
std::map< CKEventType, CKEventHandlerFunc__handlers
 
CKPropertyObserverFunc propertyObserverCB = nullptr
 

Detailed Description

Defines a drawable canvas.

Constructor & Destructor Documentation

◆ CKCanvas()

CKCanvas::CKCanvas ( const CKControlInitParams params)

◆ ~CKCanvas()

CKCanvas::~CKCanvas ( )
virtual

Member Function Documentation

◆ Clear()

void CKCanvas::Clear ( )

◆ DrawLine()

void CKCanvas::DrawLine ( CKPoint  start,
CKPoint  end,
CKColor  c 
)

◆ DrawResourceIcon()

bool CKCanvas::DrawResourceIcon ( short  resourceId,
CKPoint  where 
)

◆ Fill()

void CKCanvas::Fill ( CKColor  c)

◆ FillRect()

void CKCanvas::FillRect ( CKRect  rect,
CKColor  c 
)

◆ GetOSPointer()

const GWorldPtr CKCanvas::GetOSPointer ( )

◆ Redraw()

void CKCanvas::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.

◆ SetPixel()

void CKCanvas::SetPixel ( CKPoint  p,
CKColor  c 
)

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