Warning, file /include/root/TGedPatternSelect.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGedPatternSelect
0013 #define ROOT_TGedPatternSelect
0014
0015
0016 #include "TGButton.h"
0017 #include "TGToolTip.h"
0018
0019
0020 class TGedPopup : public TGCompositeFrame {
0021
0022 protected:
0023 const TGWindow *fMsgWindow;
0024
0025 public:
0026 TGedPopup(const TGWindow* p, const TGWindow *m, UInt_t w, UInt_t h,
0027 UInt_t options = 0, Pixel_t back = GetDefaultFrameBackground());
0028 ~TGedPopup() override { }
0029
0030 Bool_t HandleButton(Event_t *event) override;
0031 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0032 void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h);
0033 void EndPopup();
0034
0035 ClassDefOverride(TGedPopup,0)
0036 };
0037
0038 class TGedPatternFrame : public TGFrame {
0039
0040 protected:
0041 const TGWindow *fMsgWindow;
0042 Bool_t fActive;
0043 Style_t fPattern;
0044 static TGGC *fgGC;
0045 TGToolTip *fTip;
0046 char fTipText[7];
0047
0048 void DoRedraw() override;
0049
0050 public:
0051 TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width = 40,
0052 Int_t height = 20);
0053 ~TGedPatternFrame() override { delete fTip; }
0054
0055 Bool_t HandleButton(Event_t *event) override;
0056 Bool_t HandleCrossing(Event_t *event) override;
0057 void DrawBorder() override;
0058
0059 void SetActive(Bool_t in) { fActive = in; gClient->NeedRedraw(this); }
0060 Style_t GetPattern() const { return fPattern; }
0061 static void SetFillStyle(TGGC* gc, Style_t fstyle);
0062
0063 ClassDefOverride(TGedPatternFrame,0)
0064 };
0065
0066 class TGedPatternSelector : public TGCompositeFrame {
0067
0068 protected:
0069 Int_t fActive;
0070 const TGWindow *fMsgWindow;
0071 TGedPatternFrame *fCe[27];
0072
0073 public:
0074 TGedPatternSelector(const TGWindow *p);
0075 ~TGedPatternSelector() override;
0076
0077 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0078 void SetActive(Int_t newat);
0079 Int_t GetActive() const { return fActive; }
0080
0081 ClassDefOverride(TGedPatternSelector,0)
0082 };
0083
0084 class TGedPatternPopup : public TGedPopup {
0085
0086 protected:
0087 Style_t fCurrentPattern;
0088
0089 public:
0090 TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern);
0091 ~TGedPatternPopup() override;
0092
0093 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0094
0095 ClassDefOverride(TGedPatternPopup,0)
0096 };
0097
0098 class TGedSelect : public TGCheckButton {
0099
0100 protected:
0101 TGGC *fDrawGC;
0102 TGedPopup *fPopup;
0103
0104 void DoRedraw() override;
0105 void DrawTriangle(GContext_t gc, Int_t x, Int_t y);
0106
0107 public:
0108 TGedSelect(const TGWindow *p, Int_t id);
0109 ~TGedSelect() override;
0110
0111 Bool_t HandleButton(Event_t *event) override;
0112
0113 virtual void Enable();
0114 virtual void Disable();
0115 virtual void SetPopup(TGedPopup* p) { fPopup = p; }
0116
0117 ClassDefOverride(TGedSelect,0)
0118 };
0119
0120 class TGedPatternSelect : public TGedSelect {
0121
0122 protected:
0123 Style_t fPattern;
0124
0125 void DoRedraw() override;
0126
0127 public:
0128 TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id);
0129 ~TGedPatternSelect() override {}
0130
0131 void SetPattern(Style_t pattern, Bool_t emit=kTRUE);
0132 Style_t GetPattern() const { return fPattern; }
0133 TGDimension GetDefaultSize() const override { return TGDimension(55, 21); }
0134 virtual void PatternSelected(Style_t pattern = 0)
0135 { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); }
0136 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0137 void SavePrimitive(std::ostream &out, Option_t * = "") override;
0138
0139 ClassDefOverride(TGedPatternSelect,0)
0140 };
0141
0142 #endif