CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FWTableWidget Class Reference

#include <Fireworks/TableWidget/interface/FWTableWidget.h>

Inheritance diagram for FWTableWidget:

Public Member Functions

FWTabularWidgetbody ()
 
void buttonPressedInRowHeader (Int_t row, Int_t column, Event_t *event, Int_t relX, Int_t relY)
 
void buttonReleasedInBody (Int_t row, Int_t column, Event_t *event, Int_t, Int_t)
 
void buttonReleasedInHeader (Int_t row, Int_t column, Event_t *event, Int_t, Int_t)
 
void buttonReleasedInRowHeader (Int_t row, Int_t column, Event_t *event, Int_t relX, Int_t relY)
 
void cellClicked (Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
 
void childrenEvent (Event_t *)
 
 ClassDefOverride (FWTableWidget, 0)
 
void Clicked ()
 
void columnClicked (Int_t iColumn, Int_t iButton, Int_t iKeyMod)
 
void dataChanged ()
 
bool descendingSort () const
 
void disableGrowInWidth ()
 
void forceLayout ()
 
 FWTableWidget (FWTableManagerBase *iManager, const TGWindow *p=nullptr)
 
TGDimension GetDefaultSize () const override
 
void MoveResize (Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
 
Bool_t ProcessMessage (Long_t msg, Long_t parm1, Long_t parm2) override
 
void Resize (UInt_t w, UInt_t h) override
 
void rowClicked (Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
 
void SetBackgroundColor (Pixel_t) override
 
void SetHeaderBackgroundColor (Pixel_t)
 
void SetHeaderForegroundColor (Pixel_t)
 
void SetLineSeparatorColor (Pixel_t)
 
void sort (UInt_t iColumn, bool iDescendingSort)
 
int sortedColumn () const
 
 ~FWTableWidget () override
 

Protected Member Functions

void DoRedraw () override
 

Private Member Functions

bool handleResize (UInt_t w, UInt_t h)
 

Private Attributes

FWTabularWidgetm_body
 
FWTableManagerBasem_bodyTable
 
bool m_descendingSort
 
bool m_forceLayout
 
FWTabularWidgetm_header
 
TGGC * m_headerBackground
 
TGGC * m_headerForeground
 
FWTableManagerBasem_headerTable
 
TGHScrollBar * m_hSlider
 
TGGC * m_lineSeparator
 
FWTabularWidgetm_rowHeader
 
FWTableManagerBasem_rowHeaderTable
 
bool m_showingHSlider
 
bool m_showingVSlider
 
int m_sortedColumn
 
TGVScrollBar * m_vSlider
 

Detailed Description

Description: ROOT widget for representing data in a tabular form where the data is accessed via a FWTableManagerBase

Usage: This widget creates a table made up of cells where the representation of the cells is controlled by the FWTableManagerBase instance passed to the FWTableWidget's constructor. If the data for the FWTableManagerBase changes, the view is automatically updated. See the documentation for FWTableManagerBase for further details.

Definition at line 35 of file FWTableWidget.h.

Constructor & Destructor Documentation

◆ FWTableWidget()

FWTableWidget::FWTableWidget ( FWTableManagerBase iManager,
const TGWindow *  p = nullptr 
)

Definition at line 41 of file FWTableWidget.cc.

References FWTableManagerBase::cellDataIsSortable(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, kColOptions, kRowOptions, m_body, m_bodyTable, m_header, m_headerTable, m_hSlider, m_rowHeader, m_rowHeaderTable, m_vSlider, FWTabularWidget::setWidthOfTextInColumns(), and FWTabularWidget::widthOfTextInColumns().

42  : TGCompositeFrame(p),
43  m_bodyTable(iManager),
45  : static_cast<FWTableManagerBase*>(nullptr)),
46  m_rowHeaderTable(iManager->hasRowHeaders() ? new FWAdapterRowHeaderTableManager(iManager)
47  : static_cast<FWTableManagerBase*>(nullptr)),
48  m_header(nullptr),
49  m_rowHeader(nullptr),
52  m_sortedColumn(-1),
55  m_headerBackground(nullptr),
56  m_headerForeground(nullptr),
57  m_lineSeparator(nullptr) {
58  SetLayoutManager(new TGTableLayout(this, 3, 3));
59 
60  if (nullptr != m_headerTable) {
62  AddFrame(m_header, new TGTableLayoutHints(1, 2, 0, 1, kLHintsTop | kLHintsLeft | kRowOptions));
64  m_header->Connect("buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
65  "FWTableWidget",
66  this,
67  "buttonReleasedInHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
68  }
69  m_body = new FWTabularWidget(iManager, this, GetWhiteGC()());
70  //m_body->SetBackgroundColor(kWidgetColor);
71  AddFrame(m_body, new TGTableLayoutHints(1, 2, 1, 2, kLHintsTop | kLHintsLeft | kRowOptions | kColOptions));
72  m_body->Connect("buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
73  "FWTableWidget",
74  this,
75  "buttonReleasedInBody(Int_t,Int_t,Event_t*,Int_t,Int_t)");
76 
77  //set sizes
78  std::vector<unsigned int> columnWidths = m_body->widthOfTextInColumns();
79  if (nullptr != m_header) {
80  std::vector<unsigned int> headerWidths = m_header->widthOfTextInColumns();
81  for (std::vector<unsigned int>::iterator it = columnWidths.begin(),
82  itEnd = columnWidths.end(),
83  itHeader = headerWidths.begin();
84  it != itEnd;
85  ++it, ++itHeader) {
86  if (*itHeader > *it) {
87  *it = *itHeader;
88  }
89  }
90  }
91  if (nullptr != m_header) {
92  m_header->setWidthOfTextInColumns(columnWidths);
93  }
94  m_body->setWidthOfTextInColumns(columnWidths);
95  if (m_rowHeaderTable) {
96  m_rowHeader = new FWTabularWidget(m_rowHeaderTable, this, GetWhiteGC()());
97  //m_rowHeader->SetBackgroundColor(kWidgetColor);
98 
99  AddFrame(m_rowHeader, new TGTableLayoutHints(0, 1, 1, 2, kLHintsTop | kLHintsLeft | kColOptions));
100  m_rowHeader->Connect("buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
101  "FWTableWidget",
102  this,
103  "buttonReleasedInBody(Int_t,Int_t,Event_t*,Int_t,Int_t)");
104  m_rowHeader->Connect("buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
105  "FWTableWidget",
106  this,
107  "buttonReleasedInRowHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
109  }
110 
111  m_hSlider = new TGHScrollBar(this);
112  AddFrame(m_hSlider, new TGTableLayoutHints(1, 2, 2, 3, kRowOptions));
113  m_hSlider->Connect("ProcessedEvent(Event_t*)", "FWTableWidget", this, "childrenEvent(Event_t *)");
114  m_vSlider = new TGVScrollBar(this);
115  m_vSlider->SetSmallIncrement(12);
116  AddFrame(m_vSlider, new TGTableLayoutHints(2, 3, 1, 2, kColOptions));
117  m_vSlider->Connect("ProcessedEvent(Event_t*)", "FWTableWidget", this, "childrenEvent(Event_t *)");
118  MapSubwindows();
119  Layout();
120  //HideFrame(m_hSlider);
121  //HideFrame(m_vSlider);
122  m_hSlider->Associate(this);
123  m_vSlider->Associate(this);
124 
125  m_hSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
126  m_vSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
127  m_bodyTable->Connect("dataChanged()", "FWTableWidget", this, "dataChanged()");
128 }
virtual bool cellDataIsSortable() const
FWTableManagerBase * m_bodyTable
TGVScrollBar * m_vSlider
TGGC * m_headerBackground
void setWidthOfTextInColumns(const std::vector< unsigned int > &)
FWTabularWidget * m_body
TGGC * m_headerForeground
TGGC * m_lineSeparator
virtual bool hasLabelHeaders() const
static const UInt_t kRowOptions
FWTabularWidget * m_rowHeader
static const UInt_t kColOptions
const std::vector< unsigned int > & widthOfTextInColumns() const
FWTableManagerBase * m_headerTable
FWTabularWidget * m_header
FWTableManagerBase * m_rowHeaderTable
TGHScrollBar * m_hSlider

◆ ~FWTableWidget()

FWTableWidget::~FWTableWidget ( )
override

Definition at line 135 of file FWTableWidget.cc.

References m_headerBackground, m_headerForeground, and m_lineSeparator.

135  {
136  if (nullptr != m_headerBackground) {
137  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_headerBackground->GetGC());
138  }
139  if (nullptr != m_headerForeground) {
140  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_headerForeground->GetGC());
141  }
142 
143  if (nullptr != m_lineSeparator) {
144  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_lineSeparator->GetGC());
145  }
146 }
TGGC * m_headerBackground
TGGC * m_headerForeground
TGGC * m_lineSeparator

Member Function Documentation

◆ body()

FWTabularWidget* FWTableWidget::body ( )
inline

Definition at line 90 of file FWTableWidget.h.

References m_body.

Referenced by FWPathsPopup::FWPathsPopup(), FWGeometryTableViewBase::postConst(), and FWPathsPopup::postEvent().

90 { return m_body; }
FWTabularWidget * m_body

◆ buttonPressedInRowHeader()

void FWTableWidget::buttonPressedInRowHeader ( Int_t  row,
Int_t  column,
Event_t *  event,
Int_t  relX,
Int_t  relY 
)

Definition at line 467 of file FWTableWidget.cc.

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

467  {
468  Int_t btn = event->fCode;
469  if (btn != kButton1 && btn != kButton3) {
470  return;
471  }
472  m_bodyTable->buttonReleasedInRowHeader(row, event, relX, relY);
473 }
FWTableManagerBase * m_bodyTable
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
Definition: event.py:1

◆ buttonReleasedInBody()

void FWTableWidget::buttonReleasedInBody ( Int_t  row,
Int_t  column,
Event_t *  event,
Int_t  iRelX,
Int_t  iRelY 
)

Definition at line 347 of file FWTableWidget.cc.

References cellClicked(), m_body, m_bodyTable, m_vSlider, AlCaHLTBitMon_ParallelJobs::p, rowClicked(), and FWTableManagerBase::unsortedRowNumber().

347  {
348  Int_t btn = event->fCode;
349  Int_t keyMod = event->fState;
350  if (btn == kButton5) {
351  //should scroll down
352  if (m_vSlider) {
353  Int_t p = m_vSlider->GetPosition();
354  Int_t mx = m_vSlider->GetRange();
355  p += m_vSlider->GetSmallIncrement();
356  if (p > mx) {
357  p = mx;
358  }
359  m_vSlider->SetPosition(p);
360  }
361  return;
362  }
363  if (btn == kButton4) {
364  //should scroll up
365  if (m_vSlider) {
366  Int_t p = m_vSlider->GetPosition();
367  p -= m_vSlider->GetSmallIncrement();
368  if (0 > p) {
369  p = 0;
370  }
371  m_vSlider->SetPosition(p);
372  }
373  return;
374  }
375  if (btn != kButton1 && btn != kButton3) {
376  return;
377  }
378  if (row >= -1 and row < m_bodyTable->numberOfRows()) {
379  Int_t globalX, globalY;
380  Window_t childdum;
381  gVirtualX->TranslateCoordinates(
382  m_body->GetId(), gClient->GetDefaultRoot()->GetId(), event->fX, event->fY, globalX, globalY, childdum);
383  cellClicked(m_bodyTable->unsortedRowNumber(row), column, btn, keyMod, globalX, globalY);
384  rowClicked(m_bodyTable->unsortedRowNumber(row), btn, keyMod, globalX, globalY);
385  }
386 }
FWTableManagerBase * m_bodyTable
TGVScrollBar * m_vSlider
FWTabularWidget * m_body
virtual int unsortedRowNumber(int iSortedRowNumber) const =0
when passed the index to the sorted order of the rows it returns the original row number from the und...
void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
void rowClicked(Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)

◆ buttonReleasedInHeader()

void FWTableWidget::buttonReleasedInHeader ( Int_t  row,
Int_t  column,
Event_t *  event,
Int_t  ,
Int_t   
)

Definition at line 333 of file FWTableWidget.cc.

References columnClicked(), m_descendingSort, m_sortedColumn, and sort().

333  {
334  Int_t btn = event->fCode;
335  Int_t keyMod = event->fState;
336  //Int_t keyMod = event->fState;
337  if (btn == kButton1 || btn == kButton3) {
338  if (m_sortedColumn == column) {
339  sort(column, !m_descendingSort);
340  } else {
341  sort(column, true);
342  }
343  }
344  columnClicked(column, btn, keyMod);
345 }
void sort(UInt_t iColumn, bool iDescendingSort)
void columnClicked(Int_t iColumn, Int_t iButton, Int_t iKeyMod)

◆ buttonReleasedInRowHeader()

void FWTableWidget::buttonReleasedInRowHeader ( Int_t  row,
Int_t  column,
Event_t *  event,
Int_t  relX,
Int_t  relY 
)

Definition at line 474 of file FWTableWidget.cc.

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

474  {
475  Int_t btn = event->fCode;
476  if (btn != kButton1 && btn != kButton3) {
477  return;
478  }
479  m_bodyTable->buttonReleasedInRowHeader(row, event, relX, relY);
480 }
FWTableManagerBase * m_bodyTable
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
Definition: event.py:1

◆ cellClicked()

void FWTableWidget::cellClicked ( Int_t  iRow,
Int_t  iColumn,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 388 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

388  {
389  keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
390  //std::cout <<"rowClicked "<<row<<" "<<btn<<" "<<keyMod<<std::endl;
391  Long_t args[6];
392  args[0] = (Long_t)row;
393  args[1] = (Long_t)column;
394  args[2] = (Long_t)btn;
395  args[3] = (Long_t)keyMod;
396  args[4] = (Long_t)iGlobalX;
397  args[5] = (Long_t)iGlobalY;
398  Emit("cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)", args);
399 }

◆ childrenEvent()

void FWTableWidget::childrenEvent ( Event_t *  )

Definition at line 401 of file FWTableWidget.cc.

References Clicked().

401 { Clicked(); }

◆ ClassDefOverride()

FWTableWidget::ClassDefOverride ( FWTableWidget  ,
 
)

◆ Clicked()

void FWTableWidget::Clicked ( )

Definition at line 403 of file FWTableWidget.cc.

Referenced by childrenEvent().

403 { Emit("Clicked()"); }

◆ columnClicked()

void FWTableWidget::columnClicked ( Int_t  iColumn,
Int_t  iButton,
Int_t  iKeyMod 
)

Definition at line 417 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInHeader().

417  {
418  keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
419  //std::cout <<"rowClicked "<<row<<" "<<btn<<" "<<keyMod<<std::endl;
420  Long_t args[3];
421  args[0] = (Long_t)column;
422  args[1] = (Long_t)btn;
423  args[2] = (Long_t)keyMod;
424  Emit("columnClicked(Int_t,Int_t,Int_t)", args);
425 }

◆ dataChanged()

void FWTableWidget::dataChanged ( void  )

Definition at line 427 of file FWTableWidget.cc.

References FWTabularWidget::dataChanged(), handleResize(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, m_body, m_forceLayout, m_header, m_rowHeader, FWTabularWidget::setWidthOfTextInColumns(), and FWTabularWidget::widthOfTextInColumns().

Referenced by FWTableViewTableManager::implSort().

427  {
428  bool needs_layout = m_forceLayout;
429  m_forceLayout = false;
430 
431  m_body->dataChanged();
432  if (m_rowHeader) {
435  }
436  //set sizes
437  std::vector<unsigned int> columnWidths = m_body->widthOfTextInColumns();
438  if (m_header) {
439  // reset header back to its internal max rather than the last width
441  std::vector<unsigned int> headerWidths = m_header->widthOfTextInColumns();
442  for (std::vector<unsigned int>::iterator it = columnWidths.begin(),
443  itEnd = columnWidths.end(),
444  itHeader = headerWidths.begin();
445  it != itEnd;
446  ++it, ++itHeader) {
447  if (*itHeader > *it) {
448  *it = *itHeader;
449  }
450  }
451  m_header->setWidthOfTextInColumns(columnWidths);
452  }
453  m_body->setWidthOfTextInColumns(columnWidths);
454 
455  //this updates sliders to match our new data
456  bool layoutDoneByhandleResize = handleResize(GetWidth(), GetHeight());
457  if (needs_layout && !layoutDoneByhandleResize) {
458  Layout();
459  }
460  gClient->NeedRedraw(m_body);
461  if (m_header)
462  gClient->NeedRedraw(m_header);
463  if (m_rowHeader)
464  gClient->NeedRedraw(m_rowHeader);
465 }
bool handleResize(UInt_t w, UInt_t h)
void setWidthOfTextInColumns(const std::vector< unsigned int > &)
FWTabularWidget * m_body
FWTabularWidget * m_rowHeader
const std::vector< unsigned int > & widthOfTextInColumns() const
FWTabularWidget * m_header

◆ descendingSort()

bool FWTableWidget::descendingSort ( ) const
inline

Definition at line 88 of file FWTableWidget.h.

References m_descendingSort.

Referenced by FWTriggerTableView::addTo(), and FWTableView::addTo().

88 { return m_descendingSort; }

◆ disableGrowInWidth()

void FWTableWidget::disableGrowInWidth ( )

◆ DoRedraw()

void FWTableWidget::DoRedraw ( )
overrideprotected

Definition at line 508 of file FWTableWidget.cc.

508  {
509  // override virtual TGFrame::DoRedraw() to prevent call of gVirtualX->ClearArea();
510 }

◆ forceLayout()

void FWTableWidget::forceLayout ( )
inline

◆ GetDefaultSize()

TGDimension FWTableWidget::GetDefaultSize ( ) const
override

Definition at line 485 of file FWTableWidget.cc.

References FWTabularWidget::GetDefaultSize(), m_body, m_header, m_hSlider, m_rowHeader, and m_vSlider.

485  {
486  TGDimension returnValue;
487  if (m_header) {
488  returnValue.fHeight += m_header->GetDefaultHeight();
489  }
490  if (m_rowHeader) {
491  returnValue.fWidth += m_rowHeader->GetDefaultWidth();
492  }
493  returnValue = returnValue + m_body->GetDefaultSize();
494  returnValue.fHeight += m_hSlider->GetDefaultHeight();
495  returnValue.fWidth += m_vSlider->GetDefaultWidth();
496 
497  return returnValue;
498 }
TGVScrollBar * m_vSlider
TGDimension GetDefaultSize() const override
FWTabularWidget * m_body
FWTabularWidget * m_rowHeader
FWTabularWidget * m_header
TGHScrollBar * m_hSlider

◆ handleResize()

bool FWTableWidget::handleResize ( UInt_t  w,
UInt_t  h 
)
private

Definition at line 228 of file FWTableWidget.cc.

References spu::def(), FWTabularWidget::GetDefaultSize(), h, m_body, m_header, m_hSlider, m_rowHeader, m_showingHSlider, m_showingVSlider, m_vSlider, and w().

Referenced by dataChanged(), MoveResize(), and Resize().

228  {
229  //std::cout <<"Resize"<<std::endl;
230  bool redoLayout = false;
231 
232  TGDimension def = m_body->GetDefaultSize();
233  UInt_t fullWidth = def.fWidth;
234  if (m_rowHeader) {
235  fullWidth += m_rowHeader->GetDefaultSize().fWidth;
236  }
237 
238  UInt_t headerHeight = 0;
239  if (m_header) {
240  headerHeight = m_header->GetHeight();
241  }
242  UInt_t fullHeight = def.fHeight + headerHeight;
243 
244  UInt_t sBarWidth = (h < fullHeight) ? m_vSlider->GetWidth() : 0;
245  UInt_t sBarHeight = (w < fullWidth) ? m_hSlider->GetHeight() : 0;
246  if (sBarWidth == 0 && sBarHeight > 0 && h < fullHeight + sBarHeight)
247  sBarWidth = m_vSlider->GetWidth();
248  else if (sBarHeight == 0 && sBarWidth > 0 && h < fullWidth + sBarWidth)
249  sBarHeight = m_hSlider->GetHeight();
250  fullWidth += sBarWidth;
251  fullHeight += sBarHeight;
252 
253  if (w < fullWidth) {
254  if (!m_showingHSlider) {
255  ShowFrame(m_hSlider);
256  redoLayout = true;
257  m_showingHSlider = true;
258  }
259  m_hSlider->SetRange(fullWidth, w);
260  } else {
261  if (m_showingHSlider) {
262  HideFrame(m_hSlider);
263  m_hSlider->SetPosition(0);
264  m_showingHSlider = false;
265  redoLayout = true;
266  }
267  }
268 
269  if (h < fullHeight) {
270  if (!m_showingVSlider) {
271  ShowFrame(m_vSlider);
272  m_showingVSlider = true;
273  redoLayout = true;
274  }
275  m_vSlider->SetRange(fullHeight, h);
276  } else {
277  if (m_showingVSlider) {
278  HideFrame(m_vSlider);
279  m_vSlider->SetPosition(0);
280  m_showingVSlider = false;
281  redoLayout = true;
282  }
283  }
284  if (redoLayout) {
285  Layout();
286  }
287 
288  return redoLayout;
289 }
int def(FILE *, FILE *, int)
TGVScrollBar * m_vSlider
T w() const
TGDimension GetDefaultSize() const override
FWTabularWidget * m_body
FWTabularWidget * m_rowHeader
FWTabularWidget * m_header
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
TGHScrollBar * m_hSlider

◆ MoveResize()

void FWTableWidget::MoveResize ( Int_t  x,
Int_t  y,
UInt_t  w = 0,
UInt_t  h = 0 
)
override

Definition at line 291 of file FWTableWidget.cc.

References h, handleResize(), w(), x, and y.

291  {
292  //std::cout <<"MoveResize"<<std::endl;
293  if (w != GetWidth() || h != GetHeight()) {
294  handleResize(w, h);
295  }
296  TGCompositeFrame::MoveResize(x, y, w, h);
297 }
T w() const
bool handleResize(UInt_t w, UInt_t h)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ ProcessMessage()

Bool_t FWTableWidget::ProcessMessage ( Long_t  msg,
Long_t  parm1,
Long_t  parm2 
)
override

Definition at line 299 of file FWTableWidget.cc.

References m_body, m_header, m_rowHeader, mps_check::msg, FWTabularWidget::setHorizontalOffset(), and FWTabularWidget::setVerticalOffset().

299  {
300  // Handle message generated by the canvas scrollbars.
301 
302  switch (GET_MSG(msg)) {
303  case kC_HSCROLL:
304  switch (GET_SUBMSG(msg)) {
305  case kSB_SLIDERTRACK:
306  case kSB_SLIDERPOS:
307  m_body->setHorizontalOffset(parm1);
308  if (m_header) {
310  }
311  break;
312  }
313  break;
314 
315  case kC_VSCROLL:
316  switch (GET_SUBMSG(msg)) {
317  case kSB_SLIDERTRACK:
318  case kSB_SLIDERPOS:
319  m_body->setVerticalOffset(parm1);
320  if (m_rowHeader) {
322  }
323  break;
324  }
325  break;
326 
327  default:
328  break;
329  }
330  return kTRUE;
331 }
FWTabularWidget * m_body
void setHorizontalOffset(UInt_t)
FWTabularWidget * m_rowHeader
tuple msg
Definition: mps_check.py:286
FWTabularWidget * m_header
void setVerticalOffset(UInt_t)

◆ Resize()

void FWTableWidget::Resize ( UInt_t  w,
UInt_t  h 
)
override

Definition at line 223 of file FWTableWidget.cc.

References h, handleResize(), and w().

Referenced by FWCollectionSummaryWidget::toggleShowHide().

223  {
224  handleResize(w, h);
225  TGCompositeFrame::Resize(w, h);
226 }
T w() const
bool handleResize(UInt_t w, UInt_t h)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ rowClicked()

void FWTableWidget::rowClicked ( Int_t  iRow,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

This signal is emitted if the mouse button is 'clicked' while the cursor was over a row. Arguments: iRow: the unsorted row number (natural ordering) of the row clicked iButton: the ROOT button value for the click event (e.g. says which button used) iKeyMod: the ROOT key modifier value for the click event (e.g. says if a keyboard key was being held) iGlobalX: the X coordinate of the click in global coordinates iGlobalY: the Y coordinate of the click in global coordinates

Definition at line 405 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

405  {
406  keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
407  //std::cout <<"rowClicked "<<row<<" "<<btn<<" "<<keyMod<<std::endl;
408  Long_t args[5];
409  args[0] = (Long_t)row;
410  args[1] = (Long_t)btn;
411  args[2] = (Long_t)keyMod;
412  args[3] = (Long_t)iGlobalX;
413  args[4] = (Long_t)iGlobalY;
414  Emit("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)", args);
415 }

◆ SetBackgroundColor()

void FWTableWidget::SetBackgroundColor ( Pixel_t  iColor)
override

Definition at line 175 of file FWTableWidget.cc.

References hcaldqm::fClient, m_body, m_header, m_rowHeader, and m_rowHeaderTable.

Referenced by FWCollectionSummaryWidget::colorTable(), FWGUIEventDataAdder::createWindow(), FWPathsPopup::FWPathsPopup(), FWGeometryTableViewBase::postConst(), FWTableView::resetColors(), FWTriggerTableView::setBackgroundColor(), FWTableView::setBackgroundColor(), and FWGeometryTableViewBase::setBackgroundColor().

175  {
176  TGFrame::SetBackgroundColor(iColor);
177  if (m_rowHeaderTable) {
178  m_rowHeader->SetBackgroundColor(iColor);
179  fClient->NeedRedraw(m_rowHeader);
180  }
181  if (m_header) {
182  m_header->SetBackgroundColor(iColor);
183  fClient->NeedRedraw(m_header);
184  }
185  m_body->SetBackgroundColor(iColor);
186  fClient->NeedRedraw(m_body);
187  fClient->NeedRedraw(this);
188 }
FWTabularWidget * m_body
FWTabularWidget * m_rowHeader
FWTabularWidget * m_header
FWTableManagerBase * m_rowHeaderTable

◆ SetHeaderBackgroundColor()

void FWTableWidget::SetHeaderBackgroundColor ( Pixel_t  iColor)

Definition at line 190 of file FWTableWidget.cc.

References m_header, m_headerBackground, FWTabularWidget::setBackgroundAreaContext(), and submitPVValidationJobs::t.

Referenced by FWGUIEventDataAdder::createWindow(), FWPathsPopup::FWPathsPopup(), FWTableView::FWTableView(), FWTriggerTableView::FWTriggerTableView(), FWGeometryTableViewBase::postConst(), and FWCollectionSummaryWidget::toggleShowHide().

190  {
191  if (nullptr == m_headerBackground) {
192  GCValues_t t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
193  m_headerBackground = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
194  }
195  m_headerBackground->SetForeground(iColor);
196  if (nullptr != m_header) {
198  }
199 }
TGGC * m_headerBackground
void setBackgroundAreaContext(GContext_t iContext)
FWTabularWidget * m_header

◆ SetHeaderForegroundColor()

void FWTableWidget::SetHeaderForegroundColor ( Pixel_t  iColor)

Definition at line 200 of file FWTableWidget.cc.

References m_header, m_headerForeground, FWTabularWidget::setLineContext(), and submitPVValidationJobs::t.

200  {
201  if (nullptr == m_headerForeground) {
202  GCValues_t t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
203  m_headerForeground = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
204  }
205  m_headerForeground->SetForeground(iColor);
206  if (nullptr != m_header) {
208  }
209 }
void setLineContext(GContext_t iContext)
TGGC * m_headerForeground
FWTabularWidget * m_header

◆ SetLineSeparatorColor()

void FWTableWidget::SetLineSeparatorColor ( Pixel_t  iColor)

Definition at line 211 of file FWTableWidget.cc.

References m_body, m_lineSeparator, m_rowHeader, FWTabularWidget::setLineContext(), and submitPVValidationJobs::t.

Referenced by FWCollectionSummaryWidget::colorTable(), FWGUIEventDataAdder::createWindow(), FWPathsPopup::FWPathsPopup(), FWGeometryTableViewBase::postConst(), FWTableView::resetColors(), FWTriggerTableView::setBackgroundColor(), and FWGeometryTableViewBase::setBackgroundColor().

211  {
212  if (nullptr == m_lineSeparator) {
213  GCValues_t t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
214  m_lineSeparator = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
215  }
216  m_lineSeparator->SetForeground(iColor);
218  if (m_rowHeader) {
220  }
221 }
void setLineContext(GContext_t iContext)
FWTabularWidget * m_body
TGGC * m_lineSeparator
FWTabularWidget * m_rowHeader

◆ sort()

void FWTableWidget::sort ( UInt_t  iColumn,
bool  iDescendingSort 
)

Sorts the rows of data in the table based on values in column iColumn. If iDescendingSort is 'true' then the rows are sorted in descending order of the values.

Definition at line 163 of file FWTableWidget.cc.

References m_bodyTable, m_descendingSort, m_headerTable, m_sortedColumn, and FWTableManagerBase::sort().

Referenced by buttonReleasedInHeader(), FWTriggerTableView::setFrom(), and FWTableView::setFrom().

163  {
164  if (nullptr != m_headerTable) {
165  m_headerTable->sort(iColumn, iDescendingSort);
166  }
167  m_bodyTable->sort(iColumn, iDescendingSort);
168  m_sortedColumn = iColumn;
169  m_descendingSort = iDescendingSort;
170 
171  //fClient->NeedRedraw(m_header);
172  //fClient->NeedRedraw(m_body);
173 }
FWTableManagerBase * m_bodyTable
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
FWTableManagerBase * m_headerTable

◆ sortedColumn()

int FWTableWidget::sortedColumn ( ) const
inline

Definition at line 87 of file FWTableWidget.h.

References m_sortedColumn.

Referenced by FWTriggerTableView::addTo(), and FWTableView::addTo().

87 { return m_sortedColumn; }

Member Data Documentation

◆ m_body

FWTabularWidget* FWTableWidget::m_body
private

◆ m_bodyTable

FWTableManagerBase* FWTableWidget::m_bodyTable
private

◆ m_descendingSort

bool FWTableWidget::m_descendingSort
private

Definition at line 116 of file FWTableWidget.h.

Referenced by buttonReleasedInHeader(), descendingSort(), and sort().

◆ m_forceLayout

bool FWTableWidget::m_forceLayout
private

Definition at line 117 of file FWTableWidget.h.

Referenced by dataChanged(), and forceLayout().

◆ m_header

FWTabularWidget* FWTableWidget::m_header
private

◆ m_headerBackground

TGGC* FWTableWidget::m_headerBackground
private

Definition at line 119 of file FWTableWidget.h.

Referenced by SetHeaderBackgroundColor(), and ~FWTableWidget().

◆ m_headerForeground

TGGC* FWTableWidget::m_headerForeground
private

Definition at line 120 of file FWTableWidget.h.

Referenced by SetHeaderForegroundColor(), and ~FWTableWidget().

◆ m_headerTable

FWTableManagerBase* FWTableWidget::m_headerTable
private

Definition at line 105 of file FWTableWidget.h.

Referenced by FWTableWidget(), and sort().

◆ m_hSlider

TGHScrollBar* FWTableWidget::m_hSlider
private

Definition at line 111 of file FWTableWidget.h.

Referenced by FWTableWidget(), GetDefaultSize(), and handleResize().

◆ m_lineSeparator

TGGC* FWTableWidget::m_lineSeparator
private

Definition at line 121 of file FWTableWidget.h.

Referenced by SetLineSeparatorColor(), and ~FWTableWidget().

◆ m_rowHeader

FWTabularWidget* FWTableWidget::m_rowHeader
private

◆ m_rowHeaderTable

FWTableManagerBase* FWTableWidget::m_rowHeaderTable
private

Definition at line 106 of file FWTableWidget.h.

Referenced by FWTableWidget(), and SetBackgroundColor().

◆ m_showingHSlider

bool FWTableWidget::m_showingHSlider
private

Definition at line 113 of file FWTableWidget.h.

Referenced by handleResize().

◆ m_showingVSlider

bool FWTableWidget::m_showingVSlider
private

Definition at line 112 of file FWTableWidget.h.

Referenced by handleResize().

◆ m_sortedColumn

int FWTableWidget::m_sortedColumn
private

Definition at line 115 of file FWTableWidget.h.

Referenced by buttonReleasedInHeader(), sort(), and sortedColumn().

◆ m_vSlider

TGVScrollBar* FWTableWidget::m_vSlider
private

Definition at line 110 of file FWTableWidget.h.

Referenced by buttonReleasedInBody(), FWTableWidget(), GetDefaultSize(), and handleResize().