21 #ifndef ofxOuiMatrix_hpp 22 #define ofxOuiMatrix_hpp 67 template <
typename T,
typename args,
class ListenerClass>
68 void onClick(T* owner,
void (ListenerClass::*listenerMethod)(args)) {
69 using namespace std::placeholders;
83 Matrix(
int x_ = 0,
int y_ = 0,
int width_ = 0,
int height_ = 0);
virtual void update()
OF-like update function.
Definition: ofxOuiMatrix.cpp:80
int rows
number of rows
Definition: ofxOuiMatrix.hpp:108
int col
Definition: ofxOuiMatrix.hpp:55
Event arguments for button clicks.
Definition: ofxOuiMatrix.hpp:38
void onButtonClick(Button::ClickEvent &e)
Definition: ofxOuiMatrix.cpp:137
Shape
Base shape of the UI components.
Definition: ofxOuiCommon.hpp:73
virtual void setup()
Setup the Matrix layout.
Definition: ofxOuiMatrix.cpp:44
int cols
number of columns
Definition: ofxOuiMatrix.hpp:113
virtual ~Matrix()
Destructor.
Definition: ofxOuiMatrix.cpp:39
void mouseDragged(ofMouseEventArgs &e)
Definition: ofxOuiMatrix.cpp:122
Button const * selected_button_
Definition: ofxOuiMatrix.hpp:149
Base UI Component (equivalent to a label)
Definition: ofxOuiComponent.hpp:33
ClickEvent(Matrix *sender_, int row_, int col_, bool value_)
Constructor.
Definition: ofxOuiMatrix.cpp:154
ofRectangle grid_rect_
Definition: ofxOuiMatrix.hpp:146
float padding
padding between matrix buttons
Definition: ofxOuiMatrix.hpp:118
int row
Definition: ofxOuiMatrix.hpp:54
Matrix * sender
pointer to the sender component
Definition: ofxOuiMatrix.hpp:52
virtual void draw()
OF-like draw function.
Definition: ofxOuiMatrix.cpp:94
Definition: ofxOuiColormap.hpp:25
vector< vector< Button > > buttons
Matrix of button GUIs.
Definition: ofxOuiMatrix.hpp:140
void onClick(T *owner, void(ListenerClass::*listenerMethod)(args))
Set callback function for click events.
Definition: ofxOuiMatrix.hpp:68
Shape button_shape
shape of individual buttons
Definition: ofxOuiMatrix.hpp:135
float button_height_
Definition: ofxOuiMatrix.hpp:148
bool draw_grid
specifies if the grid between buttons should be drawn
Definition: ofxOuiMatrix.hpp:130
Matrix(int x_=0, int y_=0, int width_=0, int height_=0)
Constructor.
Definition: ofxOuiMatrix.cpp:23
float button_width_
Definition: ofxOuiMatrix.hpp:147
std::function< void(Matrix::ClickEvent &)> click_event_callback_
Definition: ofxOuiMatrix.hpp:150
bool value
Definition: ofxOuiMatrix.hpp:56
Button Matrix (supports both button -single-button activation- and toggle -multi-button activation-) ...
Definition: ofxOuiMatrix.hpp:33
bool toggle
specifies if the matrix works in toggle with several buttons that can be activated at the same time o...
Definition: ofxOuiMatrix.hpp:125