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)
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, "
1522 pos = range.
First(
'x');
1567 std::cout <<
"Range = (" <<
fXtl <<
"," <<
fYtl <<
")->("
1568 <<
fXbr <<
"," <<
fYbr <<
")" << std::endl;
include TDocParser_001 C image html pict1_TDocParser_001 png width
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 SetContainer(TGFrame *f)
TGFrame * GetContainer() const
virtual void MapSubwindows()
Map all canvas sub windows.
TGVScrollBar * GetVScrollbar() const
TGViewPort * GetViewPort() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Adding a frame to a canvas is actually adding the frame to the viewport container.
virtual void Layout()
Create layout for canvas.
TGHScrollBar * GetHScrollbar() const
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void Layout()
Layout the elements of the composite frame.
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void RemoveAll()
Remove all frames from composite frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual UInt_t GetOptions() const
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void SetWidth(UInt_t w)
const char * GetString() const
virtual void SetLabel(const char *label)
Set the label of this cell to label.
virtual UInt_t GetWidth() const
virtual TGString * GetLabel() const
virtual UInt_t GetHeight() const
void SetCanvas(TGCanvas *canvas)
TGFrame * GetFrame() const
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
TGHorizontalFrame * fButtonFrame
virtual void ScrollCHeaders(Int_t xpos)
Scroll the column headers horizontally.
TGHorizontalFrame * fRangeFrame
virtual void Shrink(UInt_t nrows, UInt_t ncolumns)
Shrink the TGTable by nrows and ncolumns.
virtual UInt_t GetNDataColumns() const
Return the amount of columns in the data source.
TTableRange * fCurrentRange
TGHorizontalFrame * fBottomFrame
virtual void UserRangeChange()
Slot used when the text in one of the range frame text entries changes.
virtual const TGTableHeader * GetColumnHeader(const UInt_t column) const
Const version of GetColumnHeader();.
TVirtualTableInterface * fInterface
TGTableFrame * fTableFrame
virtual TObjArray * GetRow(UInt_t row)
Get row.
virtual void Init()
Initialise the TGTable.
virtual void SetInterface(TVirtualTableInterface *interface, UInt_t nrows=50, UInt_t ncolumns=20)
Set the interface that the TGTable uses to interface.
virtual void Update()
Update the range of the available data and refresh the current view.
virtual void SetEvenRowBackground(Pixel_t pixel)
Set the background color for all even numbered rows.
TGHorizontalFrame * fTopFrame
Pixel_t fEvenRowBackground
virtual TGTableCell * operator()(UInt_t row, UInt_t column)
Operator for easy cell acces.
virtual TGTableHeader * GetTableHeader()
Return a pointer to the table header.
virtual const TGTableHeader * GetRowHeader(const UInt_t row) const
Const version of GetRowHeader();.
virtual TObjArray * GetColumn(UInt_t columns)
Return a pointer to a TObjArray that contains pointers to all the cells in column.
virtual UInt_t GetNDataCells() const
Return the amount of cell in the data source.
virtual const TGTableCell * FindCell(TGString label) const
Const version of FindCell().
TGHorizontalFrame * fTopExtraFrame
virtual void ShrinkRows(UInt_t nrows)
Shrink the rows of the TGTable by nrows.
virtual Pixel_t GetRowBackground(UInt_t row) const
Get the background collor for row.
virtual void SetOddRowBackground(Pixel_t pixel)
Set the background color for all odd numbered rows.
TGTable(const TGWindow *p=0, Int_t id=0, TVirtualTableInterface *interface=0, UInt_t nrows=50, UInt_t ncolumns=20)
Create an array to hold a bunch of numbers.
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 UInt_t GetNTableRows() const
Return the amount of rows in the table.
virtual Pixel_t GetHeaderBackground() const
Get the background color of headers.
virtual UInt_t GetNDataRows() const
Return the amount of rows in the data source.
TObjArray * fColumnHeaders
virtual void SetHeaderBackground(Pixel_t pixel)
Set the background color for the headers.
virtual void UpdateRangeFrame()
Update the range shown in the range frame.
TGTextButton * fNextButton
virtual UInt_t GetNTableColumns() const
Return the amount of columns in the table.
virtual UInt_t GetNTableCells() const
Return the amount of cells in the table.
virtual void UpdateHeaders(EHeaderType type)
Update the labels of the headers of the given type.
virtual void ShrinkColumns(UInt_t ncolumns)
Shrink the columns of the TGTable by ncolumns.
virtual UInt_t GetCHdrWidth() const
Get the current width of the column header frame.
virtual ~TGTable()
TGTable destructor.
virtual UInt_t GetRHdrHeight() const
Get the current height of the row header frame.
virtual void ExpandRows(UInt_t nrows)
Expand the rows of a TGTable by nrows.
virtual void SetDefaultColors()
Set the background color for all rows and headers to their defaults.
TGTextButton * fPrevButton
virtual void PreviousChunk()
Move the table to the previous chunk of the data set with the same size.
virtual const TTableRange * GetCurrentRange() const
Return the current range of the TGTable.
virtual void NextChunk()
Move the table to the next chunk of the data set with the same size.
TGTextEntry * fFirstCellEntry
TGTableHeaderFrame * fRHdrFrame
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 MoveTable(Int_t rows, Int_t columns)
Move and layout the table to the specified range.
virtual void DoRedraw()
Redraw the TGTable.
virtual void Show()
Show the contents of the TGTable in stdout.
TGTextButton * fGotoButton
virtual const TGTableCell * GetCell(UInt_t i, UInt_t j) const
Const version of GetCell().
virtual void ScrollRHeaders(Int_t ypos)
Scroll the row headers vertically.
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.
virtual void UpdateView()
Update and layout the visible part of the TGTable.
TGLabel * fFirstCellLabel
TGTextButton * fUpdateButton
virtual void ExpandColumns(UInt_t ncolumns)
Expand the columns of a TGTable by ncolumns.
TGTableHeader * fTableHeader
Pixel_t fOddRowBackground
TGTableHeaderFrame * fCHdrFrame
Pixel_t fHeaderBackground
TGTextEntry * fRangeEntry
virtual void Expand(UInt_t nrows, UInt_t ncolumns)
Expand a TGTable by nrows and ncolumns.
const char * GetText() const
virtual void SetAlignment(ETextJustification mode=kTextLeft)
Sets the alignment of the text entry.
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.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual void DestroyWindow()
destroy window
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * At(Int_t idx) const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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.
Int_t Atoi() const
Return integer value of string.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Bool_t IsAlnum() const
Returns true if all characters in string are alphanumeric.
virtual void Print()
Print the values of a range.
Bool_t operator==(TTableRange &other)
Operator to determine if 2 ranges are equal.
TTableRange()
TTableRange constuctor.
virtual UInt_t GetNRows()=0
virtual const char * GetValueAsString(UInt_t row, UInt_t column)=0
virtual const char * GetColumnHeader(UInt_t column)=0
virtual UInt_t GetNColumns()=0
virtual const char * GetRowHeader(UInt_t row)=0