16 #include <boost/bind.hpp> 18 #include "TGResourcePool.h" 43 for_each(m_connections.begin(), m_connections.end(), boost::bind(&sigc::connection::disconnect, _1));
45 void push_back(
const sigc::connection& iC) { m_connections.push_back(iC); }
46 void reserve(
size_t iSize) { m_connections.reserve(iSize); }
53 class BorderlessTextButton :
public TGTextButton {
55 BorderlessTextButton(
const TGWindow*
p =
nullptr,
56 const char*
s =
nullptr,
58 GContext_t norm = GetDefaultGC()(),
59 FontStruct_t font = GetDefaultFontStruct())
60 : TGTextButton(
p,
s,
id, norm, font, 0) {
66 void DoRedraw()
override;
69 void BorderlessTextButton::DoRedraw() {
70 gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth, fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
74 if (fTMode & kTextLeft) {
76 }
else if (fTMode & kTextRight) {
77 x = fWidth - fTWidth - fMRight - 4;
79 x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
82 if (fTMode & kTextTop) {
84 }
else if (fTMode & kTextBottom) {
85 y = fHeight - fTHeight - fMBottom - 3;
87 y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
90 Int_t hotpos = fLabel->GetHotPos();
92 fTLayout->DrawText(fId, fNormGC, x, y, 0, -1);
94 fTLayout->UnderlineChar(fId, fNormGC, x, y, hotpos - 1);
98 static const TGPicture*
filtered(
bool iBackgroundIsBlack) {
99 if (iBackgroundIsBlack) {
108 if (iBackgroundIsBlack) {
116 static const TGPicture*
alert_over(
bool iBackgroundIsBlack) {
117 if (iBackgroundIsBlack) {
125 static const TGPicture*
alert(
bool iBackgroundIsBlack) {
126 if (iBackgroundIsBlack) {
134 static const TGPicture*
unfiltered(
bool iBackgroundIsBlack) {
135 if (iBackgroundIsBlack) {
143 if (iBackgroundIsBlack) {
151 static const TGPicture*
info(
bool iBackgroundIsBlack) {
152 if (iBackgroundIsBlack) {
160 static const TGPicture*
info_over(
bool iBackgroundIsBlack) {
161 if (iBackgroundIsBlack) {
170 if (iBackgroundIsBlack) {
179 if (iBackgroundIsBlack) {
188 if (iBackgroundIsBlack) {
189 static const TGPicture*
s =
193 static const TGPicture*
s =
198 static const TGPicture*
arrow_down(
bool iBackgroundIsBlack) {
199 if (iBackgroundIsBlack) {
208 if (iBackgroundIsBlack) {
209 static const TGPicture*
s =
213 static const TGPicture*
s =
224 : TGCompositeFrame(iParent),
225 m_collection(&iItem),
228 m_collectionShown(
false),
234 m_backgroundIsWhite(
false),
237 const unsigned int backgroundColor = kBlack;
239 TGCompositeFrame* hFrame =
new TGHorizontalFrame(
this, 10, 10, 0, backgroundColor);
241 this->AddFrame(hFrame,
new TGLayoutHints(kLHintsTop | kLHintsExpandX));
247 m_showHideButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleShowHide()");
250 hFrame->AddFrame(
m_showHideButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 6, 10));
257 m_isVisibleButton->SetToolTipText(
"make all items in collection visible/invisible");
258 hFrame->AddFrame(
m_isVisibleButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 1));
259 m_isVisibleButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleItemVisible()");
265 m_colorSelectWidget->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"colorClicked()");
268 GCValues_t
t = *(GetWhiteGC().GetAttributes());
273 m_label->SetBackgroundColor(backgroundColor);
274 m_label->SetTextJustify(kTextLeft | kTextCenterY);
275 m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
276 hFrame->AddFrame(
m_label,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX, 5, 5));
277 m_label->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"labelClicked()");
278 m_label->SetToolTipText(
"select collection and show controller");
284 hFrame->AddFrame(
m_stateButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft));
287 m_stateButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"stateClicked()");
288 m_stateButton->SetToolTipText(
"select collection and show filter");
292 hFrame->AddFrame(
m_infoButton,
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2));
293 m_infoButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"infoClicked()");
294 m_infoButton->SetToolTipText(
"select collection and show data info");
345 if (iBackgroundIsWhite) {
346 iLabel->SetBackgroundColor(0x7777FF);
348 iLabel->SetBackgroundColor(0x0000FF);
351 if (iBackgroundIsWhite) {
352 iLabel->SetBackgroundColor(0xFFFFFF);
354 iLabel->SetBackgroundColor(0x000000);
369 const TGPicture* picture =
nullptr;
370 const TGPicture*
down =
nullptr;
371 const TGPicture*
disabled =
nullptr;
387 m_stateButton->SetToolTipText(
"select collection and show filter");
414 static TGGC* s_context =
nullptr;
415 if (
nullptr == s_context) {
416 GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
417 s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT, kTRUE);
418 s_context->SetForeground(s_context->GetBackground());
425 const TGPicture* picture =
nullptr;
426 const TGPicture*
down =
nullptr;
427 const TGPicture*
disabled =
nullptr;
435 m_hints->SetLayoutHints(kLHintsExpandX);
443 GCValues_t
t = *(GetWhiteGC().GetAttributes());
444 t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
445 m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
452 AddFrame(
m_tableWidget,
new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
453 m_tableWidget->Connect(
"rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
454 "FWCollectionSummaryWidget",
456 "modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
462 m_hints->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
477 std::vector<Color_t>
colors;
482 m_colorPopup->Connect(
"ColorSelected(Color_t)",
"FWCollectionSummaryWidget",
this,
"colorChangeRequested(Color_t)");
494 gClient->GetDefaultRoot()->GetId(),
501 std::vector<Color_t>
colors;
513 std::vector<Color_t>
colors;
522 if (iKeyMod & kKeyControlMask) {
529 if (iButton == kButton3) {
535 Emit(
"requestForInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
539 Emit(
"requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
543 Emit(
"requestForErrorInfo(FWEventItem*)", reinterpret_cast<long>(iItem));
547 Emit(
"requestForController(FWEventItem*)", reinterpret_cast<long>(iItem));
552 args[0] =
static_cast<Long_t
>(iGlobalX);
553 args[1] =
static_cast<Long_t
>(iGlobalY);
554 Emit(
"requestForModelContextMenu(Int_t,Int_t)", args);
588 Pixel_t bc = 0x000000;
589 Pixel_t fg = 0xffffff;
603 selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
static const TString & coreIcondir()
const FWDisplayProperties & defaultDisplayProperties() const
void setColor(Color_t iColor)
FWModelChangeManager * changeManager() const
const FWDisplayProperties & displayProperties() const
std::string modelName(int iIndex) const
const std::string & name() const
FWColorManager * colorManager() const
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
const std::string & filterExpression() const
FWItemChangeSignal defaultDisplayPropertiesChanged_
void fillLimitedColors(std::vector< Color_t > &cv) const
bool itemIsSelected() const
void setDefaultDisplayProperties(const FWDisplayProperties &)
BackgroundColorIndex backgroundColorIndex() const
FWItemChangeSignal itemChanged_
void setChecked(bool iChecked)
bool hasError() const
returns true if failed to get data for this event
FWSelectionManager * selectionManager() const
void toggleSelect(int iIndex) const
const std::string & errorMessage() const
returns error string if there was a problem this event
void select(int iIndex) const
ModelInfo modelInfo(int iIndex) const
void setIsVisible(bool iSet)
void setColor(GContext_t iColorContext)
FWItemChangeSignal filterChanged_