enum { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6 }; class FlatButton : public Pusher { public: Image img; Color fg, bg, hl; bool left; bool drawedge; bool highlight; FlatButton(); void DrawFrame(Draw &w, const Rect &r, Color lc, Color tc, Color rc, Color bc); virtual void Paint(Draw &w); virtual void MouseEnter(Point p, dword kflags) { Refresh(); Pusher::MouseEnter(p, kflags); } virtual void MouseLeave() { Refresh(); Pusher::MouseLeave(); } const Image& GetImage() { return img; } FlatButton& SetImage(const Image &_img) { img = _img; Refresh(); return *this; } FlatButton& SetLeft() { left = true; return *this; } FlatButton& SetRight() { left = false; return *this; } FlatButton& DrawEdge(bool b) { drawedge = b; return *this; } FlatButton& Highlight(bool b) { highlight = b;return *this; } }; class FlatSpin : public Ctrl { private: FlatButton left; FlatButton right; String text; Size tsz; Font font; bool selected; bool selectable; public: FlatSpin(); void SetText(const String& s); void SetTips(const char *tipl, const char *tipr); void SetCallbacks(const Event<>& cbl, const Event<>& cbr); FlatSpin& Selectable(bool b = true); int GetWidth(const String& s, bool with_buttons = true); int GetHeight(); void SetFont(const Font& fnt); void SetLeftImage(const Image &img) { left.SetImage(img); } void SetRightImage(const Image &img) { right.SetImage(img); } void SetHighlight(bool b) { left.Highlight(b); right.Highlight(b); } virtual void MouseMove(Point p, dword keyflags); virtual void MouseLeave(); virtual void LeftDown(Point p, dword keyflags); virtual void Layout(); virtual void Paint(Draw& w); virtual Image CursorImage(Point p, dword keyflags); typedef FlatSpin CLASSNAME; }; class PopUpCtrl : public Ctrl { protected: Image nbg; bool popup; public: PopUpCtrl() : popup(false) {} Event<> WhenPopDown; Event<> WhenDeactivate; virtual void Deactivate(); virtual Size ComputeSize() = 0; virtual void Reset() {} void PopUp(Ctrl *owner, const Rect& rt); Size GetPopUpSize() { return ComputeSize(); } bool IsPopUp() const; void SetPopUp(bool b = true); }; class Calendar : public PopUpCtrl { public: struct Style : ChStyle