00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGIcon
00013 #define ROOT_TGIcon
00014
00015
00016
00017
00018
00019
00020
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;
00038 TImage *fImage;
00039 TString fPath;
00040
00041 virtual void DoRedraw();
00042
00043 private:
00044 TGIcon(const TGIcon &);
00045 TGIcon& operator=(const TGIcon&);
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();
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)
00073 };
00074
00075 #endif