Logo ROOT  
Reference Guide
TGTableCell.h
Go to the documentation of this file.
1 // Author: Roel Aaij 14/08/2007
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGTableCell
12 #define ROOT_TGTableCell
13 
14 #include "TGFrame.h"
15 
16 class TGTable;
17 class TGString;
18 class TGTooltip;
19 class TGPicture;
20 class TObjArray;
21 class TGWindow;
22 class TGToolTip;
23 
24 class TGTableCell : public TGFrame {
25 
26 friend class TGTable;
27 
28 protected:
29  TGString *fLabel; ///< Text as shown in the cell
30  TGToolTip *fTip; ///< Possible Tooltip
31  Bool_t fReadOnly; ///< Cell readonly state
32  Bool_t fEnabled; ///< Cell enabled state
33  Int_t fTMode; ///< Text justify mode
34  TGPicture *fImage; ///< Image or icon
35  UInt_t fTWidth; ///< Label width
36  UInt_t fTHeight; ///< Label height
37  FontStruct_t fFontStruct; ///< Font of the label
38  Bool_t fHasOwnFont; ///< Does the cell have it's own font
39  GContext_t fNormGC; ///< graphics context used to draw the cell
40  UInt_t fColumn; ///< Column this cell belongs to
41  UInt_t fRow; ///< Row this cell belongs to
42  TGTable *fTable; ///< TGTable that a cell belongs to
43 
44  static const TGGC *fgDefaultGC; ///< Default graphics context
45  static const TGFont *fgDefaultFont; ///< Default font
46 
47  virtual void DoRedraw();
48  virtual void DrawBorder();
49  virtual void DrawBorder(Handle_t id, Int_t x, Int_t y);
50  virtual void MoveDraw(Int_t x, Int_t y);
51  virtual void Resize(UInt_t width, UInt_t height);
52  virtual void Resize(TGDimension newsize);
53 
54  virtual void Highlight();
55  void Init(Bool_t resize);
56 
57 public:
59  static const TGGC &GetDefaultGC();
60 
61  TGTableCell(const TGWindow *p = 0, TGTable *table = 0, TGString *label = 0,
62  UInt_t row = 0, UInt_t column = 0, UInt_t width = 80,
63  UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
64  FontStruct_t font = GetDefaultFontStruct(), UInt_t option = 0,
65  Bool_t resize = kTRUE);
66  TGTableCell(const TGWindow *p, TGTable *table, const char *label,
67  UInt_t row = 0, UInt_t column = 0, UInt_t width = 80,
68  UInt_t height = 25, GContext_t norm = GetDefaultGC()(),
70  UInt_t option = 0, Bool_t resize = kTRUE);
71 
72  virtual ~TGTableCell();
73 
74  virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
75 
76  virtual void SetLabel(const char *label);
77 
78  virtual void SetImage(TGPicture *image);
79  // virtual void SetBckgndGC(TGGC *gc);
80 
81  virtual void SetTextJustify(Int_t tmode);
82  virtual void SetFont(FontStruct_t font);
83  virtual void SetFont(const char *fontName);
84 
85  virtual void Select();
86  virtual void SelectRow();
87  virtual void SelectColumn();
88 
89  virtual UInt_t GetColumn() const { return fColumn; }
90  virtual UInt_t GetRow() const { return fRow; };
91  virtual TGString* GetLabel() const { return fLabel; }
92  virtual TGPicture* GetImage() const { return fImage; }
93  virtual UInt_t GetWidth() const { return fWidth; }
94  virtual UInt_t GetHeight() const {return fHeight; }
95  virtual TGDimension GetSize() const { return TGDimension(fWidth, fHeight); }
96  virtual Int_t GetTextJustify() const { return fTMode; }
97 
98  ClassDef(TGTableCell, 0) // A single cell in a TGTable.
99 } ;
100 
101 #endif
TGTableCell::GetImage
virtual TGPicture * GetImage() const
Definition: TGTableCell.h:92
TGTableCell::fReadOnly
Bool_t fReadOnly
Cell readonly state.
Definition: TGTableCell.h:31
TGTableCell::Init
void Init(Bool_t resize)
Initialise the TGTableCell.
Definition: TGTableCell.cxx:94
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
TGTableCell::fgDefaultGC
static const TGGC * fgDefaultGC
Default graphics context.
Definition: TGTableCell.h:44
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
TGTableCell::GetWidth
virtual UInt_t GetWidth() const
Definition: TGTableCell.h:93
TGDimension
Definition: TGDimension.h:18
TGTableCell::SetLabel
virtual void SetLabel(const char *label)
Set the label of this cell to label.
Definition: TGTableCell.cxx:279
TGTableCell::fTMode
Int_t fTMode
Text justify mode.
Definition: TGTableCell.h:33
TGTableCell::GetSize
virtual TGDimension GetSize() const
Definition: TGTableCell.h:95
TGTableCell::~TGTableCell
virtual ~TGTableCell()
TGTableCell destructor.
Definition: TGTableCell.cxx:84
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
FontStruct_t
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
TGTableCell::fColumn
UInt_t fColumn
Column this cell belongs to.
Definition: TGTableCell.h:40
TGTableCell::fNormGC
GContext_t fNormGC
graphics context used to draw the cell
Definition: TGTableCell.h:39
TGTableCell::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Definition: TGTableCell.cxx:195
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
x
Double_t x[n]
Definition: legend1.C:17
TGToolTip
Definition: TGToolTip.h:24
Handle_t
ULongptr_t Handle_t
Generic resource handle.
Definition: GuiTypes.h:26
TGTableCell::fFontStruct
FontStruct_t fFontStruct
Font of the label.
Definition: TGTableCell.h:37
TGTableCell::fTHeight
UInt_t fTHeight
Label height.
Definition: TGTableCell.h:36
TGTableCell::fgDefaultFont
static const TGFont * fgDefaultFont
Default font.
Definition: TGTableCell.h:45
TGTableCell::TGTableCell
TGTableCell(const TGWindow *p=0, TGTable *table=0, TGString *label=0, UInt_t row=0, UInt_t column=0, UInt_t width=80, UInt_t height=25, GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), UInt_t option=0, Bool_t resize=kTRUE)
TGTableCell constructor.
Definition: TGTableCell.cxx:40
TGFrame
Definition: TGFrame.h:80
TGTableCell::GetRow
virtual UInt_t GetRow() const
Definition: TGTableCell.h:90
TGTableCell::SetFont
virtual void SetFont(FontStruct_t font)
Changes text font.
Definition: TGTableCell.cxx:306
TGTableCell::fTip
TGToolTip * fTip
Possible Tooltip.
Definition: TGTableCell.h:30
bool
TGTableCell::fTWidth
UInt_t fTWidth
Label width.
Definition: TGTableCell.h:35
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
TGTableCell::DrawCopy
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw list view item in other window.
Definition: TGTableCell.cxx:243
TGTableCell::fTable
TGTable * fTable
TGTable that a cell belongs to.
Definition: TGTableCell.h:42
TGTableCell::GetTextJustify
virtual Int_t GetTextJustify() const
Definition: TGTableCell.h:96
TGTableCell::Highlight
virtual void Highlight()
Highlight the this TGTableCell.
Definition: TGTableCell.cxx:232
TGGC
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
TGTableCell::fRow
UInt_t fRow
Row this cell belongs to.
Definition: TGTableCell.h:41
TGTableCell::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGTableCell.cxx:205
TGFrame.h
TGTableCell::GetLabel
virtual TGString * GetLabel() const
Definition: TGTableCell.h:91
TGTableCell::fEnabled
Bool_t fEnabled
Cell enabled state.
Definition: TGTableCell.h:32
y
Double_t y[n]
Definition: legend1.C:17
TGTableCell::SetImage
virtual void SetImage(TGPicture *image)
Set the image that this cell contains to image.
Definition: TGTableCell.cxx:294
TGTableCell::fHasOwnFont
Bool_t fHasOwnFont
Does the cell have it's own font.
Definition: TGTableCell.h:38
unsigned int
TGTableCell::SetTextJustify
virtual void SetTextJustify(Int_t tmode)
Set the text justify mode of the cell to mode.
Definition: TGTableCell.cxx:341
TGTableCell::fLabel
TGString * fLabel
Text as shown in the cell.
Definition: TGTableCell.h:29
TGTableCell::GetColumn
virtual UInt_t GetColumn() const
Definition: TGTableCell.h:89
TGTableCell::SelectColumn
virtual void SelectColumn()
Select the column that this TGTableCell belongs to.
Definition: TGTableCell.cxx:365
TGTableCell::DoRedraw
virtual void DoRedraw()
Redraw the TGTableCell.
Definition: TGTableCell.cxx:131
TGTableCell::GetHeight
virtual UInt_t GetHeight() const
Definition: TGTableCell.h:94
TGTableCell::DrawBorder
virtual void DrawBorder()
Draw the cell border.
Definition: TGTableCell.cxx:215
TGTableCell::fImage
TGPicture * fImage
Image or icon.
Definition: TGTableCell.h:34
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGTableCell
TGTableCell is the class that represents a single cell in a TGTable.
Definition: TGTableCell.h:24
TGTableCell::SelectRow
virtual void SelectRow()
Select the row that this TGTableCell belongs to.
Definition: TGTableCell.cxx:357
TGTableCell::MoveDraw
virtual void MoveDraw(Int_t x, Int_t y)
Move the TGTableCell and redraw it.
Definition: TGTableCell.cxx:165
TGTableCell::Resize
virtual void Resize(UInt_t width, UInt_t height)
Resize the TGTableCell.
Definition: TGTableCell.cxx:176
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TGFont
Encapsulate fonts used in the GUI system.
Definition: TGFont.h:140
TGTableCell::Select
virtual void Select()
Select this TGTableCell.
Definition: TGTableCell.cxx:349
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGTable
Create an array to hold a bunch of numbers.
Definition: TGTable.h:34
int