00001
00002
00003
00004
00005 #ifndef __GPOPUP_H
00006 #define __GPOPUP_H
00007
00009 class LgiClass GPopup :
00010 public GView
00011 {
00012 friend class _QPopup;
00013 friend class GWindow;
00014 friend class GDropDown;
00015 friend class GMouseHook;
00016 friend class GMouseHookPrivate;
00017
00018 #ifdef __GTK_H__
00019 Gtk::GtkWidget *Wnd;
00020 #endif
00021
00022
00023 protected:
00024 class GPopupPrivate *d;
00025 bool Cancelled;
00026 GView *Owner;
00027 int64 Start;
00028
00029 public:
00030 GPopup(GView *owner);
00031 ~GPopup();
00032
00033 const char *GetClass() { return "GPopup"; }
00034 bool GetCancelled() { return Cancelled; }
00035 bool Attach(GViewI *p);
00036 void Visible(bool i);
00037 bool Visible();
00038
00039 #if defined(MAC)
00040 bool SetPos(GRect &p, bool Repaint = false);
00041 GRect &GetPos();
00042 #endif
00043 };
00044
00046 class LgiClass GDropDown : public GLayout
00047 {
00048 friend class GPopup;
00049
00050 GPopup *Popup;
00051
00052 public:
00053 GDropDown(int Id, int x, int y, int cx, int cy, GPopup *popup);
00054 ~GDropDown();
00055
00056
00057 bool IsOpen();
00058 void SetPopup(GPopup *popup);
00059 GPopup *GetPopup();
00060
00061
00062 void OnFocus(bool f);
00063 void OnPaint(GSurface *pDC);
00064 bool OnKey(GKey &k);
00065 void OnMouseClick(GMouse &m);
00066 int OnNotify(GViewI *c, int f);
00067
00068
00069 virtual void Activate();
00070 virtual void OnPopupClose() {}
00071 };
00072
00074 class GMouseHook
00075 {
00076 class GMouseHookPrivate *d;
00077 public:
00078 GMouseHook();
00079 ~GMouseHook();
00080
00081 void RegisterPopup(class GPopup *p);
00082 void UnregisterPopup(class GPopup *p);
00083 bool OnViewKey(GView *v, GKey &k);
00084
00085 #ifdef WIN32
00086 static LRESULT CALLBACK MouseProc(int Code, WPARAM a, LPARAM b);
00087 #endif
00088 };
00089
00090
00091
00092
00093 #endif