00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGedPatternSelect
00013 #define ROOT_TGedPatternSelect
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef ROOT_TGButton
00044 #include "TGButton.h"
00045 #endif
00046 #ifndef ROOT_TGToolTip
00047 #include "TGToolTip.h"
00048 #endif
00049
00050
00051 class TGedPopup : public TGCompositeFrame {
00052
00053 protected:
00054 const TGWindow *fMsgWindow;
00055
00056 public:
00057 TGedPopup(const TGWindow* p, const TGWindow *m, UInt_t w, UInt_t h,
00058 UInt_t options = 0, Pixel_t back = GetDefaultFrameBackground());
00059 virtual ~TGedPopup() { }
00060
00061 virtual Bool_t HandleButton(Event_t *event);
00062 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00063 void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h);
00064 void EndPopup();
00065
00066 ClassDef(TGedPopup,0)
00067 };
00068
00069 class TGedPatternFrame : public TGFrame {
00070
00071 protected:
00072 const TGWindow *fMsgWindow;
00073 Bool_t fActive;
00074 Style_t fPattern;
00075 static TGGC *fgGC;
00076 TGToolTip *fTip;
00077 char fTipText[5];
00078
00079 virtual void DoRedraw();
00080
00081 public:
00082 TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width = 40,
00083 Int_t height = 20);
00084 virtual ~TGedPatternFrame() { delete fTip; }
00085
00086 virtual Bool_t HandleButton(Event_t *event);
00087 virtual Bool_t HandleCrossing(Event_t *event);
00088 virtual void DrawBorder();
00089
00090 void SetActive(Bool_t in) { fActive = in; gClient->NeedRedraw(this); }
00091 Style_t GetPattern() const { return fPattern; }
00092 static void SetFillStyle(TGGC* gc, Style_t fstyle);
00093
00094 ClassDef(TGedPatternFrame,0)
00095 };
00096
00097 class TGedPatternSelector : public TGCompositeFrame {
00098
00099 protected:
00100 Int_t fActive;
00101 const TGWindow *fMsgWindow;
00102 TGedPatternFrame *fCe[27];
00103
00104 public:
00105 TGedPatternSelector(const TGWindow *p);
00106 virtual ~TGedPatternSelector();
00107
00108 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00109 void SetActive(Int_t newat);
00110 Int_t GetActive() const { return fActive; }
00111
00112 ClassDef(TGedPatternSelector,0)
00113 };
00114
00115 class TGedPatternPopup : public TGedPopup {
00116
00117 protected:
00118 Style_t fCurrentPattern;
00119
00120 public:
00121 TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern);
00122 virtual ~TGedPatternPopup();
00123
00124 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00125
00126 ClassDef(TGedPatternPopup,0)
00127 };
00128
00129 class TGedSelect : public TGCheckButton {
00130
00131 protected:
00132 TGGC *fDrawGC;
00133 TGedPopup *fPopup;
00134
00135 virtual void DoRedraw();
00136 void DrawTriangle(GContext_t gc, Int_t x, Int_t y);
00137
00138 public:
00139 TGedSelect(const TGWindow *p, Int_t id);
00140 virtual ~TGedSelect();
00141
00142 virtual Bool_t HandleButton(Event_t *event);
00143
00144 virtual void Enable();
00145 virtual void Disable();
00146 virtual void SetPopup(TGedPopup* p) { fPopup = p; }
00147
00148 ClassDef(TGedSelect,0)
00149 };
00150
00151 class TGedPatternSelect : public TGedSelect {
00152
00153 protected:
00154 Style_t fPattern;
00155
00156 virtual void DoRedraw();
00157
00158 public:
00159 TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id);
00160 virtual ~TGedPatternSelect() {}
00161
00162 void SetPattern(Style_t pattern, Bool_t emit=kTRUE);
00163 Style_t GetPattern() const { return fPattern; }
00164 virtual TGDimension GetDefaultSize() const { return TGDimension(55, 21); }
00165 virtual void PatternSelected(Style_t pattern = 0)
00166 { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); }
00167 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00168 virtual void SavePrimitive(ostream &out, Option_t * = "");
00169
00170 ClassDef(TGedPatternSelect,0)
00171 };
00172
00173 #endif