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.
Fork of SimpleGUI by
OKCancelDialog.cpp
00001 #include "OKCancelDialog.h" 00002 #include "BitmapWidget.h" 00003 #include "GreenTick_64x64_bmp.h" 00004 #include "RedCross_64x64_bmp.h" 00005 00006 OKCancelDialog::OKCancelDialog(GraphicsContext *context) : ContainerWidget(context) 00007 { 00008 00009 setLayout(FIXED); 00010 setSize( 00011 context->display()->width(), 00012 context->display()->height() 00013 ); 00014 00015 00016 BitmapWidget *apply = new BitmapWidget(context); 00017 apply->setBitmap(GreenTick_64x64_bmp, 64, 64); 00018 apply->setLocation( 00019 0, 00020 context->display()->height() - apply->height() 00021 ); 00022 attach(apply); 00023 00024 BitmapWidget *cancel = new BitmapWidget(context); 00025 cancel->setBitmap(RedCross_64x64_bmp, 64, 64); 00026 cancel->setLocation( 00027 context->display()->width() - cancel->width(), 00028 context->display()->height() - cancel->height() 00029 ); 00030 attach(cancel); 00031 00032 EventHandler *ok = new EventHandler(TOUCH_TAP, this, &OKCancelDialog::_handleOK); 00033 EventHandler *cancelled = new EventHandler(TOUCH_TAP, this, &OKCancelDialog::_handleCancel); 00034 apply->setEventHandler(ok); 00035 cancel->setEventHandler(cancelled); 00036 } 00037 00038 00039 void OKCancelDialog::_handleOK(Event e) { 00040 _onOK.call(e); 00041 } 00042 00043 void OKCancelDialog::_handleCancel(Event e) { 00044 _onCancel.call(e); 00045 }
Generated on Tue Jul 12 2022 22:27:14 by
