File indexing completed on 2025-01-18 10:11:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGIcon
0013 #define ROOT_TGIcon
0014
0015
0016 #include "TGFrame.h"
0017 #include "TGDimension.h"
0018
0019 class TGPicture;
0020 class TImage;
0021
0022 class TGIcon : public TGFrame {
0023
0024 protected:
0025 const TGPicture *fPic;
0026 TImage *fImage;
0027 TString fPath;
0028
0029 void DoRedraw() override;
0030
0031 private:
0032 TGIcon(const TGIcon &) = delete;
0033 TGIcon& operator=(const TGIcon&) = delete;
0034
0035 public:
0036 TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h,
0037 UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground()) :
0038 TGFrame(p, w, h, options, back), fPic(pic), fImage(nullptr), fPath() { SetWindowName(); }
0039
0040 TGIcon(const TGWindow *p = nullptr, const char *image = nullptr);
0041
0042 ~TGIcon() override;
0043
0044 virtual void Reset();
0045 const TGPicture *GetPicture() const { return fPic; }
0046 TImage *GetImage() const { return fImage; }
0047 virtual void SetPicture(const TGPicture *pic);
0048 virtual void SetImage(const char *img);
0049 virtual void SetImage(TImage *img);
0050 virtual void SetImagePath(const char *path);
0051
0052 void Resize(UInt_t w = 0, UInt_t h = 0) override;
0053 void Resize(TGDimension size) override { Resize(size.fWidth, size.fHeight); }
0054 void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0) override;
0055 virtual void ChangeBackgroundColor() {}
0056
0057 TGDimension GetDefaultSize() const override;
0058 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0059
0060 ClassDefOverride(TGIcon,0)
0061 };
0062
0063 #endif