changeset 42:2bd658b44c2d

buttons dont lite up back to menu shows in more appropriate times
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 08 Dec 2014 18:29:10 +0000
parents ba426cc4e6e1
children 4ad0d218f890
files ExpMessageOrganiser.mm ExplorePresetManager.mm IntroViewController.xib MessageOrganiser.mm SequenceController.h SequenceController.mm TestController.h TestController.mm TrainingMessageOrganiser.h TrainingMessageOrganiser.mm UI code/UIElement.h UI code/UIElement.mm UI code/UIElementContainer.h UI code/buttonPanel.h testApp.mm
diffstat 15 files changed, 149 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/ExpMessageOrganiser.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/ExpMessageOrganiser.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -22,6 +22,7 @@
     instructionPanel->setLabel("Find a sound\n that expresses:");
     instructionPanel->show();
     bottomPanel->show();
+    bottomPanel->showAllElements();
     controlPanel->show();
     controlPanel->showHint(false);
     controlPanel->showValueIndicators(true);
@@ -97,9 +98,10 @@
         
         bool finished = expPresetManager.writeValuesToSlot(candidateSynth.getAllParamValues());
         if(finished){
-            instructionPanel->setText("ALL PRESETS MADE\n Please restart and go to TRAIN stage");
+            instructionPanel->setText("ALL PRESETS MADE\n Please go to menu and select TRAIN stage");
             instructionPanel->show();
             bottomPanel->show();
+            bottomPanel->showOnlyElementNamed("MENU");
 
             controlPanel->hide();
             
--- a/ExplorePresetManager.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/ExplorePresetManager.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -54,6 +54,7 @@
     
     if (index >= thePresetSlots.size()){
         cout << "ERROR: index " << index << " exceeds number of presetslots " << thePresets.size() << endl;
+        return thePresetSlots.back();
         return NULL;
     }else{
         return thePresetSlots[index];
--- a/IntroViewController.xib	Fri Dec 05 18:36:05 2014 +0000
+++ b/IntroViewController.xib	Mon Dec 08 18:29:10 2014 +0000
@@ -17,10 +17,10 @@
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <subviews>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4">
-                    <rect key="frame" x="267" y="529" width="154" height="61"/>
+                    <rect key="frame" x="133" y="529" width="154" height="61"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <state key="normal" title="EXP" backgroundImage="buttron.png">
-                        <color key="titleColor" red="0.28581259671449843" green="0.80918817934782605" blue="0.73026968770868927" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="titleColor" red="0.28627450980392155" green="0.80784313725490198" blue="0.73333333333333328" alpha="1" colorSpace="calibratedRGB"/>
                         <color key="titleShadowColor" red="0.0" green="0.79530400815217395" blue="0.77655573399798061" alpha="1" colorSpace="calibratedRGB"/>
                     </state>
                     <connections>
@@ -29,7 +29,7 @@
                     </connections>
                 </button>
                 <button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="WDx-XU-GHx">
-                    <rect key="frame" x="449" y="529" width="142" height="61"/>
+                    <rect key="frame" x="337" y="529" width="142" height="61"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <state key="normal" title="TRAIN" backgroundImage="buttron.png">
                         <color key="titleColor" red="0.28581259669999998" green="0.80918817929999998" blue="0.7302696877" alpha="1" colorSpace="calibratedRGB"/>
@@ -41,7 +41,7 @@
                     </connections>
                 </button>
                 <button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ngS-Bg-YOQ">
-                    <rect key="frame" x="618" y="529" width="152" height="61"/>
+                    <rect key="frame" x="543" y="529" width="152" height="61"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <state key="normal" title="SEARCH" backgroundImage="buttron.png">
                         <color key="titleColor" red="0.28581259669999998" green="0.80918817929999998" blue="0.7302696877" alpha="1" colorSpace="calibratedRGB"/>
@@ -53,7 +53,7 @@
                     </connections>
                 </button>
                 <button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Lu7-vf-MBo">
-                    <rect key="frame" x="794" y="529" width="152" height="61"/>
+                    <rect key="frame" x="754" y="529" width="152" height="61"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <state key="normal" title="PERFORM" backgroundImage="buttron.png">
                         <color key="titleColor" red="0.28581259669999998" green="0.80918817929999998" blue="0.7302696877" alpha="1" colorSpace="calibratedRGB"/>
@@ -65,21 +65,21 @@
                     </connections>
                 </button>
                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Welcome to the 6 parameter challenge. Please select an interface type and experiment stage. " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="39" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="14">
-                    <rect key="frame" x="158" y="-139" width="773" height="735"/>
+                    <rect key="frame" x="126" y="-139" width="773" height="735"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                    <color key="textColor" red="0.72194573409571561" green="1" blue="0.83094137152153613" alpha="1" colorSpace="calibratedRGB"/>
+                    <color key="textColor" red="0.43737351462381929" green="0.85799400252525249" blue="0.7533196695497848" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="6 PARAMETER CHALLENGE" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="50">
-                    <rect key="frame" x="392" y="49" width="256" height="24"/>
+                    <rect key="frame" x="384" y="76" width="256" height="24"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                    <color key="textColor" red="0.33826699840000002" green="0.9053322399" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                    <color key="textColor" red="0.3843137254901961" green="0.74117647058823533" blue="0.6470588235294118" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <segmentedControl appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" id="kLk-IB-COx">
-                    <rect key="frame" x="378" y="370" width="284" height="29"/>
+                    <rect key="frame" x="370" y="370" width="284" height="29"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     <segments>
                         <segment title="SLIDERS"/>
--- a/MessageOrganiser.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/MessageOrganiser.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -138,7 +138,7 @@
         lastLoggedVals = newVals;
         howManyLogged++;
     }else{
-        cout << "skipped! so far logged " << howManyLogged << endl;
+        //cout << "skipped! so far logged " << howManyLogged << endl;
     }
     
     //eventLogger.logEvent(CANDIDATE_PARAM_ADJUSTED, evtData);
--- a/SequenceController.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/SequenceController.h	Mon Dec 08 18:29:10 2014 +0000
@@ -14,7 +14,7 @@
 #include "presetManager.h"
 #include "TrainingScoreManager.h"
 
-#define MIN_TARGETS_IN_SEQUENCE 3
+#define MIN_TARGETS_IN_SEQUENCE 1
 #define NUM_REPETITIONS_AT_LEVEL 2
 #define MAX_TARGETS_IN_SEQUENCE 3
 #define MIN_TEMPO   70
--- a/SequenceController.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/SequenceController.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -330,8 +330,13 @@
         nextStep.presetIndex = *si;
         nextStep.runNumber = run;
         nextStep.whichInSequence = n;
-        nextStep.showsGuides = true;
-        nextStep.showsIcons = true;
+        if (soundOnlyMode){
+            nextStep.showsGuides = false;
+            nextStep.showsIcons = false ;
+        }else{
+            nextStep.showsGuides = true;
+            nextStep.showsIcons = true;
+        }
         nextStep.showsResultsAtEnd = false;
         nextStep.type = AnimStep::PREVIEW_MOVE;
         steps.push_back(nextStep);
@@ -382,7 +387,11 @@
     int n = 1;
     for(auto si = stepPresetIndices.begin(); si < stepPresetIndices.end(); si++){
         // put loader
-        nextStep.difficulty = 2;
+        if(soundOnlyMode){
+            nextStep.difficulty = 3;
+        }else{
+            nextStep.difficulty = 2;
+        }
         nextStep.presetIndex = *si;
         nextStep.runNumber = run;
         nextStep.whichInSequence = n;
@@ -433,39 +442,12 @@
         vector<int> stepPresetIndices = randomSequence(numInSequence);
         nextStep.thisSequence = stepPresetIndices;
         
-        // make preview sequence
-        int n = 1;
-        for(auto si = stepPresetIndices.begin(); si < stepPresetIndices.end(); si++){
-            // put loader
-            
-            nextStep.presetIndex = *si;
-            nextStep.runNumber = run;
-            nextStep.seqNumber = seqNo;
-            nextStep.whichInSequence = n;
-            nextStep.tempo = curTempo;
-            nextStep.showsGuides = false;
-            nextStep.showsIcons = false;
-            nextStep.showsResultsAtEnd = false;
-            nextStep.type = AnimStep::PREVIEW_MOVE;
-            steps.push_back(nextStep);
-            
-            if (SPACER_BARS){
-                nextStep.type = AnimStep::PREVIEW_LAST;
-                steps.push_back(nextStep);
-            }
-            n++;
-        }
+        makePreview(stepPresetIndices, run, nextStep);
         
-        // move back to neutral
-        nextStep.presetIndex = -1;
-        nextStep.type = AnimStep::PREVIEW_LAST;
-        nextStep.whichInSequence = 0;
-        nextStep.difficulty = 0;
-        nextStep.showsResultsAtEnd = false;
-        steps.push_back(nextStep);
+        // make matching sequence without icon seq help
+        makeMatchingSequence(stepPresetIndices, run, nextStep);
+        makeMatchingSequence(stepPresetIndices, run, nextStep);
         
-        // make matching sequence WITHOUT icon seq help
-        makeMatchingSequence(stepPresetIndices, run, nextStep);
         
         steps.back().isLastOfSeq = true;
         curTempo += tempoInc;
--- a/TestController.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/TestController.h	Mon Dec 08 18:29:10 2014 +0000
@@ -447,7 +447,8 @@
 //        bool aHint,
 //        bool aMemoryTest){
         
-       generateSomeTests(8, 8, REVISITABLE,1, false, false, false);
+       generateSomeTests(2, 6, REVISITABLE,1, true, false, false);
+        generateSomeTests(2, 6, SIMULTANEOUS,1, true, false, false);
 
         currentTest = testList.begin()-1; // dont do this
         scoreRunningTotal = 0;
@@ -518,6 +519,7 @@
     void generate2DSpecificTests();
     void generate3DSpecificTests();
     void generate4DTests();
+    
     void generateSomeTests(int howManyTests, int dimensions, controlPanelType panelType, int whichSpace, bool scored = true,bool aHint = false, bool aMemoryTest = false);
     
     void generateTestSequence(){
--- a/TestController.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/TestController.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -118,6 +118,7 @@
             adjustables[2] = true; // attack
             adjustables[4] = true; // ftype
         }
+
     }else {
         for (int i = 0; i < numDimensions; i++){
             adjustables[i] = true; // pitch
--- a/TrainingMessageOrganiser.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/TrainingMessageOrganiser.h	Mon Dec 08 18:29:10 2014 +0000
@@ -54,7 +54,7 @@
     void showCountdown();
     void hideSliders();
     void showsTarget();
-    void logNewStep(AnimStep newStep);
+    void logNewStep(AnimStep newStep, vector<int> targetVals);
     TrainingTestResult doResults(AnimStep newStep,
                                  Preset * currentTargetPreset,
                                  vector<int> startingPosition,
--- a/TrainingMessageOrganiser.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/TrainingMessageOrganiser.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -17,9 +17,9 @@
     candidateSynth.registerForTicks(callback);
     
     numParamsToUse = TOTAL_NUM_PARAMS;
-
+    
     sequenceController.init(soundOnlyMode);
-
+    
     
 }
 
@@ -30,6 +30,8 @@
     candidateSynth.setAllParams(expPresetManager.getNeutralPreset()->getValues());
     
     doHand(true);
+    doGuides(false,expPresetManager.getNeutralPreset());
+    bottomPanel->showAllElements();
 }
 //----------------------------------------------------------------------------------------
 void TrainingMessageOrganiser::setMiddlePanel(TextPanel* tp){
@@ -54,10 +56,10 @@
 
 //-----------------------------------------------------------------------
 void TrainingMessageOrganiser::displayInstructions(string text){
-
+    
     instructionPanel->setText(text);
     instructionPanel->show();
-
+    
 }
 
 //-----------------------------------------------------------------------
@@ -85,13 +87,14 @@
             // skip to next run?
             eventLogger.logEvent(RUN_SKIPPED);
         }else{
-        candidateSynth.setMetroTime(sequenceController.getStartTickTime());
-        candidateSynth.startMetronome();
-        bottomPanel->hide();
-        
-        vector<int> details;
-        
-        eventLogger.logEvent(START_NEW_RUN);
+            candidateSynth.setMetroTime(sequenceController.getStartTickTime());
+            candidateSynth.startMetronome();
+            bottomPanel->hide();
+            
+            vector<int> details;
+            details.push_back(panelType);
+            
+            eventLogger.logEvent(START_NEW_RUN, details);
         }
         return;
     }
@@ -118,7 +121,7 @@
 //-----------------------------------------------------------------------
 void TrainingMessageOrganiser::onNextTick(int tickNumber){
     static int showingCountdown = false;
-
+    
     downCounter = 4 - tickNumber % 4;
     
     if (showingCountdown){
@@ -144,6 +147,7 @@
     //playCandidateButton->setLabel("NEXT");
     bottomPanel->show();
     seqNumPanel->hide();
+    forgotButton->hide();
     eventLogger.logEvent(FINISHED_RUN);
     eventLogger.saveSessionToFile();
 }
@@ -154,22 +158,23 @@
     controlPanel->setColor(ofColor::black);
     middlePanel->setText("CONGRATULATIONS. FINISHED BLOCK!");
     middlePanel->show();
+    bottomPanel->showOnlyElementNamed("MENU");
     bottomPanel->show();
     seqNumPanel->hide();
+    forgotButton->hide();
     eventLogger.saveSessionToFile();
 }
 
-void TrainingMessageOrganiser::logNewStep(AnimStep newStep){
+void TrainingMessageOrganiser::logNewStep(AnimStep newStep, vector<int> targetVals){
     
     vector<int> details;
-    
     details.push_back(int(newStep.type));
     details.push_back(newStep.whichInSequence);
     details.push_back(newStep.showsGuides);
     details.push_back(newStep.showsIcons);
     details.push_back(newStep.presetIndex);
     details.push_back(newStep.tempo);
-    
+    details.insert(details.end(),targetVals.begin(), targetVals.end());
     eventLogger.logEvent(NEW_STEP, details);
     
 }
@@ -196,8 +201,7 @@
     Preset* previousTargetPreset;
     vector<int> curCandidateSettings = candidateSynth.getAllParamValues();
     if (oldStep.showsResultsAtEnd){
-        
-        // store results
+        // this if should be in getpreset
         if(oldStep.presetIndex == -1){
             previousTargetPreset =  expPresetManager.getNeutralPreset();
             cout << "SHOULDNT SCORE NEUTRAL??" << endl;
@@ -217,7 +221,7 @@
     
     AnimStep newStep = sequenceController.getNextStep();
     
-    logNewStep(newStep);
+    
     
     if(newStep.isLastOfAll){
         lastOfAll();
@@ -237,7 +241,8 @@
         
         currentTargetPreset =  expPresetManager.getPresetAtIndex(newStep.presetIndex);
         if (currentTargetPreset == NULL){
-            displayInstructions("No stored preset!\n please restart and choose EXP");
+            displayInstructions("No stored preset!\n please go back to menu and choose EXP");
+            bottomPanel->showOnlyElementNamed("MENU");
             candidateSynth.stopMetronome();
             return;
         }
@@ -272,7 +277,7 @@
         default:
             break;
     }
-    
+    logNewStep(newStep, currentTargetPreset->getValues());
     oldStep = newStep;
     lastPosition = curCandidateSettings;
     
@@ -286,7 +291,7 @@
     okToGetMidi = false;
     candidateSynth.playDownbeatBlip();
     middlePanel->hide();
-
+    
     // your 'hand' is hidden
     controlPanel->showValueIndicators(false);
     
@@ -297,7 +302,7 @@
     controlPanel->setValues(newTargetValues);
     presetIconPanel->setTextAndImage(currentTargetPreset->name, currentTargetPreset->getImage(), false);
     presetIconPanel->show();
-
+    
     controlPanel->setAndShowHint(newTargetValues, currentTargetPreset->getImage());
     doHand(false);
     controlPanel->show();
@@ -309,28 +314,26 @@
     seqNumPanel->hide();
     oldTargetValues = newTargetValues;
     controlPanel->setColor(ofColor::black);
-
-    forgotButton->show();
 }
 //-----------------------------------------------------------------------------
 void TrainingMessageOrganiser::previewMove(AnimStep newStep, Preset * currentTargetPreset){
-
+    
     targetSynth.trigger(); // PLAYS LAST TARGET
-
-
+    
+    
     vector<int> newTargetValues = currentTargetPreset->getValues();
-
+    
     targetSynth.setAllParamsWithoutSend(newTargetValues);
     
     doGuides(newStep.showsGuides, currentTargetPreset);
-
+    
     doHand(false, newStep.showsGuides, newStep.getTimeBetweenTicks()*4, newTargetValues);
     
     doIcons(newStep.showsIcons, currentTargetPreset);
-
-
+    
+    
     controlPanel->show();
-
+    
     displayInstructions("PREVIEW");
     showSeqNum(newStep.whichInSequence);
     oldTargetValues = newTargetValues;
@@ -346,17 +349,17 @@
 // lest setep of preview seq - plays moves back to neutral pos?
 void TrainingMessageOrganiser::previewLast(AnimStep newStep, Preset * currentTargetPreset){
     targetSynth.trigger();
-
+    
     // wrong?
     targetSynth.setAllParamsWithoutSend(currentTargetPreset->getValues());
     
     // your hand shows, we dont bother animating back to neutral!?
     doHand(true);
-
+    
     doIcons(newStep.showsIcons,currentTargetPreset);
     
     doGuides(newStep.showsGuides, currentTargetPreset);
-
+    
     showSeqNum(newStep.whichInSequence);
     displayInstructions("Preview FINISHED");
     // set candidate and sliders to neutral
@@ -366,40 +369,42 @@
 
 //-----------------------------------------------------------------------------
 void TrainingMessageOrganiser::matchingMove(AnimStep newStep, Preset * currentTargetPreset){
-
+    
     
     middlePanel->hide();
-
+    
     vector<int> newTargetValues = currentTargetPreset->getValues();
     eventLogger.logEvent(NEW_TARGET, newTargetValues);
     targetSynth.setAllParamsWithoutSend(newTargetValues);
-
+    
     // if showing guides show the hint hand
     doGuides(newStep.showsGuides, currentTargetPreset);
     
     doIcons(newStep.showsIcons, currentTargetPreset);
     
     doHand(true);
-
     
-    displayInstructions("MATCH IT");
+    if (newStep.showsGuides){
+        displayInstructions("MATCH THE GUIDES");
+    }else{
+        displayInstructions("MATCH WITHOUT GUIDES");
+    }
     showSeqNum(newStep.whichInSequence);
     // trigger where we're at at the moment
     triggerCandidateSound();
-
-
+    
+    
     oldTargetValues = newTargetValues;
     if (!newStep.showsGuides || !newStep.showsIcons){
         controlPanel->setColor(ofColor::red);
         // set sliders to default texture
         controlPanel->setIndicatorTexture(NULL);
         forgotButton->show();
-        forgotButton->turnOff(); // please
     }else{
-
+        
         controlPanel->setColor(ofColor::darkMagenta);
-
-
+        
+        
     }
 }
 //-----------------------------------------------------------------------------
@@ -418,7 +423,7 @@
     
     //displayInstructions("MATCHING FINISHED");
     showSeqNum(newStep.whichInSequence);
-
+    
     triggerCandidateSound();
     oldTargetValues = newTargetValues;
     if (!newStep.showsGuides || !newStep.showsIcons){
@@ -426,7 +431,6 @@
         // set sliders to default texture
         controlPanel->setIndicatorTexture(NULL);
         forgotButton->show();
-        forgotButton->turnOff(); // please
     }else{
         
         controlPanel->setColor(ofColor::darkMagenta);
@@ -455,8 +459,8 @@
     
     sequenceController.saveResultForCurrentStep(result);
     instructionPanel->setColor(result.colorBand);
-
-
+    
+    
     displayInstructions(result.displayText);
     
     showScoreNum(trainingScoreManager.getScore());
@@ -468,7 +472,7 @@
     
     // stick a colored number over target position
     controlPanel->flashResultLight(r.colorBand, r.timeAllowed*ofGetFrameRate()/6000.);
-
+    
     
 }
 
--- a/UI code/UIElement.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/UI code/UIElement.h	Mon Dec 08 18:29:10 2014 +0000
@@ -49,15 +49,16 @@
     virtual void setLabel(string label){
         labelName = label;
     }
+    string getLabel(){
+        return labelName;
+    }
     virtual void draw();
     void hide(){
         hidden = true;
-        on = false;
         
     };
     void show(){
         hidden = false;
-        on = true;
     
     };
     bool isShowing(){
@@ -126,6 +127,9 @@
     virtual void update(){
         
     }
+    void setOn(bool aon){
+        on = aon;
+    }
 protected:
 
     void init();
--- a/UI code/UIElement.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/UI code/UIElement.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -95,10 +95,12 @@
                 //cout << "Touchdown in area, grabbing focus " << labelName << " mytouchID: " << myTouchID << " finger ID: " << touchID << endl;
                 if (onlyOneTouchAllowed && atLeastOneTouchAlready()){
                     cout << "ignoring xtra touch" << endl;
+                    return false;
                 }else{
                     addTouchID(touchID);
+                    return true;
                 }
-                return true;
+                
 
             }else{
                 //shouldn't happen?
--- a/UI code/UIElementContainer.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/UI code/UIElementContainer.h	Mon Dec 08 18:29:10 2014 +0000
@@ -98,6 +98,37 @@
         }
         // TODO y set to centred
     }
+    
+    
+    void showHideElementWithName(string label, bool show){
+        
+        for( auto eit = subElements.begin(); eit < subElements.end(); eit++){
+            if( (*eit)->getLabel() == label ){
+                if (show){
+                    (*eit)->show();
+                }else{
+                    (*eit)->hide();
+                }
+            }
+        }
+    }
+    void showOnlyElementNamed(string label){
+        for( auto eit = subElements.begin(); eit < subElements.end(); eit++){
+            if( (*eit)->getLabel() == label ){
+                
+                (*eit)->show();
+            }else{
+                (*eit)->hide();
+            }
+        }
+    }
+    void showAllElements(){
+        for( auto eit = subElements.begin(); eit < subElements.end(); eit++){
+            
+            (*eit)->show();
+            
+        }
+    }
 private:
     void drawBorder();
     double cthickness;
--- a/UI code/buttonPanel.h	Fri Dec 05 18:36:05 2014 +0000
+++ b/UI code/buttonPanel.h	Mon Dec 08 18:29:10 2014 +0000
@@ -44,7 +44,15 @@
         subElements.push_back(aButton);
         autoArrangeRow();
     }
+    void turnAllButtonsOff(){
 
+            for( auto eit = subElements.begin(); eit < subElements.end(); eit++){
+                
+                (*eit)->setOn(false);
+                
+            }
+
+    }
 };
 
 #endif /* defined(__tweakathlon__buttonPanel__) */
--- a/testApp.mm	Fri Dec 05 18:36:05 2014 +0000
+++ b/testApp.mm	Mon Dec 08 18:29:10 2014 +0000
@@ -113,11 +113,19 @@
     expMessageOrganiser.mapButtonToAction(playCandidateButton, TRIGGER_CANDIDATE_ID);
     bottomButtonPanel->addButton(playCandidateButton);
 
+    
     Buttron * savePresetButton = new Buttron(props->buttonWidth*1.4,680, *props);
     savePresetButton->setLabel("SAVE/NEXT");
     expMessageOrganiser.mapButtonToAction(savePresetButton, SAVE_PRESET_HIT);
     bottomButtonPanel->addButton(savePresetButton);
     
+    
+    Buttron * menuButton = new Buttron(props->buttonWidth*1.4,680, *props);
+    menuButton->setLabel("MENU");
+    mapButtonToAction(menuButton, TO_MENU_ID);
+    //trainingMessageOrganiser.mapButtonToAction(menuButton, TO_MENU_ID);
+    bottomButtonPanel->addButton(menuButton);
+    
     expMessageOrganiser.setBottomPanel(bottomButtonPanel);
     UIElements.push_back(bottomButtonPanel);
     bottomButtonPanel->hide();
@@ -144,6 +152,7 @@
     UIElements.push_back(forgotButton);
     forgotButton->setMode(Buttron::TOGGLE);
     forgotButton->setXPosition(40);
+    forgotButton->hide();
     
     Buttron * playCandidateButton = new Buttron(props->buttonWidth*1.4,680, *props);
     playCandidateButton->setLabel("START RUN");