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