Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TouchScreenGUIDemo
Diff: Dialogs/SpinnerDialog.cpp
- Revision:
- 14:e6515b19f5a0
- Parent:
- 13:6714534e7974
- Child:
- 15:e69fd74d42e4
--- a/Dialogs/SpinnerDialog.cpp Sat May 21 14:40:09 2016 +0000 +++ b/Dialogs/SpinnerDialog.cpp Sat May 21 16:36:02 2016 +0000 @@ -1,52 +1,14 @@ #include "SpinnerDialog.h" -#include "GreenTick_64x64_bmp.h" -#include "RedCross_64x64_bmp.h" - -SpinnerDialog::SpinnerDialog(GraphicsContext *context) : ContainerWidget(context) +SpinnerDialog::SpinnerDialog(GraphicsContext *context) : OKCancelDialog(context) { - setLayout(FIXED); - setSize( - context->display()->width(), - context->display()->height() - ); - - // Now add a Spinner and apply/cancel buttons + // Now add a Spinner _spinner = new SpinnerWidget(context); _spinner->setLocation(0,0); attach(_spinner); - - BitmapWidget *apply = new BitmapWidget(context); - apply->setBitmap(GreenTick_64x64_bmp, 64, 64); - apply->setLocation( - 0, - context->display()->height() - apply->height() - ); - attach(apply); - - BitmapWidget *cancel = new BitmapWidget(context); - cancel->setBitmap(RedCross_64x64_bmp, 64, 64); - cancel->setLocation( - context->display()->width() - cancel->width(), - context->display()->height() - cancel->height() - ); - attach(cancel); - - EventHandler *ok = new EventHandler(TOUCH_TAP, this, &SpinnerDialog::_handleOK); - EventHandler *cancelled = new EventHandler(TOUCH_TAP, this, &SpinnerDialog::_handleCancel); - apply->setEventHandler(ok); - cancel->setEventHandler(cancelled); } SpinnerWidget *SpinnerDialog::spinner() { return _spinner; } - -void SpinnerDialog::_handleOK(Event e) { - _onOK.call(e); -} - -void SpinnerDialog::_handleCancel(Event e) { - _onCancel.call(e); -} \ No newline at end of file