ultimatepp/uppsrc/CtrlLib/DisplayPopup.h
2023-03-28 11:36:05 +02:00

54 lines
1.2 KiB
C++

class DisplayPopup : public Pte<DisplayPopup> {
private:
struct Pop : Pte<Pop> {
struct PopCtrl : public Ctrl {
virtual void Paint(Draw& w);
struct Pop *p;
};
Ptr<Ctrl> ctrl;
Rect item;
Value value;
Color paper, ink;
dword style;
const Display *display;
int margin;
bool usedisplaystdsize = false;
PopCtrl view;
PopCtrl frame;
Callback WhenClose;
void Set(Ctrl *ctrl, const Rect& item, const Value& v, const Display *display,
Color ink, Color paper, dword style, int margin = 0);
void Sync();
static Vector<Pop *>& all();
Pop();
~Pop();
};
One<Pop> popup;
bool usedisplaystdsize = false;
static bool StateHook(Ctrl *, int reason);
static bool MouseHook(Ctrl *, bool, int, Point, int, dword);
static void SyncAll();
typedef DisplayPopup CLASSNAME;
public:
void Set(Ctrl *ctrl, const Rect& item, const Value& v, const Display *display,
Color ink, Color paper, dword style, int margin = 0);
void Cancel();
bool IsOpen();
bool HasMouse();
void UseDisplayStdSize();
DisplayPopup();
~DisplayPopup();
};