Mercurial > hg > tweakathon2ios
comparison UI code/sliderPanel.h @ 21:5cf2b80909fc
Hints and sliders show ok for training sequences.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 22 Oct 2014 18:12:12 +0100 |
parents | f83635861187 |
children | 8124f46eda65 |
comparison
equal
deleted
inserted
replaced
20:1e6d4ece1572 | 21:5cf2b80909fc |
---|---|
20 #include "timeController.h" | 20 #include "timeController.h" |
21 #include "ButtronSlider.h" | 21 #include "ButtronSlider.h" |
22 #include "ButtronXY.h" | 22 #include "ButtronXY.h" |
23 #include "3Dbox.h" | 23 #include "3Dbox.h" |
24 #include "3DboxGL.h" | 24 #include "3DboxGL.h" |
25 #include "ButtronSlider.h" | |
25 // panel with sliders and xy pads | 26 // panel with sliders and xy pads |
26 class SliderPanel : public UIElementContainer{ | 27 class SliderPanel : public UIElementContainer{ |
27 | 28 |
28 public: | 29 public: |
29 SliderPanel(float ax, | 30 SliderPanel(float ax, |
34 vector<controllerType> elemList); | 35 vector<controllerType> elemList); |
35 //------------------------ | 36 //------------------------ |
36 void showHint(bool value){ | 37 void showHint(bool value){ |
37 vector<UIElement *>::iterator UIitr; | 38 vector<UIElement *>::iterator UIitr; |
38 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | 39 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ |
39 (*UIitr)->showHint(value); | 40 |
41 ButtronSlider* thisSlider = (ButtronSlider *)(*UIitr); | |
42 thisSlider->showHint(value); | |
40 } | 43 } |
41 } | 44 } |
42 // | 45 // |
43 void setHintValues(vector<int> vals){ | 46 void setHintValues(vector<int> vals){ |
44 auto valItr = vals.begin(); | 47 int i = 0; |
45 for(auto UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | 48 for(auto UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ |
46 if (++valItr != vals.end()){ | 49 ButtronSlider* thisSlider = (ButtronSlider *)(*UIitr); |
47 (*UIitr)->setHintValue(*valItr); | 50 thisSlider->setHintValue(vals[i]); |
48 } | 51 i++; |
49 } | 52 } |
50 } | 53 } |
51 void setHintColor(ofColor c){ | 54 void setHintColor(ofColor c){ |
52 vector<UIElement *>::iterator UIitr; | 55 vector<UIElement *>::iterator UIitr; |
53 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ | 56 for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){ |