TGIcon.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGIcon.h 23115 2008-04-10 13:35:37Z rdm $
00002 // Author: Fons Rademakers   05/01/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_TGIcon
00013 #define ROOT_TGIcon
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGIcon                                                               //
00019 //                                                                      //
00020 // This class handles GUI icons.                                        //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGFrame
00025 #include "TGFrame.h"
00026 #endif
00027 #ifndef ROOT_TGDimension
00028 #include "TGDimension.h"
00029 #endif
00030 
00031 class TGPicture;
00032 class TImage;
00033 
00034 class TGIcon : public TGFrame {
00035 
00036 protected:
00037    const TGPicture  *fPic;     // icon picture
00038    TImage           *fImage;   // image
00039    TString           fPath;    // directory of image
00040 
00041    virtual void DoRedraw();
00042 
00043 private:
00044    TGIcon(const TGIcon &);            // not implemented
00045    TGIcon& operator=(const TGIcon&);  // not implemented
00046 
00047 public:
00048    TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h,
00049       UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground()) :
00050          TGFrame(p, w, h, options, back), fPic(pic), fImage(0), fPath() { SetWindowName(); }
00051 
00052    TGIcon(const TGWindow *p = 0, const char *image = 0);
00053 
00054    virtual ~TGIcon();
00055 
00056    virtual void Reset();         //*MENU*
00057    const TGPicture *GetPicture() const { return fPic; }
00058    TImage *GetImage() const { return fImage; }
00059    virtual void SetPicture(const TGPicture *pic);
00060    virtual void SetImage(const char *img);
00061    virtual void SetImage(TImage *img);
00062    virtual void SetImagePath(const char *path);
00063 
00064    virtual void Resize(UInt_t w = 0, UInt_t h = 0);
00065    virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
00066    virtual void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0);
00067    virtual void ChangeBackgroundColor() { }
00068 
00069    virtual TGDimension GetDefaultSize() const;
00070    virtual void SavePrimitive(ostream &out, Option_t *option = "");
00071 
00072    ClassDef(TGIcon,0)  // Icon GUI class
00073 };
00074 
00075 #endif

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