Btk
Btk::Button Class Reference

A simple pushbutton. More...

#include <button.hpp>

Inheritance diagram for Btk::Button:
Collaboration diagram for Btk::Button:

Public Member Functions

 Button (Container &)
 
 Button (Container &, std::string_view text)
 
 Button (Container &, int x, int y, int w, int h)
 
void draw (Renderer &)
 
template<class ... T>
void on_click (T &&...args)
 
Signal< void()> & sig_click ()
 
void set_text (std::string_view text)
 
- Public Member Functions inherited from Btk::AbstructButton
bool handle (Event &)
 Process event. More...
 
- Public Member Functions inherited from Btk::Widget
 Widget ()
 Construct a new Widget object. More...
 
 Widget (Container *parent)
 
 Widget (Container &parent)
 
 Widget (const Widget &)=delete
 
bool visible () const noexcept
 
Vec2 position () const noexcept
 
Windowmaster () 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 onclick (const MouseEvent &)
 
void onleave ()
 
- Protected Member Functions inherited from Btk::AbstructButton
virtual void onenter ()
 
- Protected Member Functions inherited from Btk::Widget
void redraw ()
 Send a redraw request to the window. More...
 
WindowImplwindow () const noexcept
 Get current window. More...
 

Protected Attributes

Signal< void()> clicked
 
std::string btext
 
PixBuf textbuf
 
Texture texture
 
Font textfont
 
- Protected Attributes inherited from Btk::AbstructButton
bool is_entered
 
bool is_pressed
 
Themetheme
 
- Protected Attributes inherited from Btk::Widget
WidgetAttr attr
 
Rect rect
 
Containerparent
 

Additional Inherited Members

- Public Attributes inherited from Btk::HasSlots
std::list< Connection_connections
 

Detailed Description

A simple pushbutton.


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