20 #ifndef ofxOuiDropDown_hpp 21 #define ofxOuiDropDown_hpp 64 template <
typename T,
typename args,
class ListenerClass>
65 void onSelect(T *owner,
void (ListenerClass::*listenerMethod)(args)) {
66 using namespace std::placeholders;
80 DropDown(
int x_ = 0,
int y_ = 0,
int width_ = 0,
int height_ = 0);
vector< shared_ptr< ofxOui::Button > > sub_buttons_
Definition: ofxOuiDropDown.hpp:111
string text
label of the selected menu item
Definition: ofxOuiDropDown.hpp:53
void mouseDragged(ofMouseEventArgs &e)
Definition: ofxOuiDropDown.cpp:76
Base UI Component (equivalent to a label)
Definition: ofxOuiComponent.hpp:33
Drop-down menu.
Definition: ofxOuiDropDown.hpp:31
DropDown * sender
pointer to the sender component
Definition: ofxOuiDropDown.hpp:48
vector< string > items
list of items contained in the menu
Definition: ofxOuiDropDown.hpp:100
void mouseMoved(ofMouseEventArgs &e)
Definition: ofxOuiDropDown.cpp:71
bool clear_buttons_
Definition: ofxOuiDropDown.hpp:110
void mousePressed(ofMouseEventArgs &e)
Definition: ofxOuiDropDown.cpp:81
virtual void update()
OF-like update function.
Definition: ofxOuiDropDown.cpp:49
virtual void draw()
OF-like draw function.
Definition: ofxOuiDropDown.cpp:62
void createSubGui()
Definition: ofxOuiDropDown.cpp:116
bool mouse_moved_
Definition: ofxOuiDropDown.hpp:109
virtual ~DropDown()
Destructor.
Definition: ofxOuiDropDown.cpp:37
DropDown(int x_=0, int y_=0, int width_=0, int height_=0)
Constructor.
Definition: ofxOuiDropDown.cpp:22
Definition: ofxOuiColormap.hpp:25
void onSelect(T *owner, void(ListenerClass::*listenerMethod)(args))
Set callback function for item selection events.
Definition: ofxOuiDropDown.hpp:65
Event arguments for menu item selection.
Definition: ofxOuiDropDown.hpp:36
std::function< void(DropDown::SelectEvent &)> select_event_callback_
Definition: ofxOuiDropDown.hpp:112
SelectEvent(DropDown *sender_, string text_)
Constructor.
Definition: ofxOuiDropDown.cpp:130
void mouseReleased(ofMouseEventArgs &e)
Definition: ofxOuiDropDown.cpp:94