ROOT logo
// @(#)root/gui:$Id: TGIcon.h 23115 2008-04-10 13:35:37Z rdm $
// Author: Fons Rademakers   05/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGIcon
#define ROOT_TGIcon


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGIcon                                                               //
//                                                                      //
// This class handles GUI icons.                                        //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGDimension
#include "TGDimension.h"
#endif

class TGPicture;
class TImage;

class TGIcon : public TGFrame {

protected:
   const TGPicture  *fPic;     // icon picture
   TImage           *fImage;   // image
   TString           fPath;    // directory of image

   virtual void DoRedraw();

private:
   TGIcon(const TGIcon &);            // not implemented
   TGIcon& operator=(const TGIcon&);  // not implemented

public:
   TGIcon(const TGWindow *p, const TGPicture *pic, UInt_t w, UInt_t h,
      UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground()) :
         TGFrame(p, w, h, options, back), fPic(pic), fImage(0), fPath() { SetWindowName(); }

   TGIcon(const TGWindow *p = 0, const char *image = 0);

   virtual ~TGIcon();

   virtual void Reset();         //*MENU*
   const TGPicture *GetPicture() const { return fPic; }
   TImage *GetImage() const { return fImage; }
   virtual void SetPicture(const TGPicture *pic);
   virtual void SetImage(const char *img);
   virtual void SetImage(TImage *img);
   virtual void SetImagePath(const char *path);

   virtual void Resize(UInt_t w = 0, UInt_t h = 0);
   virtual void Resize(TGDimension size) { Resize(size.fWidth, size.fHeight); }
   virtual void MoveResize(Int_t x, Int_t y, UInt_t w = 0, UInt_t h = 0);
   virtual void ChangeBackgroundColor() { }

   virtual TGDimension GetDefaultSize() const;
   virtual void SavePrimitive(ostream &out, Option_t *option = "");

   ClassDef(TGIcon,0)  // Icon GUI class
};

#endif
 TGIcon.h:1
 TGIcon.h:2
 TGIcon.h:3
 TGIcon.h:4
 TGIcon.h:5
 TGIcon.h:6
 TGIcon.h:7
 TGIcon.h:8
 TGIcon.h:9
 TGIcon.h:10
 TGIcon.h:11
 TGIcon.h:12
 TGIcon.h:13
 TGIcon.h:14
 TGIcon.h:15
 TGIcon.h:16
 TGIcon.h:17
 TGIcon.h:18
 TGIcon.h:19
 TGIcon.h:20
 TGIcon.h:21
 TGIcon.h:22
 TGIcon.h:23
 TGIcon.h:24
 TGIcon.h:25
 TGIcon.h:26
 TGIcon.h:27
 TGIcon.h:28
 TGIcon.h:29
 TGIcon.h:30
 TGIcon.h:31
 TGIcon.h:32
 TGIcon.h:33
 TGIcon.h:34
 TGIcon.h:35
 TGIcon.h:36
 TGIcon.h:37
 TGIcon.h:38
 TGIcon.h:39
 TGIcon.h:40
 TGIcon.h:41
 TGIcon.h:42
 TGIcon.h:43
 TGIcon.h:44
 TGIcon.h:45
 TGIcon.h:46
 TGIcon.h:47
 TGIcon.h:48
 TGIcon.h:49
 TGIcon.h:50
 TGIcon.h:51
 TGIcon.h:52
 TGIcon.h:53
 TGIcon.h:54
 TGIcon.h:55
 TGIcon.h:56
 TGIcon.h:57
 TGIcon.h:58
 TGIcon.h:59
 TGIcon.h:60
 TGIcon.h:61
 TGIcon.h:62
 TGIcon.h:63
 TGIcon.h:64
 TGIcon.h:65
 TGIcon.h:66
 TGIcon.h:67
 TGIcon.h:68
 TGIcon.h:69
 TGIcon.h:70
 TGIcon.h:71
 TGIcon.h:72
 TGIcon.h:73
 TGIcon.h:74
 TGIcon.h:75