158 fRowHeaders(0), fColumnHeaders(0), fReadOnly(
kFALSE), fSelectColor(0),
159 fTMode(0), fAllData(
kFALSE), fTableFrame(0), fCanvas(0), fCellWidth(80),
160 fCellHeight(25), fInterface(interface)
263 "UserRangeChange()");
274 "UserRangeChange()");
301 for(i = 0; i < nrows; i++) {
307 for(i = 0; i < ncolumns; i++) {
316 for (i = 0; i < nrows; i++) {
319 for (j = 0; j < ncolumns; j++) {
336 for (i = 0; i < nrows; i++) {
340 for (j = 0; j < ncolumns; j++) {
401 sbar->
Connect(
"PositionChanged(Int_t)",
"TGTable",
this,
"ScrollRHeaders(Int_t)");
403 sbar->
Connect(
"PositionChanged(Int_t)",
"TGTable",
this,
"ScrollCHeaders(Int_t)");
446 for (i = 0; i < ncolumns; i++) {
453 for (i = 0; i < ntrows; i++) {
455 for (j = 0; j < ncolumns; j++) {
484 for (i = 0; i < nrows; i++) {
491 for (j = 0; j < ntcolumns ; j++) {
515 for (
Int_t i = 0; i < ncolumns; i++) {
528 for (
Int_t i = 0; i < nrows; i++) {
548 UInt_t i = 0, j = 0, k = 0;
551 Info(
"TGTable::ShrinkColumns",
"Cannot shrink smaller than 1"
552 " column, adjusting");
563 for (i = 0; i < ntrows; i++) {
564 for (j = 0; j < ncolumns; j++) {
565 k = ntcolumns - ncolumns + j;
578 for (j = 0; j < ncolumns; j++) {
604 Info(
"TGTable::ShrinkRows",
"Cannot shrink smaller than 1 row, adjusting");
615 for (i = 0; i < nrows; i++) {
616 for (j = 0; j < ntcolumns ; j++) {
617 if (
GetRow(ntrows - nrows + i)) {
652 for (i = 0; i < max; i++) {
659 for (i = 0; i < max; i++) {
718 if (newnrows != oldnrows){
719 if (newnrows > oldnrows) {
726 if (newncolumns != oldncolumns){
727 if (newncolumns > oldncolumns) {
735 if ((newncolumns != oldncolumns) || (newnrows != oldnrows)) {
746 newnrows, newncolumns));
749 for (i = 0; i < (
Int_t)newnrows; i++) {
753 for (j = 0; j < (
Int_t)newncolumns; j++) {
810 for(
UInt_t ui = 0; ui < nrows; ui++) {
917 for (i = 0; i < nrows; i++) {
918 for (j = 0; j < ncolumns; j++) {
941 std::ios_base::fmtflags org_flags = std::cout.flags();
943 for (j = 0; j < ncolumns + 1; j++) {
946 if (hdr) std::cout <<
" " << std::setw(12) << std::right
950 if (hdr) std::cout <<
" " << std::setw(12) << std::right
954 std::cout << std::endl;
956 for (i = 0; i < nrows; i++) {
957 for (j = 0; j < ncolumns + 1; j++) {
960 if (hdr) std::cout <<
" " << std::setw(12) << std::right
964 if (cell) std::cout <<
" " << std::setw(12) << std::right
968 std::cout << std::endl;
971 std::cout.flags(org_flags);
1067 for (i = 0; i < nrows; i++) {
1068 for (j = 0; j < ncolumns; j++) {
1234 for (i = 0; i < nrows; i++) {
1235 for (j = 0; j < ncolumns; j++) {
1262 for (i = 0; i < nrows; i++) {
1263 for (j = 0; j < ncolumns; j++) {
1289 for (i = 0; i < nrows; i++) {
1297 for (j = 0; j < ncolumns; j++) {
1339 if(xtl == xbr || ytl == ybr) {
1340 Error(
"TGTable::GotoTableRange",
"x or y range = 0");
1348 Info(
"TGTable::GotoTableRange",
"Swapping x-range boundries");
1354 Info(
"TGTable::GotoTableRange",
"Swapping y-range boundries");
1360 if((xtl < 0) || (xbr < 0)) {
1361 Info(
"TGTable::GotoTableRange",
"Column boundry out of bounds, adjusting");
1370 if((ytl < 0) || (ybr < 0)) {
1371 Info(
"TGTable::GotoTableRange",
"Row boundry out of bounds, adjusting");
1381 Info(
"TGTable::GotoTableRange",
"Left Column boundry out of bounds, "
1384 xtl = xbr - ncolumns;
1387 Info(
"TGTable::GotoTableRange",
"Right column boundry out of"
1388 " bounds, set to 0");
1392 Info(
"TGTable::GotoTableRange",
"Bottom row boundry out of bounds, "
1399 Info(
"TGTable::GotoTableRange",
"Top row boundry out of bounds, "
1507 pos = range.
First(
'x');
1552 std::cout <<
"Range = (" <<
fXtl <<
"," <<
fYtl <<
")->("
1553 <<
fXbr <<
"," <<
fYbr <<
")" << std::endl;
ULong_t Pixel_t
Pixel value.
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
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
The base class for composite widgets (menu bars, list boxes, etc.).
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.
UInt_t fHeight
frame height
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)
Pixel_t fBackground
frame background color
A composite frame that layout their children in horizontal way.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
This layout managers does not make use of TGLayoutHints.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
TGTableCell is the class that represents a single cell in a TGTable.
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
TGTableFrame contains a composite frame that uses a TGMatrixLayout to Layout the frames it contains.
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.
Create an array to hold a bunch of numbers.
TGHorizontalFrame * fButtonFrame
Contains the buttons.
virtual void ScrollCHeaders(Int_t xpos)
Scroll the column headers horizontally.
TGHorizontalFrame * fRangeFrame
Frame that contains the top part.
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
Range of data currently loaded.
TGHorizontalFrame * fBottomFrame
Frame that contains the bottom part.
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
TTableRange * fGotoRange
Range used by Goto frame.
TGTableFrame * fTableFrame
Container for the frames.
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
Frame that contains the top part.
Pixel_t fEvenRowBackground
Background color for even numbered rows.
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
Dev idea.
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.
TList * fMainHintsList
List for all hints used in the main table frame.
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)
TGTable constuctor.
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.
TObjArray * fRows
Array of rows.
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
Array of column headers.
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
Button to view next chunk.
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.
UInt_t fCellHeight
Default cell width.
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.
TTableRange * fDataRange
Full range of the data set.
virtual void SetDefaultColors()
Set the background color for all rows and headers to their defaults.
TObjArray * fRowHeaders
Array of row headers.
TGTextButton * fPrevButton
Button to view previous chunk.
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
TextEntry for the range frame.
TGCanvas * fCanvas
Canvas that will contains the cells.
TGTableHeaderFrame * fRHdrFrame
Frame that contains the row headers.
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
Button to goto a new range.
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.
TGLabel * fRangeLabel
Label for the range frame.
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.
UInt_t fCellWidth
Default cell width.
TGLabel * fFirstCellLabel
Label for the range frame.
TGTextButton * fUpdateButton
Button to update current view.
virtual void ExpandColumns(UInt_t ncolumns)
Expand the columns of a TGTable by ncolumns.
TGTableHeader * fTableHeader
Top left element of the table.
Pixel_t fOddRowBackground
Background color for odd numbered rows.
TGTableHeaderFrame * fCHdrFrame
Frame that contains the row headers.
Pixel_t fHeaderBackground
Background color for headers.
Bool_t fAllData
Is the data bigger than the table.
TGTextEntry * fRangeEntry
TextEntry for the range frame.
virtual void Expand(UInt_t nrows, UInt_t ncolumns)
Expand a TGTable by nrows and ncolumns.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
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.
ROOT GUI Window base class.
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
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.
UInt_t fXtl
Top left X coordinate.
UInt_t fYbr
Bottom right Y coordinate.
UInt_t fXbr
Bottom right X coordinate.
UInt_t fYtl
Top left Y coordinate.
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