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 39 of file FWTableWidget.cc.

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

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

References m_headerBackground, m_headerForeground, and m_lineSeparator.

133  {
134  if (nullptr != m_headerBackground) {
135  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_headerBackground->GetGC());
136  }
137  if (nullptr != m_headerForeground) {
138  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_headerForeground->GetGC());
139  }
140 
141  if (nullptr != m_lineSeparator) {
142  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_lineSeparator->GetGC());
143  }
144 }
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 465 of file FWTableWidget.cc.

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

465  {
466  Int_t btn = event->fCode;
467  if (btn != kButton1 && btn != kButton3) {
468  return;
469  }
470  m_bodyTable->buttonReleasedInRowHeader(row, event, relX, relY);
471 }
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 345 of file FWTableWidget.cc.

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

345  {
346  Int_t btn = event->fCode;
347  Int_t keyMod = event->fState;
348  if (btn == kButton5) {
349  //should scroll down
350  if (m_vSlider) {
351  Int_t p = m_vSlider->GetPosition();
352  Int_t mx = m_vSlider->GetRange();
353  p += m_vSlider->GetSmallIncrement();
354  if (p > mx) {
355  p = mx;
356  }
357  m_vSlider->SetPosition(p);
358  }
359  return;
360  }
361  if (btn == kButton4) {
362  //should scroll up
363  if (m_vSlider) {
364  Int_t p = m_vSlider->GetPosition();
365  p -= m_vSlider->GetSmallIncrement();
366  if (0 > p) {
367  p = 0;
368  }
369  m_vSlider->SetPosition(p);
370  }
371  return;
372  }
373  if (btn != kButton1 && btn != kButton3) {
374  return;
375  }
376  if (row >= -1 and row < m_bodyTable->numberOfRows()) {
377  Int_t globalX, globalY;
378  Window_t childdum;
379  gVirtualX->TranslateCoordinates(
380  m_body->GetId(), gClient->GetDefaultRoot()->GetId(), event->fX, event->fY, globalX, globalY, childdum);
381  cellClicked(m_bodyTable->unsortedRowNumber(row), column, btn, keyMod, globalX, globalY);
382  rowClicked(m_bodyTable->unsortedRowNumber(row), btn, keyMod, globalX, globalY);
383  }
384 }
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 331 of file FWTableWidget.cc.

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

331  {
332  Int_t btn = event->fCode;
333  Int_t keyMod = event->fState;
334  //Int_t keyMod = event->fState;
335  if (btn == kButton1 || btn == kButton3) {
336  if (m_sortedColumn == column) {
337  sort(column, !m_descendingSort);
338  } else {
339  sort(column, true);
340  }
341  }
342  columnClicked(column, btn, keyMod);
343 }
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 472 of file FWTableWidget.cc.

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

472  {
473  Int_t btn = event->fCode;
474  if (btn != kButton1 && btn != kButton3) {
475  return;
476  }
477  m_bodyTable->buttonReleasedInRowHeader(row, event, relX, relY);
478 }
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 386 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

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

◆ childrenEvent()

void FWTableWidget::childrenEvent ( Event_t *  )

Definition at line 399 of file FWTableWidget.cc.

References Clicked().

399 { Clicked(); }

◆ ClassDefOverride()

FWTableWidget::ClassDefOverride ( FWTableWidget  ,
 
)

◆ Clicked()

void FWTableWidget::Clicked ( )

Definition at line 401 of file FWTableWidget.cc.

Referenced by childrenEvent().

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

◆ columnClicked()

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

Definition at line 415 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInHeader().

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

◆ dataChanged()

void FWTableWidget::dataChanged ( void  )

Definition at line 425 of file FWTableWidget.cc.

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

Referenced by FWTableViewTableManager::implSort().

425  {
426  bool needs_layout = m_forceLayout;
427  m_forceLayout = false;
428 
429  m_body->dataChanged();
430  if (m_rowHeader) {
433  }
434  //set sizes
435  std::vector<unsigned int> columnWidths = m_body->widthOfTextInColumns();
436  if (m_header) {
437  // reset header back to its internal max rather than the last width
439  std::vector<unsigned int> headerWidths = m_header->widthOfTextInColumns();
440  for (std::vector<unsigned int>::iterator it = columnWidths.begin(),
441  itEnd = columnWidths.end(),
442  itHeader = headerWidths.begin();
443  it != itEnd;
444  ++it, ++itHeader) {
445  if (*itHeader > *it) {
446  *it = *itHeader;
447  }
448  }
449  m_header->setWidthOfTextInColumns(columnWidths);
450  }
451  m_body->setWidthOfTextInColumns(columnWidths);
452 
453  //this updates sliders to match our new data
454  bool layoutDoneByhandleResize = handleResize(GetWidth(), GetHeight());
455  if (needs_layout && !layoutDoneByhandleResize) {
456  Layout();
457  }
458  gClient->NeedRedraw(m_body);
459  if (m_header)
460  gClient->NeedRedraw(m_header);
461  if (m_rowHeader)
462  gClient->NeedRedraw(m_rowHeader);
463 }
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 506 of file FWTableWidget.cc.

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

◆ forceLayout()

void FWTableWidget::forceLayout ( )
inline

◆ GetDefaultSize()

TGDimension FWTableWidget::GetDefaultSize ( ) const
override

Definition at line 483 of file FWTableWidget.cc.

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

483  {
484  TGDimension returnValue;
485  if (m_header) {
486  returnValue.fHeight += m_header->GetDefaultHeight();
487  }
488  if (m_rowHeader) {
489  returnValue.fWidth += m_rowHeader->GetDefaultWidth();
490  }
491  returnValue = returnValue + m_body->GetDefaultSize();
492  returnValue.fHeight += m_hSlider->GetDefaultHeight();
493  returnValue.fWidth += m_vSlider->GetDefaultWidth();
494 
495  return returnValue;
496 }
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 226 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().

226  {
227  //std::cout <<"Resize"<<std::endl;
228  bool redoLayout = false;
229 
230  TGDimension def = m_body->GetDefaultSize();
231  UInt_t fullWidth = def.fWidth;
232  if (m_rowHeader) {
233  fullWidth += m_rowHeader->GetDefaultSize().fWidth;
234  }
235 
236  UInt_t headerHeight = 0;
237  if (m_header) {
238  headerHeight = m_header->GetHeight();
239  }
240  UInt_t fullHeight = def.fHeight + headerHeight;
241 
242  UInt_t sBarWidth = (h < fullHeight) ? m_vSlider->GetWidth() : 0;
243  UInt_t sBarHeight = (w < fullWidth) ? m_hSlider->GetHeight() : 0;
244  if (sBarWidth == 0 && sBarHeight > 0 && h < fullHeight + sBarHeight)
245  sBarWidth = m_vSlider->GetWidth();
246  else if (sBarHeight == 0 && sBarWidth > 0 && h < fullWidth + sBarWidth)
247  sBarHeight = m_hSlider->GetHeight();
248  fullWidth += sBarWidth;
249  fullHeight += sBarHeight;
250 
251  if (w < fullWidth) {
252  if (!m_showingHSlider) {
253  ShowFrame(m_hSlider);
254  redoLayout = true;
255  m_showingHSlider = true;
256  }
257  m_hSlider->SetRange(fullWidth, w);
258  } else {
259  if (m_showingHSlider) {
260  HideFrame(m_hSlider);
261  m_hSlider->SetPosition(0);
262  m_showingHSlider = false;
263  redoLayout = true;
264  }
265  }
266 
267  if (h < fullHeight) {
268  if (!m_showingVSlider) {
269  ShowFrame(m_vSlider);
270  m_showingVSlider = true;
271  redoLayout = true;
272  }
273  m_vSlider->SetRange(fullHeight, h);
274  } else {
275  if (m_showingVSlider) {
276  HideFrame(m_vSlider);
277  m_vSlider->SetPosition(0);
278  m_showingVSlider = false;
279  redoLayout = true;
280  }
281  }
282  if (redoLayout) {
283  Layout();
284  }
285 
286  return redoLayout;
287 }
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 289 of file FWTableWidget.cc.

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

289  {
290  //std::cout <<"MoveResize"<<std::endl;
291  if (w != GetWidth() || h != GetHeight()) {
292  handleResize(w, h);
293  }
294  TGCompositeFrame::MoveResize(x, y, w, h);
295 }
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 297 of file FWTableWidget.cc.

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

297  {
298  // Handle message generated by the canvas scrollbars.
299 
300  switch (GET_MSG(msg)) {
301  case kC_HSCROLL:
302  switch (GET_SUBMSG(msg)) {
303  case kSB_SLIDERTRACK:
304  case kSB_SLIDERPOS:
305  m_body->setHorizontalOffset(parm1);
306  if (m_header) {
308  }
309  break;
310  }
311  break;
312 
313  case kC_VSCROLL:
314  switch (GET_SUBMSG(msg)) {
315  case kSB_SLIDERTRACK:
316  case kSB_SLIDERPOS:
317  m_body->setVerticalOffset(parm1);
318  if (m_rowHeader) {
320  }
321  break;
322  }
323  break;
324 
325  default:
326  break;
327  }
328  return kTRUE;
329 }
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 221 of file FWTableWidget.cc.

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

Referenced by FWCollectionSummaryWidget::toggleShowHide().

221  {
222  handleResize(w, h);
223  TGCompositeFrame::Resize(w, h);
224 }
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 403 of file FWTableWidget.cc.

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

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

◆ SetBackgroundColor()

void FWTableWidget::SetBackgroundColor ( Pixel_t  iColor)
override

Definition at line 173 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().

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

◆ SetHeaderBackgroundColor()

void FWTableWidget::SetHeaderBackgroundColor ( Pixel_t  iColor)

Definition at line 188 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().

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

◆ SetHeaderForegroundColor()

void FWTableWidget::SetHeaderForegroundColor ( Pixel_t  iColor)

Definition at line 198 of file FWTableWidget.cc.

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

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

◆ SetLineSeparatorColor()

void FWTableWidget::SetLineSeparatorColor ( Pixel_t  iColor)

Definition at line 209 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().

209  {
210  if (nullptr == m_lineSeparator) {
211  GCValues_t t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
212  m_lineSeparator = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
213  }
214  m_lineSeparator->SetForeground(iColor);
216  if (m_rowHeader) {
218  }
219 }
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 161 of file FWTableWidget.cc.

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

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

161  {
162  if (nullptr != m_headerTable) {
163  m_headerTable->sort(iColumn, iDescendingSort);
164  }
165  m_bodyTable->sort(iColumn, iDescendingSort);
166  m_sortedColumn = iColumn;
167  m_descendingSort = iDescendingSort;
168 
169  //fClient->NeedRedraw(m_header);
170  //fClient->NeedRedraw(m_body);
171 }
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().