Group of UI components.
More...
#include <ofxOuiGroup.hpp>
|
| Group (int x_=0, int y_=0, int width_=100, int height_=100) |
| Constructor. More...
|
|
| ~Group () |
| Destructor. More...
|
|
virtual void | setup () |
|
virtual void | update () |
| OF-like update function. More...
|
|
virtual void | draw () |
| OF-like draw function. More...
|
|
virtual bool | inside (int x_, int y_) |
| checks if the point (x, y) is inside the UI group More...
|
|
int | rows () const |
| get the number of rows in the group More...
|
|
int | cols () const |
| get the number of columns in the group More...
|
|
bool | addComponent (shared_ptr< Component > component, int row, int col, int rowSpan=1, int colSpan=1) |
| add a component to the group More...
|
|
shared_ptr< Component > | getComponent (int row, int col) |
| get the pointer to a component by grid position More...
|
|
shared_ptr< Component > | getComponentByLabel (string label) |
| get the pointer to a component by label (inactive label) More...
|
|
vector< shared_ptr< Component > > | getComponents () |
| get a vector of pointers to the components of the group More...
|
|
bool | removeComponent (shared_ptr< Component > component) |
| remove a given component from the group by pointer More...
|
|
bool | removeComponent (int row, int col) |
| remove a given component from the group by position More...
|
|
void | clear () |
| clear the UI group (deletes all components) More...
|
|
void | disable () |
| disable all components More...
|
|
void | enable () |
| disable all components More...
|
|
§ Group()
ofxOui::Group::Group |
( |
int |
x_ = 0 , |
|
|
int |
y_ = 0 , |
|
|
int |
width_ = 100 , |
|
|
int |
height_ = 100 |
|
) |
| |
Constructor.
- Parameters
-
x_ | x position (left) |
y_ | y position (top) |
width_ | component width |
height_ | component height |
§ ~Group()
ofxOui::Group::~Group |
( |
| ) |
|
§ addComponent()
bool ofxOui::Group::addComponent |
( |
shared_ptr< Component > |
component, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
rowSpan = 1 , |
|
|
int |
colSpan = 1 |
|
) |
| |
add a component to the group
- Parameters
-
component | shared pointer to the component to add |
row | index of the row in the group grid |
col | index of the column in the group grid |
rowSpan | number of rows the component is spanning in the group grid |
colSpan | number of columns the component is spanning in the group grid |
- Returns
- true if the component was successully added to the group
§ clear()
void ofxOui::Group::clear |
( |
| ) |
|
clear the UI group (deletes all components)
§ cols()
int ofxOui::Group::cols |
( |
| ) |
const |
get the number of columns in the group
- Returns
- total number of columns (including multi-column spans)
§ disable()
void ofxOui::Group::disable |
( |
| ) |
|
§ draw()
void ofxOui::Group::draw |
( |
| ) |
|
|
virtual |
§ enable()
void ofxOui::Group::enable |
( |
| ) |
|
§ getComponent()
get the pointer to a component by grid position
- Parameters
-
row | index of the row in the group grid |
col | index of the column in the group grid |
- Returns
- shared pointer to the component if it exists (else nullptr)
§ getComponentByLabel()
get the pointer to a component by label (inactive label)
- Parameters
-
label | label of the component (inactive mode) |
- Warning
- returns the first component with the given label
§ getComponents()
get a vector of pointers to the components of the group
- Returns
- vector of pointers to the components of the group
§ inside()
bool ofxOui::Group::inside |
( |
int |
x_, |
|
|
int |
y_ |
|
) |
| |
|
virtual |
checks if the point (x, y) is inside the UI group
§ removeComponent() [1/2]
bool ofxOui::Group::removeComponent |
( |
shared_ptr< Component > |
component | ) |
|
remove a given component from the group by pointer
- Parameters
-
component | shared pointer to the component |
- Returns
- true if the component was successfully removed from the group
§ removeComponent() [2/2]
bool ofxOui::Group::removeComponent |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
remove a given component from the group by position
- Parameters
-
row | index of the row in the group grid |
col | index of the column in the group grid |
- Returns
- true if the component was successfully removed from the group
§ rows()
int ofxOui::Group::rows |
( |
| ) |
const |
get the number of rows in the group
- Returns
- total number of rows (including multi-row spans)
§ setup()
void ofxOui::Group::setup |
( |
| ) |
|
|
virtual |
§ update()
void ofxOui::Group::update |
( |
| ) |
|
|
virtual |
§ alignment
§ backgroundColor
ofColor ofxOui::Group::backgroundColor |
background color of the group
§ components
map<vector<int>, shared_ptr<Component> > ofxOui::Group::components |
|
protected |
§ frame_width
int ofxOui::Group::frame_width |
§ frameColor
ofColor ofxOui::Group::frameColor |
§ height
float ofxOui::Group::height |
§ max_component_height
int ofxOui::Group::max_component_height |
maximum height of each component
§ max_component_width
int ofxOui::Group::max_component_width |
maximum width of each component
§ padding
int ofxOui::Group::padding |
padding between the components
§ width
float ofxOui::Group::width |
The documentation for this class was generated from the following files: