Lab4
Dependencies: SeeedStudioTFTv2 TFT_fonts mbed
Fork of Seeed_TFT_Touch_Shield by
Diff: Button.cpp
- Revision:
- 4:ebcf8d366b91
- Child:
- 6:ebffa73d4f95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Button.cpp Fri Sep 26 12:40:19 2014 +0000 @@ -0,0 +1,25 @@ +#include "Button.h" +#include "Arial24x23.h" +#include "Arial12x12.h" + +Button::Button(char* label, int p_color, int bd_color):Panel(p_color, bd_color, 1, 1, 1 , 1){ + lbl = label; +} + +Button::Button(char* label, int p_color, int bd_color, int w, int h):Panel(p_color, bd_color, w, h, 1 , 1){ + lbl = label; +} + +void Button::paint(){ + Panel::paint(); + TFT.background(DarkGrey); + TFT.foreground(Black); + TFT.set_font((unsigned char*) Arial12x12); + TFT.locate(x0+8,y0+12); + TFT.printf(lbl); +} + +void Button::trigger_action(ActionType type, ActionEvent evnt){ + //do something + +} \ No newline at end of file