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

A radio-button like widget retaining a pressed state once pressed. More...

#include <bwRadioButton.h>

+ Inheritance diagram for bWidgets::bwRadioButton:
+ Collaboration diagram for bWidgets::bwRadioButton:

Public Member Functions

 bwRadioButton (const std::string &text, std::optional< unsigned int > width_hint=std::nullopt, std::optional< unsigned int > height_hint=std::nullopt)
 
auto getTypeIdentifier () const -> std::string_view override
 
auto canAlign () const -> bool override
 
auto createHandler () -> std::unique_ptr< bwScreenGraph::EventHandler > override
 
- Public Member Functions inherited from bWidgets::bwAbstractButton
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
 

Additional Inherited Members

- Public Types inherited from bWidgets::bwWidget
enum class  State { NORMAL = 0 , HIGHLIGHTED , SUNKEN , STATE_TOT }
 
- Public Attributes inherited from bWidgets::bwAbstractButton
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 inherited from bWidgets::bwAbstractButton
 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 inherited from bWidgets::bwAbstractButton
std::string text
 

Detailed Description

A radio-button like widget retaining a pressed state once pressed.

Note
: The way this works right now is not that nice. It's however made so it can work nicely with Blender.

Normally, there's a group of radio buttons, once one of them is pressed, the others get un-pressed. It's an exclusive behavior: There should only ever be one pressed radio button in the group. bWidgets doesn't ensure this behavior at all as of now. The host application needs to do this. In future, there should be a group-widget that ensures the exclusive behavior within bWidgets. We need to make Blender ready for it first, though (or make it optional).

Constructor & Destructor Documentation

◆ bwRadioButton()

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

Member Function Documentation

◆ canAlign()

auto bWidgets::bwRadioButton::canAlign ( ) const -> bool
overridevirtual

Reimplemented from bWidgets::bwWidget.

◆ createHandler()

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

Reimplemented from bWidgets::bwAbstractButton.

◆ getTypeIdentifier()

auto bWidgets::bwRadioButton::getTypeIdentifier ( ) const -> std::string_view
overridevirtual

Implements bWidgets::bwWidget.


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