Logo ROOT  
Reference Guide
TGIcon.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 05/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGIcon
13 #define ROOT_TGIcon
14 
15 
16 #include "TGFrame.h"
17 #include "TGDimension.h"
18 
19 class TGPicture;
20 class TImage;
21 
22 class TGIcon : public TGFrame {
23 
24 protected:
25  const TGPicture *fPic; // icon picture
26  TImage *fImage; // image
27  TString fPath; // directory of image
28 
29  virtual void DoRedraw();
30 
31 private:
32  TGIcon(const TGIcon &) = delete;
33  TGIcon& operator=(const TGIcon&) = delete;
34 
35 public:
36  TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h,
38  TGFrame(p, w, h, options, back), fPic(pic), fImage(nullptr), fPath() { SetWindowName(); }
39 
40  TGIcon(const TGWindow *p = nullptr, const char *image = nullptr);
41 
42  virtual ~TGIcon();
43 
44  virtual void Reset(); //*MENU*
45  const TGPicture *GetPicture() const { return fPic; }
46  TImage *GetImage() const { return fImage; }
47  virtual void SetPicture(const TGPicture *pic);
48  virtual void SetImage(const char *img);
49  virtual void SetImage(TImage *img);
50  virtual void SetImagePath(const char *path);
51 
52  virtual void Resize(UInt_t w = 0, UInt_t h = 0);
53  virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
54  virtual void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0);
55  virtual void ChangeBackgroundColor() { }
56 
57  virtual TGDimension GetDefaultSize() const;
58  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
59 
60  ClassDef(TGIcon,0) // Icon GUI class
61 };
62 
63 #endif
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGIcon::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize.
Definition: TGIcon.cxx:139
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
TGDimension
Definition: TGDimension.h:18
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGIcon::SetPicture
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition: TGIcon.cxx:79
TGIcon::TGIcon
TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition: TGIcon.h:36
TGIcon::GetImage
TImage * GetImage() const
Definition: TGIcon.h:46
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGIcon::Reset
virtual void Reset()
Reset icon to original image. It can be used only via context menu.
Definition: TGIcon.cxx:175
Int_t
int Int_t
Definition: RtypesCore.h:45
TGIcon::~TGIcon
virtual ~TGIcon()
Delete icon and free picture.
Definition: TGIcon.cxx:71
TImage
An abstract interface to image processing library.
Definition: TImage.h:29
TGDimension.h
x
Double_t x[n]
Definition: legend1.C:17
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGIcon::Resize
virtual void Resize(TGDimension size)
Resize the frame.
Definition: TGIcon.h:53
TGIcon::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return size of icon.
Definition: TGIcon.cxx:117
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:80
TGIcon::SetImage
virtual void SetImage(const char *img)
Set icon image.
Definition: TGIcon.cxx:89
TGIcon
This class handles GUI icons.
Definition: TGIcon.h:22
TGIcon::fPic
const TGPicture * fPic
Definition: TGIcon.h:25
h
#define h(i)
Definition: RSha256.hxx:106
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
TGFrame.h
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGIcon::ChangeBackgroundColor
virtual void ChangeBackgroundColor()
Definition: TGIcon.h:55
y
Double_t y[n]
Definition: legend1.C:17
TGIcon::GetPicture
const TGPicture * GetPicture() const
Definition: TGIcon.h:45
TGIcon::fPath
TString fPath
Definition: TGIcon.h:27
unsigned int
TGIcon::MoveResize
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move icon to (x,y) and resize it to (w,h).
Definition: TGIcon.cxx:166
TGIcon::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an icon widget as a C++ statement(s) on output stream out.
Definition: TGIcon.cxx:203
TGIcon::fImage
TImage * fImage
Definition: TGIcon.h:26
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGIcon::TGIcon
TGIcon(const TGIcon &)=delete
TGIcon::SetImagePath
virtual void SetImagePath(const char *path)
Set directory where image is located.
Definition: TGIcon.cxx:190
TGIcon::operator=
TGIcon & operator=(const TGIcon &)=delete
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
TGIcon::DoRedraw
virtual void DoRedraw()
Redraw picture.
Definition: TGIcon.cxx:126