ROOT  6.06/09
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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGIcon //
19 // //
20 // This class handles GUI icons. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TGFrame
25 #include "TGFrame.h"
26 #endif
27 #ifndef ROOT_TGDimension
28 #include "TGDimension.h"
29 #endif
30 
31 class TGPicture;
32 class TImage;
33 
34 class TGIcon : public TGFrame {
35 
36 protected:
37  const TGPicture *fPic; // icon picture
38  TImage *fImage; // image
39  TString fPath; // directory of image
40 
41  virtual void DoRedraw();
42 
43 private:
44  TGIcon(const TGIcon &); // not implemented
45  TGIcon& operator=(const TGIcon&); // not implemented
46 
47 public:
48  TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h,
50  TGFrame(p, w, h, options, back), fPic(pic), fImage(0), fPath() { SetWindowName(); }
51 
52  TGIcon(const TGWindow *p = 0, const char *image = 0);
53 
54  virtual ~TGIcon();
55 
56  virtual void Reset(); //*MENU*
57  const TGPicture *GetPicture() const { return fPic; }
58  TImage *GetImage() const { return fImage; }
59  virtual void SetPicture(const TGPicture *pic);
60  virtual void SetImage(const char *img);
61  virtual void SetImage(TImage *img);
62  virtual void SetImagePath(const char *path);
63 
64  virtual void Resize(UInt_t w = 0, UInt_t h = 0);
65  virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
66  virtual void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0);
67  virtual void ChangeBackgroundColor() { }
68 
69  virtual TGDimension GetDefaultSize() const;
70  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
71 
72  ClassDef(TGIcon,0) // Icon GUI class
73 };
74 
75 #endif
TImage * GetImage() const
Definition: TGIcon.h:58
virtual TGDimension GetDefaultSize() const
Return size of icon.
Definition: TGIcon.cxx:118
const char Option_t
Definition: RtypesCore.h:62
virtual void Resize(TGDimension size)
Resize the frame.
Definition: TGIcon.h:65
TH1 * h
Definition: legend2.C:5
virtual void SetImage(const char *img)
Set icon image.
Definition: TGIcon.cxx:90
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
An abstract interface to image processing library.
Definition: TImage.h:45
TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition: TGIcon.h:48
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize.
Definition: TGIcon.cxx:140
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
ULong_t Pixel_t
Definition: GuiTypes.h:41
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
Definition: TGIcon.h:34
virtual ~TGIcon()
Delete icon and free picture.
Definition: TGIcon.cxx:72
virtual void ChangeBackgroundColor()
Definition: TGIcon.h:67
TGIcon & operator=(const TGIcon &)
UInt_t fHeight
Definition: TGDimension.h:32
char * out
Definition: TBase64.cxx:29
UInt_t fWidth
Definition: TGDimension.h:31
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:167
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:202
TGIcon(const TGIcon &)
unsigned int UInt_t
Definition: RtypesCore.h:42
TImage * fImage
Definition: TGIcon.h:38
const TGPicture * fPic
Definition: TGIcon.h:37
virtual void SetImagePath(const char *path)
Set directory where image is located.
Definition: TGIcon.cxx:191
Double_t y[n]
Definition: legend1.C:17
virtual void DoRedraw()
Redraw picture.
Definition: TGIcon.cxx:127
const TGPicture * GetPicture() const
Definition: TGIcon.h:57
TString fPath
Definition: TGIcon.h:39
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition: TGIcon.cxx:80
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:118
virtual void Reset()
Reset icon to original image. It can be used only via context menu.
Definition: TGIcon.cxx:176
const char Int_t const char * image
Definition: TXSlave.cxx:46