171 fRowHeaders(0), fColumnHeaders(0), fReadOnly(
kFALSE), fSelectColor(0),
172 fTMode(0), fAllData(kFALSE), fTableFrame(0), fCanvas(0), fCellWidth(80),
173 fCellHeight(25), fInterface(interface)
179 fCellHintsList =
new TList(hints);
180 fRHdrHintsList =
new TList(hints);
181 fCHdrHintsList =
new TList(hints);
182 fMainHintsList =
new TList(hints);
190 fCurrentRange->fXbr = ncolumns;
191 fCurrentRange->fYbr = nrows;
195 if(fInterface) SetInterface(fInterface, nrows, ncolumns);
276 "UserRangeChange()");
287 "UserRangeChange()");
314 for(i = 0; i < nrows; i++) {
320 for(i = 0; i < ncolumns; i++) {
329 for (i = 0; i < nrows; i++) {
332 for (j = 0; j < ncolumns; j++) {
349 for (i = 0; i < nrows; i++) {
353 for (j = 0; j < ncolumns; j++) {
414 sbar->
Connect(
"PositionChanged(Int_t)",
"TGTable",
this,
"ScrollRHeaders(Int_t)");
416 sbar->
Connect(
"PositionChanged(Int_t)",
"TGTable",
this,
"ScrollCHeaders(Int_t)");
459 for (i = 0; i < ncolumns; i++) {
466 for (i = 0; i < ntrows; i++) {
468 for (j = 0; j < ncolumns; j++) {
497 for (i = 0; i < nrows; i++) {
504 for (j = 0; j < ntcolumns ; j++) {
528 for (
Int_t i = 0; i < ncolumns; i++) {
541 for (
Int_t i = 0; i < nrows; i++) {
561 UInt_t i = 0, j = 0, k = 0;
564 Info(
"TGTable::ShrinkColumns",
"Cannot shrink smaller than 1"
565 " column, adjusting");
576 for (i = 0; i < ntrows; i++) {
577 for (j = 0; j < ncolumns; j++) {
578 k = ntcolumns - ncolumns + j;
591 for (j = 0; j < ncolumns; j++) {
617 Info(
"TGTable::ShrinkRows",
"Cannot shrink smaller than 1 row, adjusting");
628 for (i = 0; i < nrows; i++) {
629 for (j = 0; j < ntcolumns ; j++) {
630 if (
GetRow(ntrows - nrows + i)) {
665 for (i = 0; i <
max; i++) {
672 for (i = 0; i <
max; i++) {
731 if (newnrows != oldnrows){
732 if (newnrows > oldnrows) {
739 if (newncolumns != oldncolumns){
740 if (newncolumns > oldncolumns) {
748 if ((newncolumns != oldncolumns) || (newnrows != oldnrows)) {
759 newnrows, newncolumns));
762 for (i = 0; i < (
Int_t)newnrows; i++) {
766 for (j = 0; j < (
Int_t)newncolumns; j++) {
823 for(
UInt_t ui = 0; ui < nrows; ui++) {
930 for (i = 0; i < nrows; i++) {
931 for (j = 0; j < ncolumns; j++) {
954 std::ios_base::fmtflags org_flags = std::cout.flags();
956 for (j = 0; j < ncolumns + 1; j++) {
959 if (hdr) std::cout <<
" " << std::setw(12) << std::right
963 if (hdr) std::cout <<
" " << std::setw(12) << std::right
967 std::cout << std::endl;
969 for (i = 0; i < nrows; i++) {
970 for (j = 0; j < ncolumns + 1; j++) {
973 if (hdr) std::cout <<
" " << std::setw(12) << std::right
977 if (cell) std::cout <<
" " << std::setw(12) << std::right
981 std::cout << std::endl;
984 std::cout.flags(org_flags);
1080 for (i = 0; i < nrows; i++) {
1081 for (j = 0; j < ncolumns; j++) {
1247 for (i = 0; i < nrows; i++) {
1248 for (j = 0; j < ncolumns; j++) {
1275 for (i = 0; i < nrows; i++) {
1276 for (j = 0; j < ncolumns; j++) {
1302 for (i = 0; i < nrows; i++) {
1310 for (j = 0; j < ncolumns; j++) {
1352 if(xtl == xbr || ytl == ybr) {
1353 Error(
"TGTable::GotoTableRange",
"x or y range = 0");
1361 Info(
"TGTable::GotoTableRange",
"Swapping x-range boundries");
1367 Info(
"TGTable::GotoTableRange",
"Swapping y-range boundries");
1373 if((xtl < 0) || (xbr < 0)) {
1374 Info(
"TGTable::GotoTableRange",
"Column boundry out of bounds, adjusting");
1383 if((ytl < 0) || (ybr < 0)) {
1384 Info(
"TGTable::GotoTableRange",
"Row boundry out of bounds, adjusting");
1394 Info(
"TGTable::GotoTableRange",
"Left Column boundry out of bounds, "
1397 xtl = xbr - ncolumns;
1401 Info(
"TGTable::GotoTableRange",
"Right column boundry out of"
1402 " bounds, set to 0");
1406 Info(
"TGTable::GotoTableRange",
"Bottom row boundry out of bounds, "
1413 Info(
"TGTable::GotoTableRange",
"Top row boundry out of bounds, "
1504 if(!topleft.Contains(
","))
return;
1508 TString jtl = topleft(pos+1, topleft.Length());
1519 if(!range.Contains(
"x"))
return;
1522 pos = range.
First(
'x');
1524 TString jr = range(pos+1, range.Length());
1567 std::cout <<
"Range = (" <<
fXtl <<
"," <<
fYtl <<
")->("
1568 <<
fXbr <<
"," <<
fYbr <<
")" << std::endl;
TGHorizontalFrame * fTopFrame
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual TObjArray * GetColumn(UInt_t columns)
Return a pointer to a TObjArray that contains pointers to all the cells in column.
TGHScrollBar * GetHScrollbar() const
virtual void SetLabel(const char *label)
Set the label of this cell to label.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual UInt_t GetNColumns()=0
TGVScrollBar * GetVScrollbar() const
TGTableFrame * fTableFrame
virtual void SetAlignment(ETextJustification mode=kTextLeft)
Sets the alignment of the text entry.
TGHorizontalFrame(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
virtual void Show()
Show the contents of the TGTable in stdout.
virtual void SetHeaderBackground(Pixel_t pixel)
Set the background color for the headers.
TGTableHeaderFrame * fCHdrFrame
virtual TGTableCell * operator()(UInt_t row, UInt_t column)
Operator for easy cell acces.
virtual const TTableRange * GetCurrentRange() const
Return the current range of the TGTable.
virtual void Update()
Update the range of the available data and refresh the current view.
virtual void Expand(UInt_t nrows, UInt_t ncolumns)
Expand a TGTable by nrows and ncolumns.
virtual void DoRedraw()
Redraw the TGTable.
static Pixel_t GetWhitePixel()
Get white pixel value.
TGTextButton * fNextButton
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void NextChunk()
Move the table to the next chunk of the data set with the same size.
Bool_t IsAlnum() const
Returns true if all characters in string are alphanumeric.
virtual void SetContainer(TGFrame *f)
ClassImp(TGTable) ClassImp(TTableRange) TGTable
Create an array to hold a bunch of numbers.
virtual void UpdateHeaders(EHeaderType type)
Update the labels of the headers of the given type.
virtual TObjArray * GetRow(UInt_t row)
Get row.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void GotoTableRange(Int_t xtl, Int_t ytl, Int_t xbr, Int_t ybr)
Move and resize the table to the specified range.
virtual void RemoveAll()
Remove all frames from composite frame.
virtual const TGTableCell * FindCell(TGString label) const
Const version of FindCell().
Pixel_t fHeaderBackground
virtual void PreviousChunk()
Move the table to the previous chunk of the data set with the same size.
virtual UInt_t GetNTableColumns() const
Return the amount of columns in the table.
TGHorizontalFrame * fBottomFrame
virtual void Layout()
Layout the elements of the composite frame.
void SetCanvas(TGCanvas *canvas)
TGTableHeaderFrame * fRHdrFrame
const char * Data() const
TGLabel * fFirstCellLabel
TGHorizontalFrame * fButtonFrame
virtual UInt_t GetNTableCells() const
Return the amount of cells in the table.
virtual const TGTableHeader * GetRowHeader(const UInt_t row) const
Const version of GetRowHeader();.
virtual UInt_t GetOptions() const
virtual ~TGTable()
TGTable destructor.
Bool_t operator==(TTableRange &other)
Operator to determine if 2 ranges are equal.
virtual void SetEvenRowBackground(Pixel_t pixel)
Set the background color for all even numbered rows.
const char * GetText() const
TGTableHeader * fTableHeader
void Init(TClassEdit::TInterpreterLookupHelper *helper)
virtual void ScrollCHeaders(Int_t xpos)
Scroll the column headers horizontally.
virtual void Shrink(UInt_t nrows, UInt_t ncolumns)
Shrink the TGTable by nrows and ncolumns.
Pixel_t fOddRowBackground
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
virtual void SetOddRowBackground(Pixel_t pixel)
Set the background color for all odd numbered rows.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Int_t Atoi() const
Return integer value of string.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Adding a frame to a canvas is actually adding the frame to the viewport container.
virtual TGTableHeader * GetTableHeader()
Return a pointer to the table header.
virtual void ScrollRHeaders(Int_t ypos)
Scroll the row headers vertically.
virtual const char * GetColumnHeader(UInt_t column)=0
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
virtual void UpdateView()
Update and layout the visible part of the TGTable.
virtual UInt_t GetNDataRows() const
Return the amount of rows in the data source.
virtual void MoveTable(Int_t rows, Int_t columns)
Move and layout the table to the specified range.
TGTextButton * fUpdateButton
virtual void SetDefaultColors()
Set the background color for all rows and headers to their defaults.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
virtual void ExpandRows(UInt_t nrows)
Expand the rows of a TGTable by nrows.
virtual void SetInterface(TVirtualTableInterface *interface, UInt_t nrows=50, UInt_t ncolumns=20)
Set the interface that the TGTable uses to interface.
TVirtualTableInterface * fInterface
virtual void MapSubwindows()
Map all canvas sub windows.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
virtual UInt_t GetNDataColumns() const
Return the amount of columns in the data source.
virtual const char * GetValueAsString(UInt_t row, UInt_t column)=0
virtual UInt_t GetWidth() const
virtual void UserRangeChange()
Slot used when the text in one of the range frame text entries changes.
virtual void ExpandColumns(UInt_t ncolumns)
Expand the columns of a TGTable by ncolumns.
TGFrame * GetContainer() const
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
virtual UInt_t GetNRows()=0
TTableRange * fCurrentRange
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual UInt_t GetNDataCells() const
Return the amount of cell in the data source.
TObjArray * fColumnHeaders
virtual void Move(Int_t x, Int_t y)
Move frame.
TGFrame * GetFrame() const
virtual TGString * GetLabel() const
Pixel_t fEvenRowBackground
virtual void SetWidth(UInt_t w)
virtual Pixel_t GetRowBackground(UInt_t row) const
Get the background collor for row.
virtual void ShrinkColumns(UInt_t ncolumns)
Shrink the columns of the TGTable by ncolumns.
TTableRange()
TTableRange constuctor.
virtual void ShrinkRows(UInt_t nrows)
Shrink the rows of the TGTable by nrows.
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
TGTextButton * fPrevButton
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void UpdateRangeFrame()
Update the range shown in the range frame.
virtual UInt_t GetHeight() const
virtual UInt_t GetNTableRows() const
Return the amount of rows in the table.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual const TGTableHeader * GetColumnHeader(const UInt_t column) const
Const version of GetColumnHeader();.
TGTextEntry * fFirstCellEntry
virtual void Layout()
Create layout for canvas.
virtual void Add(TObject *obj)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void Print()
Print the values of a range.
virtual void Goto()
Slot used by the Goto button and whenever return is pressed in on of the text entries in the range fr...
virtual const char * GetRowHeader(UInt_t row)=0
const char * GetString() const
virtual UInt_t GetCHdrWidth() const
Get the current width of the column header frame.
virtual Pixel_t GetHeaderBackground() const
Get the background color of headers.
TObject * At(Int_t idx) const
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line...
TGHorizontalFrame * fRangeFrame
TGTextButton * fGotoButton
virtual UInt_t GetRHdrHeight() const
Get the current height of the row header frame.
virtual void Init()
Initialise the TGTable.
TGHorizontalFrame * fTopExtraFrame
virtual const TGTableCell * GetCell(UInt_t i, UInt_t j) const
Const version of GetCell().
TGTextEntry * fRangeEntry
virtual void DestroyWindow()
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual void ResizeTable(UInt_t nrows, UInt_t ncolumns)
Resize the table to newnrows and newncolumns and add all the frames to their parent frames...
TGViewPort * GetViewPort() const