view UI code/IconPanel.h @ 28:953db6518738

leap version more or less there, needs btter results feedback but thats detail. "no movement" bit is stupid cos peopel can move their hand. light flash not work.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Thu, 30 Oct 2014 18:35:00 +0000
parents bd23c1b922be
children
line wrap: on
line source
//
//  IconPanel.h
//  riftathon
//
//  Created by Robert Tubb on 20/10/2014.
//
//

#ifndef __riftathon__IconPanel__
#define __riftathon__IconPanel__

#include <iostream>

#include <iostream>
#include "ofMain.h"
#include "UIElement.h"
#include "UIProperties.h"

class IconPanel : public UIElement{
    
public:

    float thickness; // width of border
    float radius;   // inner radius of corners, reccomended to be same as thickness
    ofColor foregroundHi;
    ofColor backgroundHi;
    ofColor foregroundLo;
    ofColor backgroundLo;
    ofColor fgInactive;
    
    bool pressed; // on and pressed can be different
    
    IconPanel();
    ~IconPanel(){};
    
    // this constructor sets up with defaults obtained from UIProperties (recoomemnded)

    IconPanel(float x,
            float y,
            float width,
            float height,
            const UIProps& props
            );
       void draw();
    void drawOutline();
    void drawTextLabel();
    void drawTexture();
    void drawTick();
    void drawCross();
    void setTextAndImage(string text, ofImage* image, bool isFilled){
        setLabel(text);
        textureImage = image;
        hasBeenSet = true;
        showTick = isFilled;
    }
    
    virtual bool handleMyTouch(int x, int y, touchType ttype, int touchID);
    
protected:

    ofImage* textureImage;
    bool hasBeenSet;
    bool showTick;
    bool showCross;
};


#endif /* defined(__riftathon__IconPanel__) */