Logo ROOT   6.18/05
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
16class TGTable;
17class TGString;
18class TGTooltip;
19class TGPicture;
20class TObjArray;
21class TGWindow;
22class TGToolTip;
23
24class TGTableCell : public TGFrame {
25
26friend class TGTable;
27
28protected:
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 heigth
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
57public:
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// TGTableCell(const TGWindow *p, TGTable *table, TGPicture *image,
72// TGString *label, UInt_t row, UInt_t column,
73// UInt_t width, UInt_t height, GContext_t norm = GetDefaultGC()(),
74// FontStruct_t font = GetDefaultFontStruct(),
75// UInt_t option = 0, Bool_t resize = kTRUE);
76// TGTableCell(const TGWindow *p, TGTable *table, TGPicture *image,
77// const char *label, UInt_t row, UInt_t column, UInt_t width,
78// UInt_t height, GContext_t norm = GetDefaultGC()(),
79// FontStruct_t font = GetDefaultFontStruct(),
80// UInt_t option = 0, Bool_t resize = kTRUE);
81 virtual ~TGTableCell();
82
83 virtual void DrawCopy(Handle_t id, Int_t x, Int_t y);
84
85 virtual void SetLabel(const char *label);
86
87 virtual void SetImage(TGPicture *image);
88 // virtual void SetBckgndGC(TGGC *gc);
89
90 virtual void SetTextJustify(Int_t tmode);
91 virtual void SetFont(FontStruct_t font);
92 virtual void SetFont(const char *fontName);
93
94 virtual void Select();
95 virtual void SelectRow();
96 virtual void SelectColumn();
97
98 virtual UInt_t GetColumn() const { return fColumn; }
99 virtual UInt_t GetRow() const { return fRow; };
100 virtual TGString* GetLabel() const { return fLabel; }
101 virtual TGPicture* GetImage() const { return fImage; }
102 virtual UInt_t GetWidth() const { return fWidth; }
103 virtual UInt_t GetHeight() const {return fHeight; }
104 virtual TGDimension GetSize() const { return TGDimension(fWidth, fHeight); }
105 virtual Int_t GetTextJustify() const { return fTMode; }
106
107 ClassDef(TGTableCell, 0) // A single cell in a TGTable.
108} ;
109
110#endif
ULong_t Handle_t
Definition: GuiTypes.h:25
Handle_t GContext_t
Definition: GuiTypes.h:37
Handle_t FontStruct_t
Definition: GuiTypes.h:38
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
Definition: TGFont.h:149
UInt_t fHeight
Definition: TGFrame.h:135
UInt_t fWidth
Definition: TGFrame.h:134
Definition: TGGC.h:31
virtual void SelectColumn()
Select the column that this TGTableCell belongs to.
virtual void SetTextJustify(Int_t tmode)
Set the text justify mode of the cell to mode.
static const TGFont * fgDefaultFont
Definition: TGTableCell.h:45
virtual void SetLabel(const char *label)
Set the label of this cell to label.
TGToolTip * fTip
Definition: TGTableCell.h:30
static const TGGC * fgDefaultGC
Definition: TGTableCell.h:44
virtual UInt_t GetWidth() const
Definition: TGTableCell.h:102
virtual void Resize(UInt_t width, UInt_t height)
Resize the TGTableCell.
Int_t fTMode
Definition: TGTableCell.h:33
UInt_t fTWidth
Definition: TGTableCell.h:35
virtual Int_t GetTextJustify() const
Definition: TGTableCell.h:105
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw list view item in other window.
TGPicture * fImage
Definition: TGTableCell.h:34
FontStruct_t fFontStruct
Definition: TGTableCell.h:37
virtual UInt_t GetRow() const
Definition: TGTableCell.h:99
Bool_t fReadOnly
Definition: TGTableCell.h:31
TGTable * fTable
Definition: TGTableCell.h:42
UInt_t fTHeight
Definition: TGTableCell.h:36
virtual void SetFont(FontStruct_t font)
Changes text font.
virtual void SelectRow()
Select the row that this TGTableCell belongs to.
virtual void Highlight()
Highlight the this TGTableCell.
virtual void SetImage(TGPicture *image)
Set the image that this cell contains to image.
virtual void MoveDraw(Int_t x, Int_t y)
Move the TGTableCell and redraw it.
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:44
TGString * fLabel
Definition: TGTableCell.h:29
Bool_t fEnabled
Definition: TGTableCell.h:32
virtual TGDimension GetSize() const
Definition: TGTableCell.h:104
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
UInt_t fRow
Definition: TGTableCell.h:41
virtual void DoRedraw()
Redraw the TGTableCell.
virtual TGString * GetLabel() const
Definition: TGTableCell.h:100
virtual TGPicture * GetImage() const
Definition: TGTableCell.h:101
UInt_t fColumn
Definition: TGTableCell.h:40
virtual ~TGTableCell()
TGTableCell destructor.
Bool_t fHasOwnFont
Definition: TGTableCell.h:38
void Init(Bool_t resize)
Initialise the TGTableCell.
virtual void DrawBorder()
Draw the cell border.
virtual void Select()
Select this TGTableCell.
static const TGGC & GetDefaultGC()
Return default graphics context.
GContext_t fNormGC
Definition: TGTableCell.h:39
virtual UInt_t GetHeight() const
Definition: TGTableCell.h:103
virtual UInt_t GetColumn() const
Definition: TGTableCell.h:98
An array of TObjects.
Definition: TObjArray.h:37
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17