Mercurial > hg > tweakathon2ios
view UI code/IconPanel.h @ 22:8124f46eda65
pretty much working.
ugly though.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Thu, 23 Oct 2014 18:15:46 +0100 |
parents | bd23c1b922be |
children | 953db6518738 |
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; }; #endif /* defined(__riftathon__IconPanel__) */