16 #include <boost/bind.hpp>
18 #include "TGResourcePool.h"
19 #include "TVirtualX.h"
54 class BorderlessTextButton :
public TGTextButton {
56 BorderlessTextButton(
const TGWindow*
p =
nullptr,
57 const char*
s =
nullptr,
59 GContext_t norm = GetDefaultGC()(),
60 FontStruct_t font = GetDefaultFontStruct())
61 : TGTextButton(
p,
s,
id, norm, font, 0) {
67 void DoRedraw()
override;
70 void BorderlessTextButton::DoRedraw() {
71 gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth, fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
75 if (fTMode & kTextLeft) {
77 }
else if (fTMode & kTextRight) {
78 x = fWidth - fTWidth - fMRight - 4;
80 x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
83 if (fTMode & kTextTop) {
85 }
else if (fTMode & kTextBottom) {
86 y = fHeight - fTHeight - fMBottom - 3;
88 y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
91 Int_t hotpos = fLabel->GetHotPos();
93 fTLayout->DrawText(fId, fNormGC,
x,
y, 0, -1);
95 fTLayout->UnderlineChar(fId, fNormGC,
x,
y, hotpos - 1);
99 static const TGPicture*
filtered(
bool iBackgroundIsBlack) {
100 if (iBackgroundIsBlack) {
109 if (iBackgroundIsBlack) {
117 static const TGPicture*
alert_over(
bool iBackgroundIsBlack) {
118 if (iBackgroundIsBlack) {
126 static const TGPicture*
alert(
bool iBackgroundIsBlack) {
127 if (iBackgroundIsBlack) {
135 static const TGPicture*
unfiltered(
bool iBackgroundIsBlack) {
136 if (iBackgroundIsBlack) {
144 if (iBackgroundIsBlack) {
152 static const TGPicture*
info(
bool iBackgroundIsBlack) {
153 if (iBackgroundIsBlack) {
161 static const TGPicture*
info_over(
bool iBackgroundIsBlack) {
162 if (iBackgroundIsBlack) {
171 if (iBackgroundIsBlack) {
180 if (iBackgroundIsBlack) {
189 if (iBackgroundIsBlack) {
190 static const TGPicture*
s =
194 static const TGPicture*
s =
199 static const TGPicture*
arrow_down(
bool iBackgroundIsBlack) {
200 if (iBackgroundIsBlack) {
209 if (iBackgroundIsBlack) {
210 static const TGPicture*
s =
214 static const TGPicture*
s =
225 : TGCompositeFrame(iParent),
226 m_collection(&iItem),
229 m_collectionShown(
false),
230 m_tableContext(nullptr),
232 m_colorPopup(nullptr),
233 m_tableManager(nullptr),
234 m_tableWidget(nullptr),
235 m_backgroundIsWhite(
false),
238 const unsigned int backgroundColor = kBlack;
240 TGCompositeFrame* hFrame =
new TGHorizontalFrame(
this, 10, 10, 0, backgroundColor);
242 this->AddFrame(hFrame,
new TGLayoutHints(kLHintsTop | kLHintsExpandX));
248 m_showHideButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleShowHide()");
251 hFrame->AddFrame(
m_showHideButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 6, 10));
258 m_isVisibleButton->SetToolTipText(
"make all items in collection visible/invisible");
259 hFrame->AddFrame(
m_isVisibleButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 1));
260 m_isVisibleButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleItemVisible()");
266 m_colorSelectWidget->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"colorClicked()");
269 GCValues_t
t = *(GetWhiteGC().GetAttributes());
274 m_label->SetBackgroundColor(backgroundColor);
275 m_label->SetTextJustify(kTextLeft | kTextCenterY);
276 m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
277 hFrame->AddFrame(
m_label,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX, 5, 5));
278 m_label->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"labelClicked()");
279 m_label->SetToolTipText(
"select collection and show controller");
285 hFrame->AddFrame(
m_stateButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft));
288 m_stateButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"stateClicked()");
289 m_stateButton->SetToolTipText(
"select collection and show filter");
293 hFrame->AddFrame(
m_infoButton,
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2));
294 m_infoButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"infoClicked()");
295 m_infoButton->SetToolTipText(
"select collection and show data info");
346 if (iBackgroundIsWhite) {
347 iLabel->SetBackgroundColor(0x7777FF);
349 iLabel->SetBackgroundColor(0x0000FF);
352 if (iBackgroundIsWhite) {
353 iLabel->SetBackgroundColor(0xFFFFFF);
355 iLabel->SetBackgroundColor(0x000000);
370 const TGPicture* picture =
nullptr;
371 const TGPicture*
down =
nullptr;
372 const TGPicture*
disabled =
nullptr;
388 m_stateButton->SetToolTipText(
"select collection and show filter");
415 static TGGC* s_context =
nullptr;
416 if (
nullptr == s_context) {
417 GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
418 s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT, kTRUE);
419 s_context->SetForeground(s_context->GetBackground());
426 const TGPicture* picture =
nullptr;
427 const TGPicture*
down =
nullptr;
428 const TGPicture*
disabled =
nullptr;
436 m_hints->SetLayoutHints(kLHintsExpandX);
444 GCValues_t
t = *(GetWhiteGC().GetAttributes());
445 t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
446 m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&
t, kTRUE);
453 AddFrame(
m_tableWidget,
new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
454 m_tableWidget->Connect(
"rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
455 "FWCollectionSummaryWidget",
457 "modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
463 m_hints->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
478 std::vector<Color_t>
colors;
483 m_colorPopup->Connect(
"ColorSelected(Color_t)",
"FWCollectionSummaryWidget",
this,
"colorChangeRequested(Color_t)");
495 gClient->GetDefaultRoot()->GetId(),
502 std::vector<Color_t>
colors;
514 std::vector<Color_t>
colors;
523 if (iKeyMod & kKeyControlMask) {
530 if (iButton == kButton3) {
536 Emit(
"requestForInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
540 Emit(
"requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
544 Emit(
"requestForErrorInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
548 Emit(
"requestForController(FWEventItem*)", reinterpret_cast<long>(iItem));
553 args[0] = static_cast<Long_t>(iGlobalX);
554 args[1] = static_cast<Long_t>(iGlobalY);
555 Emit(
"requestForModelContextMenu(Int_t,Int_t)",
args);
589 Pixel_t bc = 0x000000;
590 Pixel_t fg = 0xffffff;
604 selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());