Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Diff: Widgets/TextWidget.cpp
- Revision:
- 4:27546fb8b670
- Parent:
- 3:cb004f59b715
- Child:
- 7:303850a4b30c
--- a/Widgets/TextWidget.cpp Sun Mar 27 14:41:31 2016 +0000 +++ b/Widgets/TextWidget.cpp Sun Mar 27 15:37:32 2016 +0000 @@ -33,43 +33,3 @@ _display->copy_to_lcd(); } - -/** -void TextWidget::draw() -{ - - int right = _x + _width; // right side of clipping window - int bottom = _y + _height; // bottom edge of clipping window - - int _cx = _x; - // Start drawing characters at top left - int _cy = _y; - - char c; - char *p = _text; - - _display->foreground(_fg); - _display->background(_bg); - _display->set_font(_font->_font); - - - while(*p != NULL) { - c = *p; - p++; - if(c=='\n') { - _cy = _cy + _font->_height; - _cx = _x; - } else { - // Only draw the character if it is not clipped - if( (_cx+_font->_width) < right && (_cy +_font->_height) < bottom) { - _display->character(_cx, _cy, c); - _cx += _font->widthOf(c); - } - } - } -} -**/ -bool TextWidget::isEventTarget(Event e) -{ - return e.screenX < (_x+_width) && _x <= e.screenX && e.screenY < (_y+_height) && _y <= e.screenY; -} \ No newline at end of file