Mercurial > hg > tweakathon2ios
annotate UI code/IconPanel.h @ 52:89944ab3e129 tip
fix oF linker errors ios8
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 03 Feb 2015 13:18:23 +0000 |
parents | 953db6518738 |
children |
rev | line source |
---|---|
rt300@14 | 1 // |
rt300@14 | 2 // IconPanel.h |
rt300@14 | 3 // riftathon |
rt300@14 | 4 // |
rt300@14 | 5 // Created by Robert Tubb on 20/10/2014. |
rt300@14 | 6 // |
rt300@14 | 7 // |
rt300@14 | 8 |
rt300@14 | 9 #ifndef __riftathon__IconPanel__ |
rt300@14 | 10 #define __riftathon__IconPanel__ |
rt300@14 | 11 |
rt300@14 | 12 #include <iostream> |
rt300@14 | 13 |
rt300@14 | 14 #include <iostream> |
rt300@14 | 15 #include "ofMain.h" |
rt300@14 | 16 #include "UIElement.h" |
rt300@14 | 17 #include "UIProperties.h" |
rt300@14 | 18 |
rt300@14 | 19 class IconPanel : public UIElement{ |
rt300@14 | 20 |
rt300@14 | 21 public: |
rt300@14 | 22 |
rt300@14 | 23 float thickness; // width of border |
rt300@14 | 24 float radius; // inner radius of corners, reccomended to be same as thickness |
rt300@14 | 25 ofColor foregroundHi; |
rt300@14 | 26 ofColor backgroundHi; |
rt300@14 | 27 ofColor foregroundLo; |
rt300@14 | 28 ofColor backgroundLo; |
rt300@14 | 29 ofColor fgInactive; |
rt300@14 | 30 |
rt300@14 | 31 bool pressed; // on and pressed can be different |
rt300@14 | 32 |
rt300@14 | 33 IconPanel(); |
rt300@14 | 34 ~IconPanel(){}; |
rt300@14 | 35 |
rt300@14 | 36 // this constructor sets up with defaults obtained from UIProperties (recoomemnded) |
rt300@14 | 37 |
rt300@14 | 38 IconPanel(float x, |
rt300@14 | 39 float y, |
rt300@14 | 40 float width, |
rt300@14 | 41 float height, |
rt300@14 | 42 const UIProps& props |
rt300@14 | 43 ); |
rt300@14 | 44 void draw(); |
rt300@14 | 45 void drawOutline(); |
rt300@14 | 46 void drawTextLabel(); |
rt300@14 | 47 void drawTexture(); |
rt300@19 | 48 void drawTick(); |
rt300@19 | 49 void drawCross(); |
rt300@19 | 50 void setTextAndImage(string text, ofImage* image, bool isFilled){ |
rt300@14 | 51 setLabel(text); |
rt300@14 | 52 textureImage = image; |
rt300@14 | 53 hasBeenSet = true; |
rt300@19 | 54 showTick = isFilled; |
rt300@14 | 55 } |
rt300@14 | 56 |
rt300@14 | 57 virtual bool handleMyTouch(int x, int y, touchType ttype, int touchID); |
rt300@14 | 58 |
rt300@14 | 59 protected: |
rt300@14 | 60 |
rt300@14 | 61 ofImage* textureImage; |
rt300@14 | 62 bool hasBeenSet; |
rt300@19 | 63 bool showTick; |
rt300@28 | 64 bool showCross; |
rt300@14 | 65 }; |
rt300@14 | 66 |
rt300@14 | 67 |
rt300@14 | 68 #endif /* defined(__riftathon__IconPanel__) */ |