15 #include "TGScrollBar.h" 16 #include "TGTableLayout.h" 17 #include "TGResourcePool.h" 30 static_cast<UInt_t
>(kLHintsExpandX) | static_cast<UInt_t>(kLHintsFillX) |
static_cast<UInt_t
>(kLHintsShrinkX);
32 static_cast<UInt_t
>(kLHintsExpandY) | static_cast<UInt_t>(kLHintsFillY) |
static_cast<UInt_t
>(kLHintsShrinkY);
42 : TGCompositeFrame(
p),
43 m_bodyTable(iManager),
50 m_showingVSlider(
true),
51 m_showingHSlider(
true),
53 m_descendingSort(
true),
55 m_headerBackground(nullptr),
56 m_headerForeground(nullptr),
57 m_lineSeparator(nullptr) {
58 SetLayoutManager(
new TGTableLayout(
this, 3, 3));
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)",
67 "buttonReleasedInHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
72 m_body->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
75 "buttonReleasedInBody(Int_t,Int_t,Event_t*,Int_t,Int_t)");
81 for (std::vector<unsigned int>::iterator
it = columnWidths.begin(),
82 itEnd = columnWidths.end(),
83 itHeader = headerWidths.begin();
86 if (*itHeader > *
it) {
100 m_rowHeader->Connect(
"buttonReleased(Int_t,Int_t,Event_t*,Int_t,Int_t)",
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)",
107 "buttonReleasedInRowHeader(Int_t,Int_t,Event_t*,Int_t,Int_t)");
113 m_hSlider->Connect(
"ProcessedEvent(Event_t*)",
"FWTableWidget",
this,
"childrenEvent(Event_t *)");
117 m_vSlider->Connect(
"ProcessedEvent(Event_t*)",
"FWTableWidget",
this,
"childrenEvent(Event_t *)");
125 m_hSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
126 m_vSlider->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
127 m_bodyTable->Connect(
"dataChanged()",
"FWTableWidget",
this,
"dataChanged()");
144 gClient->GetResourcePool()->GetGCPool()->FreeGC(
m_lineSeparator->GetGC());
176 TGFrame::SetBackgroundColor(iColor);
182 m_header->SetBackgroundColor(iColor);
185 m_body->SetBackgroundColor(iColor);
192 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
202 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
213 GCValues_t
t = *(gClient->GetResourcePool()->GetFrameGC()->GetAttributes());
214 m_lineSeparator = gClient->GetResourcePool()->GetGCPool()->GetGC(&
t, kTRUE);
225 TGCompositeFrame::Resize(
w,
h);
230 bool redoLayout =
false;
233 UInt_t fullWidth =
def.fWidth;
238 UInt_t headerHeight = 0;
240 headerHeight =
m_header->GetHeight();
242 UInt_t fullHeight =
def.fHeight + headerHeight;
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)
248 else if (sBarHeight == 0 && sBarWidth > 0 &&
h < fullWidth + sBarWidth)
250 fullWidth += sBarWidth;
251 fullHeight += sBarHeight;
269 if (
h < fullHeight) {
293 if (
w != GetWidth() ||
h != GetHeight()) {
296 TGCompositeFrame::MoveResize(
x,
y,
w,
h);
302 switch (GET_MSG(
msg)) {
304 switch (GET_SUBMSG(
msg)) {
305 case kSB_SLIDERTRACK:
316 switch (GET_SUBMSG(
msg)) {
317 case kSB_SLIDERTRACK:
334 Int_t btn =
event->fCode;
335 Int_t keyMod =
event->fState;
337 if (btn == kButton1 || btn == kButton3) {
348 Int_t btn =
event->fCode;
349 Int_t keyMod =
event->fState;
350 if (btn == kButton5) {
363 if (btn == kButton4) {
375 if (btn != kButton1 && btn != kButton3) {
378 if (row >= -1 and row < m_bodyTable->numberOfRows()) {
379 Int_t globalX, globalY;
381 gVirtualX->TranslateCoordinates(
382 m_body->GetId(), gClient->GetDefaultRoot()->GetId(),
event->fX,
event->fY, globalX, globalY, childdum);
389 keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
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);
406 keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
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);
418 keyMod = (keyMod & (kKeyShiftMask | kKeyControlMask));
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);
442 for (std::vector<unsigned int>::iterator
it = columnWidths.begin(),
443 itEnd = columnWidths.end(),
444 itHeader = headerWidths.begin();
447 if (*itHeader > *
it) {
456 bool layoutDoneByhandleResize =
handleResize(GetWidth(), GetHeight());
457 if (needs_layout && !layoutDoneByhandleResize) {
460 gClient->NeedRedraw(
m_body);
468 Int_t btn =
event->fCode;
469 if (btn != kButton1 && btn != kButton3) {
475 Int_t btn =
event->fCode;
476 if (btn != kButton1 && btn != kButton3) {
486 TGDimension returnValue;
488 returnValue.fHeight +=
m_header->GetDefaultHeight();
491 returnValue.fWidth +=
m_rowHeader->GetDefaultWidth();
494 returnValue.fHeight +=
m_hSlider->GetDefaultHeight();
495 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...
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.