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.

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 }

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().

◆ ~FWTableWidget()

FWTableWidget::~FWTableWidget ( )
override

Definition at line 133 of file FWTableWidget.cc.

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 }

References m_headerBackground, m_headerForeground, and m_lineSeparator.

Member Function Documentation

◆ body()

FWTabularWidget* FWTableWidget::body ( )
inline

Definition at line 90 of file FWTableWidget.h.

90 { return m_body; }

References m_body.

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

◆ 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.

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 }

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ 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.

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 }

References FWTableManagerBase::buttonReleasedInRowHeader(), and m_bodyTable.

◆ 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.

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 }

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

◆ childrenEvent()

void FWTableWidget::childrenEvent ( Event_t *  )

Definition at line 399 of file FWTableWidget.cc.

399 { Clicked(); }

References Clicked().

◆ ClassDefOverride()

FWTableWidget::ClassDefOverride ( FWTableWidget  ,
 
)

◆ Clicked()

void FWTableWidget::Clicked ( )

Definition at line 401 of file FWTableWidget.cc.

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

Referenced by childrenEvent().

◆ columnClicked()

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

Definition at line 415 of file FWTableWidget.cc.

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 }

References writedatasetfile::args.

Referenced by buttonReleasedInHeader().

◆ dataChanged()

void FWTableWidget::dataChanged ( void  )

Definition at line 425 of file FWTableWidget.cc.

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 }

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

Referenced by FWTableViewTableManager::implSort().

◆ descendingSort()

bool FWTableWidget::descendingSort ( ) const
inline

Definition at line 88 of file FWTableWidget.h.

88 { return m_descendingSort; }

References m_descendingSort.

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

◆ 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.

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 }

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

◆ handleResize()

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

Definition at line 226 of file FWTableWidget.cc.

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 }

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

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

◆ 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.

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 }

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

◆ ProcessMessage()

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

Definition at line 297 of file FWTableWidget.cc.

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 }

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

◆ Resize()

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

Definition at line 221 of file FWTableWidget.cc.

221  {
222  handleResize(w, h);
223  TGCompositeFrame::Resize(w, h);
224 }

References handleResize(), and w.

Referenced by FWCollectionSummaryWidget::toggleShowHide().

◆ 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.

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 }

References writedatasetfile::args.

Referenced by buttonReleasedInBody().

◆ SetBackgroundColor()

void FWTableWidget::SetBackgroundColor ( Pixel_t  iColor)
override

Definition at line 173 of file FWTableWidget.cc.

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 }

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().

◆ SetHeaderBackgroundColor()

void FWTableWidget::SetHeaderBackgroundColor ( Pixel_t  iColor)

Definition at line 188 of file FWTableWidget.cc.

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 }

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().

◆ SetHeaderForegroundColor()

void FWTableWidget::SetHeaderForegroundColor ( Pixel_t  iColor)

Definition at line 198 of file FWTableWidget.cc.

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 }

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

◆ SetLineSeparatorColor()

void FWTableWidget::SetLineSeparatorColor ( Pixel_t  iColor)

Definition at line 209 of file FWTableWidget.cc.

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 }

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().

◆ 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.

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 }

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

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

◆ sortedColumn()

int FWTableWidget::sortedColumn ( ) const
inline

Definition at line 87 of file FWTableWidget.h.

87 { return m_sortedColumn; }

References m_sortedColumn.

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

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().

FWTableWidget::m_rowHeader
FWTabularWidget * m_rowHeader
Definition: FWTableWidget.h:109
writedatasetfile.args
args
Definition: writedatasetfile.py:18
DDAxes::y
FWTableManagerBase::sort
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
Definition: FWTableManagerBase.cc:54
FWTableWidget::m_sortedColumn
int m_sortedColumn
Definition: FWTableWidget.h:115
FWTabularWidget::dataChanged
void dataChanged()
Definition: FWTabularWidget.cc:85
funct::false
false
Definition: Factorize.h:29
FWTableManagerBase::buttonReleasedInRowHeader
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
Definition: FWTableManagerBase.cc:113
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FWTabularWidget::widthOfTextInColumns
const std::vector< unsigned int > & widthOfTextInColumns() const
Definition: FWTabularWidget.h:42
FWTabularWidget::setVerticalOffset
void setVerticalOffset(UInt_t)
Definition: FWTabularWidget.cc:119
FWTableWidget::m_rowHeaderTable
FWTableManagerBase * m_rowHeaderTable
Definition: FWTableWidget.h:106
FWTableWidget::sort
void sort(UInt_t iColumn, bool iDescendingSort)
Definition: FWTableWidget.cc:161
FWTableWidget::m_body
FWTabularWidget * m_body
Definition: FWTableWidget.h:108
FWTableWidget::m_forceLayout
bool m_forceLayout
Definition: FWTableWidget.h:117
FWTableWidget::m_bodyTable
FWTableManagerBase * m_bodyTable
Definition: FWTableWidget.h:104
mps_check.msg
tuple msg
Definition: mps_check.py:285
FWTableWidget::m_showingHSlider
bool m_showingHSlider
Definition: FWTableWidget.h:113
DDAxes::x
FWAdapterRowHeaderTableManager
Definition: FWAdapterRowHeaderTableManager.h:31
FWTabularWidget::setWidthOfTextInColumns
void setWidthOfTextInColumns(const std::vector< unsigned int > &)
Definition: FWTabularWidget.cc:92
FWTabularWidget::setHorizontalOffset
void setHorizontalOffset(UInt_t)
Definition: FWTabularWidget.cc:125
FWTableWidget::m_headerTable
FWTableManagerBase * m_headerTable
Definition: FWTableWidget.h:105
FWTableWidget::m_headerForeground
TGGC * m_headerForeground
Definition: FWTableWidget.h:120
FWTabularWidget::GetDefaultSize
TGDimension GetDefaultSize() const override
Definition: FWTabularWidget.cc:300
w
const double w
Definition: UKUtility.cc:23
FWTableWidget::columnClicked
void columnClicked(Int_t iColumn, Int_t iButton, Int_t iKeyMod)
Definition: FWTableWidget.cc:415
FWTableWidget::Clicked
void Clicked()
Definition: FWTableWidget.cc:401
h
FWTableWidget::m_showingVSlider
bool m_showingVSlider
Definition: FWTableWidget.h:112
FWTabularWidget::setBackgroundAreaContext
void setBackgroundAreaContext(GContext_t iContext)
Definition: FWTabularWidget.cc:295
FWTableManagerBase
Definition: FWTableManagerBase.h:44
FWTabularWidget::disableGrowInWidth
void disableGrowInWidth()
Definition: FWTabularWidget.h:69
FWTableWidget::rowClicked
void rowClicked(Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
Definition: FWTableWidget.cc:403
FWTableManagerBase::hasLabelHeaders
virtual bool hasLabelHeaders() const
Definition: FWTableManagerBase.cc:107
kRowOptions
static const UInt_t kRowOptions
Definition: FWTableWidget.cc:29
funct::true
true
Definition: Factorize.h:173
FWTabularWidget::setLineContext
void setLineContext(GContext_t iContext)
Definition: FWTabularWidget.cc:294
hcaldqm::fClient
Definition: DQModule.h:24
FWTableWidget::cellClicked
void cellClicked(Int_t iRow, Int_t iColumn, Int_t iButton, Int_t iKeyMod, Int_t iGlobalX, Int_t iGlobalY)
Definition: FWTableWidget.cc:386
FWTableWidget::m_vSlider
TGVScrollBar * m_vSlider
Definition: FWTableWidget.h:110
FWAdapterHeaderTableManager
Definition: FWAdapterHeaderTableManager.h:32
FWTableManagerBase::cellDataIsSortable
virtual bool cellDataIsSortable() const
Definition: FWTableManagerBase.h:81
FWTableWidget::m_header
FWTabularWidget * m_header
Definition: FWTableWidget.h:107
FWTableWidget::m_descendingSort
bool m_descendingSort
Definition: FWTableWidget.h:116
FWTableWidget::handleResize
bool handleResize(UInt_t w, UInt_t h)
Definition: FWTableWidget.cc:226
FWTableWidget::m_lineSeparator
TGGC * m_lineSeparator
Definition: FWTableWidget.h:121
spu::def
int def(FILE *, FILE *, int)
Definition: SherpackUtilities.cc:14
FWTableWidget::m_hSlider
TGHScrollBar * m_hSlider
Definition: FWTableWidget.h:111
FWTableManagerBase::unsortedRowNumber
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...
event
Definition: event.py:1
FWTableWidget::m_headerBackground
TGGC * m_headerBackground
Definition: FWTableWidget.h:119
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
FWTabularWidget
Definition: FWTabularWidget.h:31
kColOptions
static const UInt_t kColOptions
Definition: FWTableWidget.cc:30