Warning, file /include/root/TGShutter.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_TGShutter
0013 #define ROOT_TGShutter
0014
0015
0016 #include "TGFrame.h"
0017 #include "TGCanvas.h"
0018 #include "TGWidget.h"
0019
0020 class TGButton;
0021 class TGCanvas;
0022 class TTimer;
0023 class TList;
0024
0025 class TGShutterItem : public TGVerticalFrame, public TGWidget {
0026
0027 friend class TGShutter;
0028
0029 protected:
0030 TGButton *fButton;
0031 TGCanvas *fCanvas;
0032 TGFrame *fContainer;
0033 TGLayoutHints *fL1, *fL2;
0034
0035 private:
0036 TGShutterItem(const TGShutterItem&) = delete;
0037 TGShutterItem& operator=(const TGShutterItem&) = delete;
0038
0039 public:
0040 TGShutterItem(const TGWindow *p = nullptr, TGHotString *s = nullptr, Int_t id = -1,
0041 UInt_t options = 0);
0042 ~TGShutterItem() override;
0043
0044 TGButton *GetButton() const { return fButton; }
0045 TGFrame *GetContainer() const { return fCanvas->GetContainer(); }
0046 virtual void Selected() { Emit(" Selected()"); }
0047
0048 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0049
0050 ClassDefOverride(TGShutterItem,0)
0051 };
0052
0053
0054
0055 class TGShutter : public TGCompositeFrame {
0056
0057 protected:
0058 TTimer *fTimer;
0059 TGShutterItem *fSelectedItem;
0060 TGShutterItem *fClosingItem;
0061 TList *fTrash;
0062 Int_t fHeightIncrement;
0063 Int_t fClosingHeight;
0064 Int_t fClosingHadScrollbar;
0065 UInt_t fDefWidth;
0066 UInt_t fDefHeight;
0067
0068 private:
0069 TGShutter(const TGShutter&) = delete;
0070 TGShutter& operator=(const TGShutter&) = delete;
0071
0072 public:
0073 TGShutter(const TGWindow *p = nullptr, UInt_t options = kSunkenFrame);
0074 ~TGShutter() override;
0075
0076 virtual void AddItem(TGShutterItem *item);
0077 virtual void RemoveItem(const char *name);
0078 virtual TGShutterItem *AddPage(const char *item = "Page");
0079 virtual void RemovePage();
0080 virtual void RenamePage(const char *name);
0081 Bool_t HandleTimer(TTimer *t) override;
0082 void Layout() override;
0083 void SetLayoutManager(TGLayoutManager*) override { }
0084 TGShutterItem *GetSelectedItem() const { return fSelectedItem; }
0085 TGShutterItem *GetItem(const char *name);
0086 virtual void SetSelectedItem(TGShutterItem *item);
0087 virtual void SetSelectedItem(const char *name);
0088 virtual void EnableItem(const char *name, Bool_t on = kTRUE);
0089
0090 TGDimension GetDefaultSize() const override;
0091 virtual void SetDefaultSize(UInt_t w, UInt_t h);
0092
0093 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0094
0095 Bool_t ProcessMessage(Longptr_t cmd, Longptr_t parm1, Longptr_t parm2) override;
0096 virtual void Selected(TGShutterItem *item) { Emit(" Selected(TGShutterItem*)", item); }
0097
0098 ClassDefOverride(TGShutter,0)
0099 };
0100
0101 #endif