00001
00002
00003
00004
00005 #ifndef _GTABVIEW_H_
00006 #define _GTABVIEW_H_
00007
00008
00009 class GTabPage;
00010 typedef List<GTabPage> TabPageList;
00011
00013 class LgiClass GTabView :
00014 public GLayout,
00015 public ResObject
00016 {
00017 friend class GTabPage;
00018 class GTabViewPrivate *d;
00019 int TabY();
00020
00021 public:
00023 GTabView( int id = -1,
00024 int x = 0,
00025 int y = 0,
00026 int cx = 1000,
00027 int cy = 1000,
00028 const char *name = 0,
00029 int Init = 0);
00030 ~GTabView();
00031
00032 const char *GetClass() { return "GTabView"; }
00033
00035 int64 Value();
00037 void Value(int64 i);
00038
00039 bool GetPourChildren();
00040 void SetPourChildren(bool b);
00041
00043 bool Append(GTabPage *Page, int Where = -1);
00045 GTabPage *Append(const char *name, int Where = -1);
00047 bool Delete(GTabPage *Page);
00048
00050 GTabPage *TabAt(int i);
00052 GTabPage *GetCurrent();
00054 int GetTabs();
00055
00056
00057 bool Attach(GViewI *parent);
00058 int OnEvent(GMessage *Msg);
00059 GViewI *FindControl(int Id);
00060 int OnNotify(GViewI *Ctrl, int Flags);
00061 void OnChildrenChanged(GViewI *Wnd, bool Attaching);
00062 GRect &GetTabClient();
00063
00064 #if defined WIN32
00065 GViewI *FindControl(HWND hCtrl);
00066 #endif
00067
00068 void OnPosChange();
00069 void OnPaint(GSurface *pDC);
00070 void OnMouseClick(GMouse &m);
00071 bool OnKey(GKey &k);
00072 void OnFocus(bool f);
00073 void OnCreate();
00074 };
00075
00076 class LgiClass GTabPage :
00077 public GView,
00078 public GLgiRes,
00079 public ResObject
00080 {
00081 friend class GTabView;
00082
00083
00084 GTabView *TabCtrl;
00085 GRect TabPos;
00086
00087
00088 void PaintTab(GSurface *pDC, bool Selected);
00089 bool Attach(GViewI *parent);
00090
00091 public:
00092 GTabPage(const char *name);
00093 ~GTabPage();
00094
00095 const char *GetClass() { return "GTabPage"; }
00096
00097 char *Name();
00098 bool Name(const char *n);
00099 GTabView *GetTabControl() { return TabCtrl; }
00100
00101 int OnEvent(GMessage *Msg);
00102 void OnPaint(GSurface *pDC);
00103 bool OnKey(GKey &k);
00104 void OnFocus(bool b);
00105
00106 void Append(GViewI *Wnd);
00107 bool Remove(GViewI *Wnd);
00108 bool LoadFromResource(int Resource);
00109 };
00110
00111 #endif