Back to home page

EIC code displayed by LXR

 
 

    


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 // @(#)root/gui:$Id$
0002 // Author: Fons Rademakers   18/9/2000
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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;     ///< shutter item button
0031    TGCanvas      *fCanvas;     ///< canvas of shutter item
0032    TGFrame       *fContainer;  ///< container in canvas containing shutter items
0033    TGLayoutHints *fL1, *fL2;   ///< positioning hints
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()"); } //*SIGNAL*
0047 
0048    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0049 
0050    ClassDefOverride(TGShutterItem,0)  // Shutter widget item
0051 };
0052 
0053 
0054 
0055 class TGShutter : public TGCompositeFrame {
0056 
0057 protected:
0058    TTimer         *fTimer;                  ///< Timer for animation
0059    TGShutterItem  *fSelectedItem;           ///< Item currently open
0060    TGShutterItem  *fClosingItem;            ///< Item closing down
0061    TList          *fTrash;                  ///< Items that need to be cleaned up
0062    Int_t           fHeightIncrement;        ///< Height delta
0063    Int_t           fClosingHeight;          ///< Closing items current height
0064    Int_t           fClosingHadScrollbar;    ///< Closing item had a scroll bar
0065    UInt_t          fDefWidth;               ///< Default width
0066    UInt_t          fDefHeight;              ///< Default height
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"); //*MENU*
0079    virtual void   RemovePage();                    //*MENU*
0080    virtual void   RenamePage(const char *name);    //*MENU*
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); } //*SIGNAL*
0097 
0098    ClassDefOverride(TGShutter,0)  // Shutter widget
0099 };
0100 
0101 #endif