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

Simple class for managing properties that can be manipulated through stylesheets (CSS). More...

#include <bwStyleProperties.h>

+ Inheritance diagram for bWidgets::bwStyleProperty:

Public Types

enum class  Type { BOOL , INTEGER , FLOAT , COLOR }
 

Public Member Functions

void setValue (bool)
 
void setValue (int)
 
void setValue (float)
 
void setValue (const bwColor &)
 
void setValue (const bwStyleProperty &)
 
void setValueToDefault ()
 
void setDefaultValue (bool)
 
void setDefaultValue (int)
 
void setDefaultValue (float)
 
void setDefaultValue (const bwColor &)
 
auto getIdentifier () const -> std::string_view
 
auto getType () const -> Type
 

Friends

template<typename >
class bwStylePropertyInternal
 

Detailed Description

Simple class for managing properties that can be manipulated through stylesheets (CSS).

Idea of the bwStyleProperty is to add a string identifier to a variable (basic RTTI) so that stylesheet rules can be mapped to this concrete variable. Use the bwStyleProperties class to manage (add, lookup and iterate) a list of properties.

It is possible to reference an existing variable with a bwStyleProperty, meaning the property is not owner of it. To do so call the bwStyleProperties::addFoo() function with the reference argument set. Such usage looks like this:

bwStyleProperties properties;
int some_int = 0;
bwStyleProperty& property = properties.addInteger("int_name", some_int);
property.setValue(42);
assert(some_int == 42);

Member Enumeration Documentation

◆ Type

Enumerator
BOOL 
INTEGER 
FLOAT 
COLOR 

Member Function Documentation

◆ getIdentifier()

auto bWidgets::bwStyleProperty::getIdentifier ( ) const -> std::string_view

◆ getType()

auto bWidgets::bwStyleProperty::getType ( ) const -> Type

◆ setDefaultValue() [1/4]

void bWidgets::bwStyleProperty::setDefaultValue ( bool  value)

◆ setDefaultValue() [2/4]

void bWidgets::bwStyleProperty::setDefaultValue ( const bwColor value)

◆ setDefaultValue() [3/4]

void bWidgets::bwStyleProperty::setDefaultValue ( float  value)

◆ setDefaultValue() [4/4]

void bWidgets::bwStyleProperty::setDefaultValue ( int  value)

◆ setValue() [1/5]

void bWidgets::bwStyleProperty::setValue ( bool  value)

◆ setValue() [2/5]

void bWidgets::bwStyleProperty::setValue ( const bwColor value)

◆ setValue() [3/5]

void bWidgets::bwStyleProperty::setValue ( const bwStyleProperty from_property_base)

◆ setValue() [4/5]

void bWidgets::bwStyleProperty::setValue ( float  value)

◆ setValue() [5/5]

void bWidgets::bwStyleProperty::setValue ( int  value)

◆ setValueToDefault()

void bWidgets::bwStyleProperty::setValueToDefault ( )

Friends And Related Function Documentation

◆ bwStylePropertyInternal

template<typename >
friend class bwStylePropertyInternal
friend

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