view UI code/IconPanel.h @ 14:f83635861187

rewrote sequence controller. ticks show relevant UI modes. images show for preset textures (but greenish?)
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 21 Oct 2014 16:39:39 +0100
parents
children bd23c1b922be
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 setTextAndImage(string text, ofImage* image){
        setLabel(text);
        textureImage = image;
        hasBeenSet = true;
    }
    
    virtual bool handleMyTouch(int x, int y, touchType ttype, int touchID);
    
protected:

    ofImage* textureImage;
    bool hasBeenSet;
};


#endif /* defined(__riftathon__IconPanel__) */