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