Mercurial > hg > tweakathon2ios
comparison UI code/sliderPanel.h @ 0:a223551fdc1f
First commit - copy from tweakathlon.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Fri, 10 Oct 2014 11:46:42 +0100 |
parents | |
children | 851833072cf1 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a223551fdc1f |
---|---|
1 // | |
2 // sliderPanel.h | |
3 // tweakathlon | |
4 // | |
5 // Created by Robert Tubb on 11/02/2014. | |
6 // | |
7 // | |
8 | |
9 #ifndef __tweakathlon__sliderPanel__ | |
10 #define __tweakathlon__sliderPanel__ | |
11 | |
12 #include <iostream> | |
13 #include "UIElementContainer.h" | |
14 #include <iostream> | |
15 #include "globalVariables.h" | |
16 #include "ofMain.h" | |
17 #include "UIElement.h" | |
18 #include "boost/bind.hpp" | |
19 #include "boost/function.hpp" | |
20 #include "timeController.h" | |
21 #include "ButtronSlider.h" | |
22 #include "ButtronXY.h" | |
23 #include "3Dbox.h" | |
24 #include "3DboxGL.h" | |
25 // panel with sliders and xy pads | |
26 class SliderPanel : public UIElementContainer{ | |
27 | |
28 public: | |
29 SliderPanel(float ax, | |
30 float ay, | |
31 float awidth, | |
32 float aheight, | |
33 const UIProps& aprops, | |
34 vector<controllerType> elemList); | |
35 //------------------------ | |
36 void showHint(bool value){ | |
37 vector<UIElement *>::iterator UIitr; | |
38 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | |
39 (*UIitr)->showHint(value); | |
40 } | |
41 } | |
42 // | |
43 void setHintColor(ofColor c){ | |
44 vector<UIElement *>::iterator UIitr; | |
45 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | |
46 (*UIitr)->setHintColor(c); | |
47 } | |
48 } | |
49 //------------------------ | |
50 void flash(){ | |
51 // turn hilight on and off | |
52 if (!flashing){ | |
53 vector<UIElement *>::iterator UIitr; | |
54 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | |
55 (*UIitr)->setHighlight(true); | |
56 } | |
57 // set up timer | |
58 TimerCallbackFunction tcb; | |
59 tcb = boost::bind(&SliderPanel::flash, this); | |
60 timeController.scheduleEvent(tcb, 250); | |
61 flashing = true; | |
62 }else{ | |
63 vector<UIElement *>::iterator UIitr; | |
64 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | |
65 (*UIitr)->setHighlight(false); | |
66 } | |
67 flashing = false; | |
68 } | |
69 | |
70 } | |
71 //------------------------ | |
72 vector<UIElement*> generateControls(vector<controllerType> elemList, controlPanelType panelType); | |
73 //------------------------ | |
74 | |
75 // TODO override touch thing to make revisitable | |
76 private: | |
77 bool flashing; | |
78 controlPanelType panelType; | |
79 }; | |
80 | |
81 #endif /* defined(__tweakathlon__sliderPanel__) */ |