My Project
 
Loading...
Searching...
No Matches
toast.h
Go to the documentation of this file.
1#pragma once
2
3#include "component.h"
4#include "simplebutton.h"
5
6class NinePatch;
7class BitmapText;
8
9class Toast :public Component{
10private:
11 class SimpleButtonNew :public SimpleButton{
12 public:
13 Toast* t;
14 SimpleButtonNew(Toast* tp, Image* img) :SimpleButton(img),t(tp){}
15 protected:
16 virtual void onClick() { t->onClose(); };
17 };
18 static const int MARGIN_HOR = 2;
19 static const int MARGIN_VER = 2;
20
21protected:
22 NinePatch* bg;
24 BitmapText* text;
25
26 virtual void createChildren();
27 virtual void layout();
28
29 virtual void onClose() {};
30public:
31 Toast(const std::string& text);
32 void Text(const std::string& txt);
33};
Definition simplebutton.h:8
SimpleButton(Image *image)
Definition simplebutton.cpp:5
NinePatch * bg
Definition toast.h:22
virtual void layout()
Definition toast.cpp:20
void Text(const std::string &txt)
Definition toast.cpp:47
SimpleButton * close
Definition toast.h:23
BitmapText * text
Definition toast.h:24
Toast(const std::string &text)
Definition toast.cpp:37
virtual void onClose()
Definition toast.h:29
virtual void createChildren()
Definition toast.cpp:7