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
Dialogs/SpinnerDialog.cpp
- Committer:
- duncanFrance
- Date:
- 2016-05-21
- Revision:
- 13:6714534e7974
- Child:
- 14:e6515b19f5a0
File content as of revision 13:6714534e7974:
#include "SpinnerDialog.h" #include "GreenTick_64x64_bmp.h" #include "RedCross_64x64_bmp.h" SpinnerDialog::SpinnerDialog(GraphicsContext *context) : ContainerWidget(context) { setLayout(FIXED); setSize( context->display()->width(), context->display()->height() ); // Now add a Spinner and apply/cancel buttons _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); }