diff UI code/sliderPanel.h @ 27:27cdf475aa4b

more fiddling
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 29 Oct 2014 15:38:38 +0000
parents 8124f46eda65
children 953db6518738
line wrap: on
line diff
--- a/UI code/sliderPanel.h	Tue Oct 28 19:15:28 2014 +0000
+++ b/UI code/sliderPanel.h	Wed Oct 29 15:38:38 2014 +0000
@@ -22,8 +22,11 @@
 #include "ButtronXY.h"
 #include "3Dbox.h"
 #include "3DboxGL.h"
+#include "6Dbox.h"
 #include "ButtronSlider.h"
 // panel with sliders and xy pads
+
+// AND 6DOF BOXES !!!!!
 class SliderPanel : public UIElementContainer{
     
 public:
@@ -33,80 +36,25 @@
                 float aheight,
                 const UIProps& aprops,
                 vector<controllerType> elemList);
-    //------------------------
-    void showHint(bool value){
-        vector<UIElement *>::iterator UIitr;
-        for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-            
-            ButtronSlider* thisSlider = (ButtronSlider *)(*UIitr);
-            thisSlider->showHint(value);
-        }
-    }
+ 
+    void setAndShowHint(vector<int> values, ofImage* texture);
+    
+    void showHint(bool value);
     //
-    void setHintValues(vector<int> vals){
-        int i = 0;
-        for(auto UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-            ButtronSlider* thisSlider = (ButtronSlider *)(*UIitr);
-            thisSlider->setHintValue(vals[i]);
-            i++;
-        }
-    }
-    void setHintColor(ofColor c){
-        vector<UIElement *>::iterator UIitr;
-        for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-            (*UIitr)->setHintColor(c);
-        }
-    }
-    void setSliderColors(ofColor c){
-        for(auto UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-            ButtronSlider* thisSlider = (ButtronSlider *)(*UIitr);
-            thisSlider->setColor(c);
-        }
-    }
-    //------------------------
-    void flash(){
-        // turn hilight on and off
-        if (!flashing){
-            vector<UIElement *>::iterator UIitr;
-            for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-                (*UIitr)->setHighlight(true);
-            }
-            // set up timer
-            TimerCallbackFunction tcb;
-            tcb = boost::bind(&SliderPanel::flash, this);
-            timeController.scheduleEvent(tcb, 250);
-            flashing = true;
-        }else{
-            vector<UIElement *>::iterator UIitr;
-            for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-                (*UIitr)->setHighlight(false);
-            }
-            flashing = false;
-        }
-        
-    }
-    //------------------------
-    void setBgColor(ofColor c){
-        vector<UIElement *>::iterator UIitr;
-        for(UIitr = subElements.begin(); UIitr < subElements.end(); UIitr++){
-            (*UIitr)->setColor(c);
-        }
-    }
-    //------------------------
+    void setHintValues(vector<int> vals);
+    void setHintColor(ofColor c);
+    void setSliderColors(ofColor c);
+    void flash();
+    void setBgColor(ofColor c);
     vector<UIElement*> generateControls(vector<controllerType> elemList, controlPanelType panelType);
-    //------------------------
-    UIElement* getSlider(int index){
-        if (index < subElements.size()){
-            return subElements[index];
-        }else{
-            cout << "ERROR: index too big for sldiers" << endl;
-            return NULL;
-        }
-    };
-    // TODO override touch thing to make revisitable
+
+    UIElement* getSlider(int index);
+    void setHintTexture(ofImage* texture);
+
+    void showValueIndicators(bool show);
 private:
     bool flashing;
-    controlPanelType panelType;
+    controlPanelType thisPanelType;
 };
 
 #endif /* defined(__tweakathlon__sliderPanel__) */