20 #ifndef ofxOuiNumbox_hpp 21 #define ofxOuiNumbox_hpp 23 #include "../core/ofxOuiComponent.hpp" 64 template <
typename T,
typename args,
class ListenerClass>
65 void onEditValue(T *owner,
void (ListenerClass::*listenerMethod)(args)) {
66 using namespace std::placeholders;
80 Numbox(
int x_ = 0,
int y_ = 0,
int width_ = 0,
int height_ = 0);
virtual void mouseReleased(ofMouseEventArgs &e)
Definition: ofxOuiNumbox.cpp:124
string user_input_
Definition: ofxOuiNumbox.hpp:121
float drag_step_
Definition: ofxOuiNumbox.hpp:125
virtual ~Numbox()
Destructor.
Definition: ofxOuiNumbox.cpp:42
virtual void keyPressed(ofKeyEventArgs &e)
Definition: ofxOuiNumbox.cpp:132
float value
value of the number box
Definition: ofxOuiNumbox.hpp:53
int y_pressed_
Definition: ofxOuiNumbox.hpp:122
Base UI Component (equivalent to a label)
Definition: ofxOuiComponent.hpp:33
virtual void drawLabel()
Definition: ofxOuiNumbox.cpp:74
std::function< void(Numbox::ValueEvent &)> numbox_event_callback_
Definition: ofxOuiNumbox.hpp:126
void clipValue()
Definition: ofxOuiNumbox.cpp:69
virtual void update()
OF-like update function.
Definition: ofxOuiNumbox.cpp:53
float value
value of the number box
Definition: ofxOuiNumbox.hpp:95
ValueEvent(Numbox *sender_, float value_)
Constructor.
Definition: ofxOuiNumbox.cpp:173
Text box font wrapper.
Definition: ofxOuiTextBox.hpp:31
Numbox(int x_=0, int y_=0, int width_=0, int height_=0)
Constructor.
Definition: ofxOuiNumbox.cpp:21
virtual void mouseDragged(ofMouseEventArgs &e)
Definition: ofxOuiNumbox.cpp:86
float min
minimum value
Definition: ofxOuiNumbox.hpp:100
virtual void mousePressed(ofMouseEventArgs &e)
Definition: ofxOuiNumbox.cpp:101
Number box (with mouse + keyboard interaction, C74 max style)
Definition: ofxOuiNumbox.hpp:31
Event arguments for value editing events.
Definition: ofxOuiNumbox.hpp:36
Definition: ofxOuiColormap.hpp:25
float max
maximum value
Definition: ofxOuiNumbox.hpp:105
float value_pressed_
Definition: ofxOuiNumbox.hpp:123
Numbox * sender
pointer to the sender component
Definition: ofxOuiNumbox.hpp:48
bool dragging_
Definition: ofxOuiNumbox.hpp:120
void onEditValue(T *owner, void(ListenerClass::*listenerMethod)(args))
Set callback function for value editing events.
Definition: ofxOuiNumbox.hpp:65
int precision
precision of the number display
Definition: ofxOuiNumbox.hpp:110
TextBox value_text_
Definition: ofxOuiNumbox.hpp:124