class TabCtrl : public Ctrl { public: virtual bool Accept(); virtual void Paint(Draw& draw); virtual void CancelMode(); virtual void MouseMove(Point p, dword keyflags); virtual void LeftDown(Point p, dword keyflags); virtual void MouseLeave(); virtual bool Key(dword key, int count); virtual bool HotKey(dword key); virtual void Layout(); virtual Rect GetOpaqueRect() const; virtual Value GetData() const; virtual void SetData(const Value& data); public: class Item { TabCtrl *owner; int x; Point pictpos; Point textpos; int cx; String text; PaintRect pict; Ptr ctrl; bool enabled; Ptr slave; dword key; friend class TabCtrl; void Layout(int x, int y, int cy); void Paint(Draw& w, int state); int Right() const { return x + cx; } public: Item& Text(const String& _text); Item& Picture(PaintRect d); Item& SetImage(const UPP::Image& _im) { return Picture(PaintRect(ImageDisplay(), _im)); } Item& SetCtrl(Ctrl *_ctrl); Item& SetCtrl(Ctrl& c) { return SetCtrl(&c); } Item& Slave(Ctrl *_slave); Item& Key(dword _key) { key = _key; return *this; } Item& Enable(bool _en = true); Item& Disable() { return Enable(false); } bool IsEnabled() const { return enabled; } Ctrl *GetSlave() { return slave; } const Ctrl *GetSlave() const { return slave; } Ctrl *GetCtrl() { return ctrl; } const Ctrl *GetCtrl() const { return ctrl; } Item(); //deprecated: Item& Control(Ctrl *c) { return SetCtrl(c); } Item& Image(const UPP::Image& m) { return SetImage(m); } }; struct Style : ChStyle