Lab4
Dependencies: SeeedStudioTFTv2 TFT_fonts mbed
Fork of Seeed_TFT_Touch_Shield by
Button.cpp
- Committer:
- uswickra
- Date:
- 2014-09-26
- Revision:
- 4:ebcf8d366b91
- Child:
- 6:ebffa73d4f95
File content as of revision 4:ebcf8d366b91:
#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 }