TGToolBar.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGToolBar.h 23115 2008-04-10 13:35:37Z rdm $
00002 // Author: Fons Rademakers   25/02/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGToolBar
00013 #define ROOT_TGToolBar
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGToolBar                                                            //
00019 //                                                                      //
00020 // A toolbar is a composite frame that contains TGPictureButtons.       //
00021 // Often used in combination with a TGHorizontal3DLine.                 //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TGFrame
00026 #include "TGFrame.h"
00027 #endif
00028 
00029 class TGButton;
00030 class TGPictureButton;
00031 class TList;
00032 class TMap;
00033 
00034 struct ToolBarData_t {
00035    const char *fPixmap;
00036    const char *fTipText;
00037    Bool_t      fStayDown;
00038    Int_t       fId;
00039    TGButton   *fButton;
00040 };
00041 
00042 
00043 
00044 class TGToolBar : public TGCompositeFrame {
00045 
00046 protected:
00047    TList   *fPictures;      // list of pictures that should be freed
00048    TList   *fTrash;         // list of buttons and layout hints to be deleted
00049    TMap    *fMapOfButtons;  // map of button/id pairs in this group
00050 
00051 private:
00052    TGToolBar(const TGToolBar&);              // not implemented
00053    TGToolBar& operator=(const TGToolBar&);   // not implemented
00054 
00055 public:
00056    TGToolBar(const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1,
00057              UInt_t options = kHorizontalFrame,
00058              Pixel_t back = GetDefaultFrameBackground());
00059    virtual ~TGToolBar();
00060 
00061    virtual TGButton *AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing = 0);
00062    virtual TGButton *AddButton(const TGWindow *w, TGPictureButton *button, Int_t spacing = 0);
00063 
00064    virtual void ChangeIcon(ToolBarData_t *button, const char *new_icon);
00065    virtual void Cleanup();
00066    virtual TGButton *GetButton(Int_t id) const;
00067    virtual Long_t    GetId(TGButton *button) const;
00068    virtual void      SetId(TGButton *button, Long_t id);
00069 
00070    virtual void ButtonPressed();
00071    virtual void ButtonReleased();
00072    virtual void ButtonClicked();
00073 
00074    virtual void Pressed(Int_t id)  { Emit("Pressed(Int_t)",id); }   //*SIGNAL*
00075    virtual void Released(Int_t id) { Emit("Released(Int_t)",id);}   //*SIGNAL*
00076    virtual void Clicked(Int_t id)  { Emit("Clicked(Int_t)",id); }   //*SIGNAL*
00077 
00078    virtual void   SavePrimitive(ostream &out, Option_t *option = "");
00079 
00080    ClassDef(TGToolBar,0)  //A bar containing picture buttons
00081 };
00082 
00083 #endif

Generated on Tue Jul 5 14:20:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1