ofxOui - UI Components for OpenFrameworks

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
ofxOui::Component Class Reference

Base UI Component (equivalent to a label) More...

#include <ofxOuiComponent.hpp>

Inheritance diagram for ofxOui::Component:
[legend]
Collaboration diagram for ofxOui::Component:
[legend]

Public Member Functions

 Component (float x_=0, float y_=0, float width_=0, float height_=0)
 Constructor. More...
 
virtual ~Component ()
 Destructor. More...
 
virtual void update ()
 OF-like update function. More...
 
virtual void draw ()
 OF-like draw function. More...
 
virtual bool inside (float x_, float y_) const
 checks if a point is inside the component (depending on the shape) More...
 
Type type () const
 get the type of the component More...
 

Public Attributes

Shape shape = ofxOui::Shape::Rectangle
 shape of the component More...
 
Style style = ofxOui::Style::Default
 style of the component More...
 
TextBox font
 textbox for the main label of the component More...
 
Icon icon
 icon box of the component More...
 
float x
 x position (left) More...
 
float y
 y position(top) More...
 
float width
 component width More...
 
float height
 component height More...
 
string labelOn = ""
 Label of the component (active) More...
 
string labelOff = ""
 Label of the component (not active) More...
 
bool disabled = false
 specifies if the component should be in "disabled" mode (no interaction) More...
 
bool active = false
 specifies if the component is active More...
 

Protected Member Functions

virtual void drawBackground ()
 
virtual void drawFrame ()
 
virtual void drawLabel ()
 
virtual void drawIcon ()
 

Protected Attributes

Type type_ = ofxOui::Type::Label
 
bool hover_ = false
 
ofColor current_background_color_
 
ofColor current_frame_color_
 

Static Protected Attributes

static Componentblocking_component = nullptr
 

Friends

class Group
 

Detailed Description

Base UI Component (equivalent to a label)

Constructor & Destructor Documentation

§ Component()

ofxOui::Component::Component ( float  x_ = 0,
float  y_ = 0,
float  width_ = 0,
float  height_ = 0 
)

Constructor.

Parameters
x_x position (left)
y_y position (top)
width_component width
height_component height

§ ~Component()

ofxOui::Component::~Component ( )
virtual

Destructor.

Member Function Documentation

§ draw()

void ofxOui::Component::draw ( )
virtual

OF-like draw function.

this method is subdivided in protected sub-methods that can be overloaded in inherited components

Reimplemented in ofxOui::Matrix, and ofxOui::DropDown.

§ drawBackground()

void ofxOui::Component::drawBackground ( )
protectedvirtual

§ drawFrame()

void ofxOui::Component::drawFrame ( )
protectedvirtual

§ drawIcon()

void ofxOui::Component::drawIcon ( )
protectedvirtual

Reimplemented in ofxOui::CheckBox.

§ drawLabel()

void ofxOui::Component::drawLabel ( )
protectedvirtual

§ inside()

bool ofxOui::Component::inside ( float  x_,
float  y_ 
) const
virtual

checks if a point is inside the component (depending on the shape)

Returns
true if the point of coordinates (x, y) is inside the component

§ type()

Type ofxOui::Component::type ( ) const
inline

get the type of the component

Returns
type of the component

§ update()

void ofxOui::Component::update ( )
virtual

Friends And Related Function Documentation

§ Group

friend class Group
friend

Member Data Documentation

§ active

bool ofxOui::Component::active = false

specifies if the component is active

§ blocking_component

ofxOui::Component * ofxOui::Component::blocking_component = nullptr
staticprotected

§ current_background_color_

ofColor ofxOui::Component::current_background_color_
protected

§ current_frame_color_

ofColor ofxOui::Component::current_frame_color_
protected

§ disabled

bool ofxOui::Component::disabled = false

specifies if the component should be in "disabled" mode (no interaction)

§ font

TextBox ofxOui::Component::font

textbox for the main label of the component

§ height

float ofxOui::Component::height

component height

§ hover_

bool ofxOui::Component::hover_ = false
protected

§ icon

Icon ofxOui::Component::icon

icon box of the component

§ labelOff

string ofxOui::Component::labelOff = ""

Label of the component (not active)

§ labelOn

string ofxOui::Component::labelOn = ""

Label of the component (active)

§ shape

Shape ofxOui::Component::shape = ofxOui::Shape::Rectangle

shape of the component

§ style

Style ofxOui::Component::style = ofxOui::Style::Default

style of the component

§ type_

Type ofxOui::Component::type_ = ofxOui::Type::Label
protected

§ width

float ofxOui::Component::width

component width

§ x

float ofxOui::Component::x

x position (left)

§ y

float ofxOui::Component::y

y position(top)


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