bWidgets
Core widget toolkit designed for Blender
bWidgets::bwAbstractButton Class Reference

Base class for button like widgets. More...

#include <bwAbstractButton.h>

+ Inheritance diagram for bWidgets::bwAbstractButton:
+ Collaboration diagram for bWidgets::bwAbstractButton:

Public Member Functions

void draw (class bwStyle &style) override
 
void registerProperties () override
 
auto getLabel () const -> const std::string *override
 
auto setLabel (const std::string &label) -> bwAbstractButton &
 
virtual auto getIcon () const -> const bwIconInterface *
 
auto createHandler () -> std::unique_ptr< bwScreenGraph::EventHandler > override
 
- Public Member Functions inherited from bWidgets::bwWidget
 bwWidget (std::optional< unsigned int > width_hint, std::optional< unsigned int > height_hint)
 
virtual ~bwWidget ()=default
 
 bwWidget ()=delete
 
 bwWidget (const bwWidget &)=delete
 
 bwWidget (bwWidget &&)=delete
 
auto operator= (const bwWidget &)=delete
 
auto operator= (bwWidget &&)=delete
 
auto getState () const -> State
 
auto setState (State) -> bwWidget &
 
auto hide (bool _hidden=true) -> bwWidget &
 
auto isHidden () -> bool
 
virtual auto getTypeIdentifier () const -> std::string_view=0
 
virtual void draw (bwStyle &style)=0
 
virtual auto isCoordinateInside (const bwPoint &point) const -> bool
 
virtual auto getLabel () const -> const std::string *
 
virtual auto canAlign () const -> bool
 
virtual auto createHandler () -> std::unique_ptr< bwScreenGraph::EventHandler >=0
 

Public Attributes

std::unique_ptr< bwFunctorInterfaceapply_functor {nullptr}
 
unsigned int rounded_corners
 
bwWidgetBaseStyle base_style
 
- Public Attributes inherited from bWidgets::bwWidget
bwRectanglePixel rectangle
 
unsigned int width_hint
 
unsigned int height_hint
 
bwStyleProperties style_properties
 

Protected Member Functions

 bwAbstractButton (const std::string &text, std::optional< unsigned int > width_hint=std::nullopt, std::optional< unsigned int > height_hint=std::nullopt)
 
void apply ()
 
- Protected Member Functions inherited from bWidgets::bwWidget
void initialize ()
 Additional initialization that can't be done in bwWidget constructor. More...
 
virtual void registerProperties ()
 

Protected Attributes

std::string text
 

Additional Inherited Members

- Public Types inherited from bWidgets::bwWidget
enum class  State { NORMAL = 0 , HIGHLIGHTED , SUNKEN , STATE_TOT }
 

Detailed Description

Base class for button like widgets.

Constructor & Destructor Documentation

◆ bwAbstractButton()

bWidgets::bwAbstractButton::bwAbstractButton ( const std::string &  text,
std::optional< unsigned int >  width_hint = std::nullopt,
std::optional< unsigned int >  height_hint = std::nullopt 
)
protected

Member Function Documentation

◆ apply()

void bWidgets::bwAbstractButton::apply ( )
protected

◆ createHandler()

auto bWidgets::bwAbstractButton::createHandler ( ) -> std::unique_ptr<bwScreenGraph::EventHandler>
overridevirtual

◆ draw()

void bWidgets::bwAbstractButton::draw ( class bwStyle style)
overridevirtual

◆ getIcon()

auto bWidgets::bwAbstractButton::getIcon ( ) const -> const bwIconInterface*
virtual

Reimplemented in bWidgets::bwPushButton.

◆ getLabel()

auto bWidgets::bwAbstractButton::getLabel ( ) const -> const std::string*
overridevirtual

Reimplemented from bWidgets::bwWidget.

◆ registerProperties()

void bWidgets::bwAbstractButton::registerProperties ( )
overridevirtual

Reimplemented from bWidgets::bwWidget.

◆ setLabel()

auto bWidgets::bwAbstractButton::setLabel ( const std::string &  label) -> bwAbstractButton&

Member Data Documentation

◆ apply_functor

std::unique_ptr<bwFunctorInterface> bWidgets::bwAbstractButton::apply_functor {nullptr}

Function object called when applying changes to widget.

◆ base_style

bwWidgetBaseStyle bWidgets::bwAbstractButton::base_style

◆ rounded_corners

unsigned int bWidgets::bwAbstractButton::rounded_corners

◆ text

std::string bWidgets::bwAbstractButton::text
protected

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