ofxOui - UI Components for OpenFrameworks

Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ofxOui::Slider Class Reference

Slider controller. More...

#include <ofxOuiSlider.hpp>

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

Public Types

enum  Layout { Layout::Horizontal, Layout::Vertical }
 Display Layout. More...
 
enum  Origin { Origin::Lower, Origin::Upper, Origin::Zero }
 Origin of the slider filling. More...
 

Public Member Functions

 Slider (int x_=0, int y_=0, int width_=0, int height_=0)
 Constructor. More...
 
virtual ~Slider ()
 Destructor. More...
 
virtual void update ()
 OF-like update function. More...
 
template<typename T , typename args , class ListenerClass >
void onEditValue (T *owner, void(ListenerClass::*listenerMethod)(args))
 Set callback function for value editing events. 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

Layout layout
 Display Layout. More...
 
Origin origin
 Origin of the slider filling. More...
 
float value
 value of the number box More...
 
float min
 minimum value More...
 
float max
 maximum value More...
 
int precision
 precision of the number display More...
 
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 drawLabel ()
 
virtual void mouseDragged (ofMouseEventArgs &e)
 
virtual void mousePressed (ofMouseEventArgs &e)
 
void clipValue ()
 
virtual void mouseReleased (ofMouseEventArgs &e)
 
virtual void keyPressed (ofKeyEventArgs &e)
 
virtual void drawBackground ()
 
virtual void drawFrame ()
 
virtual void drawIcon ()
 

Protected Attributes

ofRectangle slider_rect_
 
bool dragging_
 
string user_input_
 
int y_pressed_
 
float value_pressed_
 
TextBox value_text_
 
float drag_step_
 
std::function< void(Numbox::ValueEvent &)> numbox_event_callback_
 
Type type_ = ofxOui::Type::Label
 
bool hover_ = false
 
ofColor current_background_color_
 
ofColor current_frame_color_
 

Static Protected Attributes

static Componentblocking_component = nullptr
 

Detailed Description

Slider controller.

Member Enumeration Documentation

§ Layout

Display Layout.

Enumerator
Horizontal 
Vertical 

§ Origin

Origin of the slider filling.

Enumerator
Lower 
Upper 
Zero 

Constructor & Destructor Documentation

§ Slider()

ofxOui::Slider::Slider ( int  x_ = 0,
int  y_ = 0,
int  width_ = 0,
int  height_ = 0 
)

Constructor.

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

§ ~Slider()

ofxOui::Slider::~Slider ( )
virtual

Destructor.

Member Function Documentation

§ clipValue()

void ofxOui::Numbox::clipValue ( )
protectedinherited

§ draw()

void ofxOui::Component::draw ( )
virtualinherited

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 ( )
protectedvirtualinherited

§ drawFrame()

void ofxOui::Component::drawFrame ( )
protectedvirtualinherited

§ drawIcon()

void ofxOui::Component::drawIcon ( )
protectedvirtualinherited

Reimplemented in ofxOui::CheckBox.

§ drawLabel()

void ofxOui::Slider::drawLabel ( )
protectedvirtual

Reimplemented from ofxOui::Numbox.

§ inside()

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

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

§ keyPressed()

void ofxOui::Numbox::keyPressed ( ofKeyEventArgs &  e)
protectedvirtualinherited

§ mouseDragged()

void ofxOui::Slider::mouseDragged ( ofMouseEventArgs &  e)
protectedvirtual

Reimplemented from ofxOui::Numbox.

§ mousePressed()

void ofxOui::Slider::mousePressed ( ofMouseEventArgs &  e)
protectedvirtual

Reimplemented from ofxOui::Numbox.

§ mouseReleased()

void ofxOui::Numbox::mouseReleased ( ofMouseEventArgs &  e)
protectedvirtualinherited

§ onEditValue()

template<typename T , typename args , class ListenerClass >
void ofxOui::Numbox::onEditValue ( T *  owner,
void(ListenerClass::*)(args)  listenerMethod 
)
inlineinherited

Set callback function for value editing events.

Parameters
ownerpointer to the owner object
listenerMethodmethod to be called on eaech event
Template Parameters
Ttype of the owner object
argsarguments of the callback function
ListenerClassclass to which the listener method belongs

§ type()

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

get the type of the component

Returns
type of the component

§ update()

void ofxOui::Slider::update ( )
virtual

OF-like update function.

Reimplemented from ofxOui::Numbox.

Member Data Documentation

§ active

bool ofxOui::Component::active = false
inherited

specifies if the component is active

§ blocking_component

ofxOui::Component * ofxOui::Component::blocking_component = nullptr
staticprotectedinherited

§ current_background_color_

ofColor ofxOui::Component::current_background_color_
protectedinherited

§ current_frame_color_

ofColor ofxOui::Component::current_frame_color_
protectedinherited

§ disabled

bool ofxOui::Component::disabled = false
inherited

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

§ drag_step_

float ofxOui::Numbox::drag_step_
protectedinherited

§ dragging_

bool ofxOui::Numbox::dragging_
protectedinherited

§ font

TextBox ofxOui::Component::font
inherited

textbox for the main label of the component

§ height

float ofxOui::Component::height
inherited

component height

§ hover_

bool ofxOui::Component::hover_ = false
protectedinherited

§ icon

Icon ofxOui::Component::icon
inherited

icon box of the component

§ labelOff

string ofxOui::Component::labelOff = ""
inherited

Label of the component (not active)

§ labelOn

string ofxOui::Component::labelOn = ""
inherited

Label of the component (active)

§ layout

Layout ofxOui::Slider::layout

Display Layout.

§ max

float ofxOui::Numbox::max
inherited

maximum value

§ min

float ofxOui::Numbox::min
inherited

minimum value

§ numbox_event_callback_

std::function<void(Numbox::ValueEvent &)> ofxOui::Numbox::numbox_event_callback_
protectedinherited

§ origin

Origin ofxOui::Slider::origin

Origin of the slider filling.

§ precision

int ofxOui::Numbox::precision
inherited

precision of the number display

§ shape

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

shape of the component

§ slider_rect_

ofRectangle ofxOui::Slider::slider_rect_
protected

§ style

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

style of the component

§ type_

Type ofxOui::Component::type_ = ofxOui::Type::Label
protectedinherited

§ user_input_

string ofxOui::Numbox::user_input_
protectedinherited

§ value

float ofxOui::Numbox::value
inherited

value of the number box

§ value_pressed_

float ofxOui::Numbox::value_pressed_
protectedinherited

§ value_text_

TextBox ofxOui::Numbox::value_text_
protectedinherited

§ width

float ofxOui::Component::width
inherited

component width

§ x

float ofxOui::Component::x
inherited

x position (left)

§ y

float ofxOui::Component::y
inherited

y position(top)

§ y_pressed_

int ofxOui::Numbox::y_pressed_
protectedinherited

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