#ifndef ROOT_TGTable
#define ROOT_TGTable
#ifndef ROOT_TGCanvas
#include "TGCanvas.h"
#endif
#ifndef ROOT_TGWidget
#include "TGWidget.h"
#endif
#ifndef ROOT_TGTableHeader
#include "TGTableHeader.h"
#endif
class TGWindow;
class TGString;
class TGToolTip;
class TGPicture;
class TVirtualTableInterface;
class TGTableCell;
class TGTableHeader;
class TGToolTip;
class TGTableFrame;
class TGTableHeaderFrame;
class TGTextButton;
class TGNumberEntryField;
class TGLabel;
class TGTextEntry;
class TTableRange;
class TGTable : public TGCompositeFrame, public TGWidget {
protected:
TObjArray *fRows;
TObjArray *fRowHeaders;
TObjArray *fColumnHeaders;
TGTableHeader *fTableHeader;
Bool_t fReadOnly;
Pixel_t fSelectColor;
Int_t fTMode;
Bool_t fAllData;
TTableRange *fCurrentRange;
TTableRange *fDataRange;
TTableRange *fGotoRange;
TGTableFrame *fTableFrame;
TGCanvas *fCanvas;
UInt_t fCellWidth;
UInt_t fCellHeight;
TGTableHeaderFrame *fCHdrFrame;
TGTableHeaderFrame *fRHdrFrame;
TGHorizontalFrame *fRangeFrame;
TGHorizontalFrame *fTopFrame;
TGHorizontalFrame *fTopExtraFrame;
TGHorizontalFrame *fBottomFrame;
TGHorizontalFrame *fButtonFrame;
TGTextButton *fNextButton;
TGTextButton *fPrevButton;
TGTextButton *fUpdateButton;
TGTextButton *fGotoButton;
TGLabel *fFirstCellLabel;
TGLabel *fRangeLabel;
TGTextEntry *fFirstCellEntry;
TGTextEntry *fRangeEntry;
Pixel_t fOddRowBackground;
Pixel_t fEvenRowBackground;
Pixel_t fHeaderBackground;
static const TGGC *fgDefaultSelectGC;
static const TGGC *fgDefaultBckgndGC;
static const Int_t fgDefaultTMode;
TList *fCellHintsList;
TList *fRHdrHintsList;
TList *fCHdrHintsList;
TList *fMainHintsList;
virtual void Init();
protected:
TVirtualTableInterface *fInterface;
virtual void DoRedraw();
virtual void Expand(UInt_t nrows, UInt_t ncolumns);
virtual void ExpandColumns(UInt_t ncolumns);
virtual void ExpandRows(UInt_t nrows);
virtual UInt_t GetRHdrHeight() const;
virtual UInt_t GetCHdrWidth() const;
virtual void Shrink(UInt_t nrows, UInt_t ncolumns);
virtual void ShrinkColumns(UInt_t ncolumns);
virtual void ShrinkRows(UInt_t nrows);
virtual void UpdateHeaders(EHeaderType type);
virtual void SetInterface(TVirtualTableInterface *interface,
UInt_t nrows = 50, UInt_t ncolumns = 20);
virtual void ResizeTable(UInt_t nrows, UInt_t ncolumns);
virtual void UpdateRangeFrame();
public:
TGTable(const TGWindow *p = 0, Int_t id = 0,
TVirtualTableInterface *interface = 0, UInt_t nrows = 50,
UInt_t ncolumns = 20);
virtual ~TGTable();
virtual TObjArray *GetRow(UInt_t row);
virtual TObjArray *GetColumn(UInt_t columns);
virtual const TGTableCell* GetCell(UInt_t i, UInt_t j) const;
virtual TGTableCell* GetCell(UInt_t i, UInt_t j);
virtual const TGTableCell* FindCell(TGString label) const;
virtual TGTableCell* FindCell(TGString label);
virtual void Show();
virtual void UpdateView();
virtual UInt_t GetNTableRows() const;
virtual UInt_t GetNDataRows() const;
virtual UInt_t GetNTableColumns() const;
virtual UInt_t GetNDataColumns() const;
virtual UInt_t GetNTableCells() const;
virtual UInt_t GetNDataCells() const;
virtual const TTableRange *GetCurrentRange() const;
virtual TVirtualTableInterface *GetInterface() { return fInterface; }
virtual TGCanvas *GetCanvas() { return fCanvas; }
virtual const TGTableHeaderFrame *GetRHdrFrame() { return fRHdrFrame; }
virtual const TGTableHeaderFrame *GetCHdrFrame() { return fCHdrFrame; }
virtual const TGTableHeader *GetRowHeader(const UInt_t row) const;
virtual TGTableHeader *GetRowHeader(const UInt_t row);
virtual const TGTableHeader *GetColumnHeader(const UInt_t column) const;
virtual TGTableHeader *GetColumnHeader(const UInt_t column);
virtual TGTableHeader *GetTableHeader();
virtual Pixel_t GetRowBackground(UInt_t row) const;
virtual Pixel_t GetHeaderBackground() const ;
virtual void SetOddRowBackground(Pixel_t pixel);
virtual void SetEvenRowBackground(Pixel_t pixel);
virtual void SetHeaderBackground(Pixel_t pixel);
virtual void SetDefaultColors();
virtual void MoveTable(Int_t rows, Int_t columns);
virtual void GotoTableRange(Int_t xtl, Int_t ytl,
Int_t xbr, Int_t ybr);
virtual TGTableCell* operator() (UInt_t row, UInt_t column);
virtual void ScrollCHeaders(Int_t xpos);
virtual void ScrollRHeaders(Int_t ypos);
virtual void NextChunk();
virtual void PreviousChunk();
virtual void UserRangeChange();
virtual void Goto();
virtual void Update();
ClassDef(TGTable, 0)
};
class TTableRange {
public:
UInt_t fXtl;
UInt_t fYtl;
UInt_t fXbr;
UInt_t fYbr;
TTableRange();
virtual ~TTableRange() {}
virtual void Print();
Bool_t operator==(TTableRange &other);
ClassDef(TTableRange, 0)
};
#endif