22 #include "Environment.h" 42 Dialog(
const __FlashStringHelper * caption,
int left,
int top,
int width,
int height):
Window(caption,left,top,width,height)
46 _dialogClosedEventReceiver=NULL;
61 Dialog(
int left,
int top,
int width,
int height):
Window(F(
"Dialog"),left,top,width,height)
65 _dialogClosedEventReceiver=NULL;
72 _dialogClosedEventReceiver=receiver;
77 if(window!=NULL && (window == _btnOK || window == _btnCancel))
79 if(_dialogClosedEventReceiver!=NULL)
81 _dialogClosedEventReceiver->
NotifyDialogClosed(
this,window == _btnOK?IDialogClosedEventReceiver::OK:IDialogClosedEventReceiver::Cancel);
virtual void DoControlMessage(Window *window)=0
Need to be redefinded in derived class.
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
virtual void NotifyDialogClosed(Window *window, DialogResults results)=0
Has to be implemented in target class.
void SetFont(uint8_t *font)
Sets font.
Definition: TextBox.h:64
Button * _btnCancel
Button Cancel has to be initialized in derived class.
Definition: Dialog.h:32
static Environment * Get()
Returns singltone instance of environment.
Definition: Environment.h:44
void RegisterEndDialogEventReceiver(IDialogClosedEventReceiver *receiver)
Registers extern interface that will be called if dialog is closed.
Definition: Dialog.h:70
Dialog(int left, int top, int width, int height)
Constructor for dialog without caption.
Definition: Dialog.h:61
Button * _btnOK
Button OK has to be initialized in derived class.
Definition: Dialog.h:30
Base class for dialog objects. See Dialogs example Provides basic window functionality.
Definition: Dialog.h:25
void NotifyTouch(Window *window)
Process touch notifications.
Definition: Dialog.h:75
void AddChild(Window *window)
Adds window child window.
Definition: Window.h:194
Interface that provides dialog closed notifications (user closes dialog window, by pressing OK or can...
Definition: IDialogClosedEventReceiver.h:24
virtual void SetDecorators(DecoratorList *decorators)
Sets window decorators list.
Definition: Window.h:76
Dialog(const __FlashStringHelper *caption, int left, int top, int width, int height)
Constructor for dialog with caption.
Definition: Dialog.h:42
Interface that provides screen touch notifications. If you want receive this notification in the targ...
Definition: ITouchEventReceiver.h:24
void SetMargins(int offset_x, int offset_y)
Defines offset from left and top for text.
Definition: TextBox.h:58