Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGToolBar.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   25/02/98
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_TGToolBar
0013 #define ROOT_TGToolBar
0014 
0015 
0016 #include "TGFrame.h"
0017 
0018 class TGButton;
0019 class TGPictureButton;
0020 class TList;
0021 class TMap;
0022 
0023 struct ToolBarData_t {
0024    const char *fPixmap;
0025    const char *fTipText;
0026    Bool_t      fStayDown;
0027    Int_t       fId;
0028    TGButton   *fButton;
0029 };
0030 
0031 
0032 
0033 class TGToolBar : public TGCompositeFrame {
0034 
0035 protected:
0036    TList   *fPictures;      ///< list of pictures that should be freed
0037    TList   *fTrash;         ///< list of buttons and layout hints to be deleted
0038    TMap    *fMapOfButtons;  ///< map of button/id pairs in this group
0039 
0040 private:
0041    TGToolBar(const TGToolBar&) = delete;
0042    TGToolBar& operator=(const TGToolBar&) = delete;
0043 
0044 public:
0045    TGToolBar(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
0046              UInt_t options = kHorizontalFrame,
0047              Pixel_t back = GetDefaultFrameBackground());
0048    ~TGToolBar() override;
0049 
0050    virtual TGButton *AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing = 0);
0051    virtual TGButton *AddButton(const TGWindow *w, TGPictureButton *button, Int_t spacing = 0);
0052 
0053    virtual void ChangeIcon(ToolBarData_t *button, const char *new_icon);
0054    void Cleanup() override;
0055    virtual TGButton *GetButton(Int_t id) const;
0056    virtual Longptr_t GetId(TGButton *button) const;
0057    virtual void      SetId(TGButton *button, Longptr_t id);
0058 
0059    virtual void ButtonPressed();
0060    virtual void ButtonReleased();
0061    virtual void ButtonClicked();
0062 
0063    virtual void Pressed(Int_t id)  { Emit("Pressed(Int_t)",id); }   //*SIGNAL*
0064    virtual void Released(Int_t id) { Emit("Released(Int_t)",id);}   //*SIGNAL*
0065    virtual void Clicked(Int_t id)  { Emit("Clicked(Int_t)",id); }   //*SIGNAL*
0066 
0067    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0068 
0069    ClassDefOverride(TGToolBar,0)  //A bar containing picture buttons
0070 };
0071 
0072 #endif