Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 05/01/98
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 *************************************************************************/
12#ifndef ROOT_TGIcon
13#define ROOT_TGIcon
16#include "TGFrame.h"
17#include "TGDimension.h"
19class TGPicture;
20class TImage;
22class TGIcon : public TGFrame {
25 const TGPicture *fPic; ///< icon picture
26 TImage *fImage; ///< image
27 TString fPath; ///< directory of image
29 void DoRedraw() override;
32 TGIcon(const TGIcon &) = delete;
33 TGIcon& operator=(const TGIcon&) = delete;
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(); }
40 TGIcon(const TGWindow *p = nullptr, const char *image = nullptr);
42 virtual ~TGIcon();
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);
52 void Resize(UInt_t w = 0, UInt_t h = 0) override;
53 void Resize(TGDimension size) override { Resize(size.fWidth, size.fHeight); }
54 void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0) override;
55 virtual void ChangeBackgroundColor() {}
57 TGDimension GetDefaultSize() const override;
58 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
60 ClassDefOverride(TGIcon,0) // Icon GUI class
@ kChildFrame
Definition: GuiTypes.h:379
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define h(i)
Definition: RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
This class handles GUI icons.
Definition: TGIcon.h:22
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
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move icon to (x,y) and resize it to (w,h).
Definition: TGIcon.cxx:166
const TGPicture * GetPicture() const
Definition: TGIcon.h:45
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an icon widget as a C++ statement(s) on output stream out.
Definition: TGIcon.cxx:203
TGIcon & operator=(const TGIcon &)=delete
virtual ~TGIcon()
Delete icon and free picture.
Definition: TGIcon.cxx:71
virtual void SetPicture(const TGPicture *pic)
Set icon picture.
Definition: TGIcon.cxx:79
virtual void SetImage(const char *img)
Set icon image.
Definition: TGIcon.cxx:89
void Resize(TGDimension size) override
Resize the frame.
Definition: TGIcon.h:53
virtual void ChangeBackgroundColor()
Definition: TGIcon.h:55
const TGPicture * fPic
icon picture
Definition: TGIcon.h:25
TImage * fImage
Definition: TGIcon.h:26
void DoRedraw() override
Redraw picture.
Definition: TGIcon.cxx:126
TString fPath
directory of image
Definition: TGIcon.h:27
void Resize(UInt_t w=0, UInt_t h=0) override
Definition: TGIcon.cxx:139
TGIcon(const TGIcon &)=delete
TGDimension GetDefaultSize() const override
Return size of icon.
Definition: TGIcon.cxx:117
virtual void Reset()
Reset icon to original image. It can be used only via context menu.
Definition: TGIcon.cxx:175
virtual void SetImagePath(const char *path)
Set directory where image is located.
Definition: TGIcon.cxx:190
TImage * GetImage() const
Definition: TGIcon.h:46
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
ROOT GUI Window base class.
Definition: TGWindow.h:23
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition: TGWindow.cxx:129
An abstract interface to image processing library.
Definition: TImage.h:29
Basic string class.
Definition: TString.h:136
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17