Btk
Btk::Widget Class Referenceabstract
Inheritance diagram for Btk::Widget:
Collaboration diagram for Btk::Widget:

Public Member Functions

 Widget ()
 Construct a new Widget object. More...
 
 Widget (Container *parent)
 
 Widget (Container &parent)
 
 Widget (const Widget &)=delete
 
virtual void draw (Renderer &render)=0
 
virtual bool handle (Event &)
 Process event. More...
 
bool visible () const noexcept
 
Vec2 position () const noexcept
 
Window & master () const
 Return The widget's master. More...
 
void set_rect (const Rect &rect)
 
void set_rect (int x, int y, int w, int h)
 
void set_position (const Vec2 &vec2)
 
int x () const noexcept
 
int y () const noexcept
 
int w () const noexcept
 
int h () const noexcept
 
bool is_enable () const noexcept
 
- Public Member Functions inherited from Btk::HasSlots
 HasSlots (const HasSlots &)=delete
 
void disconnect_all ()
 

Protected Member Functions

void redraw ()
 Send a redraw request to the window. More...
 
WindowImpl * window () const noexcept
 Get current window. More...
 

Protected Attributes

WidgetAttr attr
 
Rect rect
 
Container * parent
 

Friends

class Window
 
class Layout
 
struct WindowImpl
 
class Container
 
void PushEvent (Event *, Widget &)
 

Additional Inherited Members

- Public Attributes inherited from Btk::HasSlots
std::list< Connection > _connections
 

Constructor & Destructor Documentation

◆ Widget()

Btk::Widget::Widget ( )
inline

Construct a new Widget object.

Note
All data will be inited to 0

Member Function Documentation

◆ handle()

bool Btk::Widget::handle ( Event &  ev)
virtual

Process event.

Returns
true if widget processed it
false if widget unprocessed it

Reimplemented in Btk::Canvas, Btk::TextBox, Btk::AbstructButton, and Btk::Layout.

◆ master()

Window & Btk::Widget::master ( ) const

Return The widget's master.

Returns
Window ref

◆ redraw()

void Btk::Widget::redraw ( )
protected

Send a redraw request to the window.

◆ window()

WindowImpl* Btk::Widget::window ( ) const
inlineprotectednoexcept

Get current window.

Returns
WindowImpl*

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