15 #include "TGScrollBar.h"
16 #include "TGTableLayout.h"
17 #include "TGResourcePool.h"
32 static const UInt_t
kRowOptions = kLHintsExpandX|kLHintsFillX|kLHintsShrinkX;
33 static const UInt_t
kColOptions = kLHintsExpandY|kLHintsFillY|kLHintsShrinkY;
44 m_bodyTable(iManager),
49 m_showingVSlider(
true),
50 m_showingHSlider(
true),
52 m_descendingSort(
true),
54 m_headerBackground(0),
55 m_headerForeground(0),
58 SetLayoutManager(
new TGTableLayout(
this,3,3) );
63 if (
m_bodyTable->
cellDataIsSortable())
m_header->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
"FWTableWidget",
this,
"buttonReleasedInHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
68 m_body->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
"FWTableWidget",
this,
"buttonReleasedInBody(Int_t,Int_t,Event_t*,Int_t,Int_t)");
74 for(std::vector<unsigned int>::iterator it = columnWidths.begin(), itEnd=columnWidths.end(), itHeader=headerWidths.begin();
91 m_rowHeader->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
"FWTableWidget",
this,
"buttonReleasedInBody(Int_t,Int_t,Event_t*,Int_t,Int_t)");
92 m_rowHeader->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
"FWTableWidget",
this,
"buttonReleasedInRowHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
98 m_hSlider->Connect(
"ProcessedEvent(Event_t*)",
"FWTableWidget",
this,
"childrenEvent(Event_t *)");
102 m_vSlider->Connect(
"ProcessedEvent(Event_t*)",
"FWTableWidget",
this,
"childrenEvent(Event_t *)");
110 m_hSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
111 m_vSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
112 m_bodyTable->Connect(
"dataChanged()",
"FWTableWidget",
this,
"dataChanged()");
130 gClient->GetResourcePool()->GetGCPool()->FreeGC(
m_lineSeparator->GetGC());
167 TGFrame::SetBackgroundColor(iColor);
173 m_header->SetBackgroundColor(iColor);
176 m_body->SetBackgroundColor(iColor);
177 fClient->NeedRedraw(
m_body);
178 fClient->NeedRedraw(
this);
185 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
197 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
210 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
211 m_lineSeparator = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
225 TGCompositeFrame::Resize(w,h);
232 bool redoLayout=
false;
235 UInt_t fullWidth = def.fWidth;
240 UInt_t headerHeight = 0;
242 headerHeight =
m_header->GetHeight();
244 UInt_t fullHeight = def.fHeight + headerHeight;
246 UInt_t sBarWidth = (h < fullHeight) ?
m_vSlider->GetWidth() : 0;
247 UInt_t sBarHeight = (w < fullWidth) ?
m_hSlider->GetHeight() : 0;
248 if (sBarWidth == 0 && sBarHeight > 0 && h < fullHeight + sBarHeight)
250 else if (sBarHeight == 0 && sBarWidth > 0 && h < fullWidth + sBarWidth)
252 fullWidth += sBarWidth;
253 fullHeight += sBarHeight;
297 if(w != GetWidth() || h != GetHeight()) {
300 TGCompositeFrame::MoveResize(x,y,w,h);
308 switch (GET_MSG(msg)) {
310 switch (GET_SUBMSG(msg)) {
311 case kSB_SLIDERTRACK:
322 switch (GET_SUBMSG(msg)) {
323 case kSB_SLIDERTRACK:
342 Int_t btn =
event->fCode;
343 Int_t keyMod =
event->fState;
345 if (btn == kButton1 || btn == kButton3) {
358 Int_t btn =
event->fCode;
359 Int_t keyMod =
event->fState;
381 if(btn != kButton1 && btn != kButton3) {
return;}
382 if(row>=-1 and row < m_bodyTable->numberOfRows()) {
383 Int_t globalX,globalY;
385 gVirtualX->TranslateCoordinates(
m_body->GetId(),
386 gClient->GetDefaultRoot()->GetId(),
387 event->fX,
event->fY,globalX,globalY,childdum);
396 keyMod = (keyMod&(kKeyShiftMask|kKeyControlMask));
400 args[1]=(Long_t)column;
402 args[3]=(Long_t)keyMod;
403 args[4]=(Long_t)iGlobalX;
404 args[5]=(Long_t)iGlobalY;
405 Emit(
"cellClicked(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t)",args);
423 keyMod = (keyMod&(kKeyShiftMask|kKeyControlMask));
428 args[2]=(Long_t)keyMod;
429 args[3]=(Long_t)iGlobalX;
430 args[4]=(Long_t)iGlobalY;
431 Emit(
"rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",args);
437 keyMod = (keyMod&(kKeyShiftMask|kKeyControlMask));
440 args[0]=(Long_t)column;
442 args[2]=(Long_t)keyMod;
443 Emit(
"columnClicked(Int_t,Int_t,Int_t)",args);
462 for(std::vector<unsigned int>::iterator it = columnWidths.begin(), itEnd=columnWidths.end(), itHeader=headerWidths.begin();
465 if(*itHeader > *it) {
474 bool layoutDoneByhandleResize =
handleResize(GetWidth(), GetHeight());
475 if (needs_layout && ! layoutDoneByhandleResize)
479 gClient->NeedRedraw(
m_body);
488 Int_t btn =
event->fCode;
489 if(btn != kButton1 && btn != kButton3) {
return;}
495 Int_t btn =
event->fCode;
496 if(btn != kButton1 && btn != kButton3) {
return;}
506 TGDimension returnValue;
508 returnValue.fHeight +=
m_header->GetDefaultHeight();
511 returnValue.fWidth +=
m_rowHeader->GetDefaultWidth();
514 returnValue.fHeight +=
m_hSlider->GetDefaultHeight();
515 returnValue.fWidth +=
m_vSlider->GetDefaultWidth();
int def(FILE *, FILE *, int)
virtual bool cellDataIsSortable() const
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
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...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
volatile std::atomic< bool > shutdown_flag false