16 #include <boost/bind.hpp>
18 #include "TGResourcePool.h"
58 class BorderlessTextButton :
public TGTextButton {
60 BorderlessTextButton(
const TGWindow *
p = 0,
const char *
s = 0, Int_t
id = -1,
61 GContext_t norm = GetDefaultGC()(),
62 FontStruct_t font = GetDefaultFontStruct()):
63 TGTextButton(
p,
s,id,norm,font,0){
69 void DoRedraw()
override;
72 void BorderlessTextButton::DoRedraw() {
73 gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth,
74 fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
78 if (fTMode & kTextLeft) {
80 }
else if (fTMode & kTextRight) {
81 x = fWidth - fTWidth - fMRight - 4;
83 x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
86 if (fTMode & kTextTop) {
88 }
else if (fTMode & kTextBottom) {
89 y = fHeight - fTHeight - fMBottom - 3;
91 y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
94 Int_t hotpos = fLabel->GetHotPos();
96 fTLayout->DrawText(fId, fNormGC, x, y, 0, -1);
97 if (hotpos) fTLayout->UnderlineChar(fId, fNormGC, x, y, hotpos - 1);
105 if(iBackgroundIsBlack) {
117 if(iBackgroundIsBlack) {
128 if(iBackgroundIsBlack) {
137 const TGPicture*
alert(
bool iBackgroundIsBlack)
140 if(iBackgroundIsBlack) {
151 if(iBackgroundIsBlack) {
161 if(iBackgroundIsBlack) {
170 const TGPicture*
info(
bool iBackgroundIsBlack)
172 if(iBackgroundIsBlack) {
183 if(iBackgroundIsBlack) {
194 if(iBackgroundIsBlack) {
205 if(iBackgroundIsBlack) {
216 if(iBackgroundIsBlack) {
227 if(iBackgroundIsBlack) {
238 if(iBackgroundIsBlack) {
253 TGCompositeFrame(iParent),
254 m_collection(&iItem),
257 m_collectionShown(
false),
263 m_backgroundIsWhite(
false),
266 SetBackgroundColor(kWidgetColor);
267 const unsigned int backgroundColor=kBlack;
269 TGCompositeFrame* hFrame =
new TGHorizontalFrame(
this, 10, 10, 0, backgroundColor);
271 this->AddFrame(hFrame,
new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
277 m_showHideButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleShowHide()");
280 hFrame->AddFrame(
m_showHideButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft,6,10));
287 m_isVisibleButton->SetToolTipText(
"make all items in collection visible/invisible");
288 hFrame->AddFrame(
m_isVisibleButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft,0,1));
289 m_isVisibleButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleItemVisible()");
295 m_colorSelectWidget->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"colorClicked()");
298 GCValues_t
t = *( GetWhiteGC().GetAttributes());
303 m_label =
new BorderlessTextButton(
this,
305 m_label->SetBackgroundColor(backgroundColor);
306 m_label->SetTextJustify(kTextLeft|kTextCenterY);
307 m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
308 hFrame->AddFrame(
m_label,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX,5,5));
309 m_label->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"labelClicked()");
310 m_label->SetToolTipText(
"select collection and show controller");
315 hFrame->AddFrame(
m_stateButton,
new TGLayoutHints(kLHintsCenterY| kLHintsLeft));
318 m_stateButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"stateClicked()");
319 m_stateButton->SetToolTipText(
"select collection and show filter");
326 hFrame->AddFrame(
m_infoButton,
new TGLayoutHints(kLHintsCenterY| kLHintsRight,2,2));
327 m_infoButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"infoClicked()");
328 m_infoButton->SetToolTipText(
"select collection and show data info");
380 if(iBackgroundIsWhite) {
381 iLabel->SetBackgroundColor(0x7777FF);
383 iLabel->SetBackgroundColor(0x0000FF);
386 if(iBackgroundIsWhite) {
387 iLabel->SetBackgroundColor(0xFFFFFF);
389 iLabel->SetBackgroundColor(0x000000);
408 const TGPicture* picture = 0;
409 const TGPicture*
down = 0;
410 const TGPicture* disabled=0;
426 m_stateButton->SetToolTipText(
"select collection and show filter");
459 static TGGC* s_context = 0;
461 GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
462 s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT,kTRUE);
463 s_context->SetForeground(s_context->GetBackground());
472 const TGPicture* picture = 0;
473 const TGPicture*
down = 0;
474 const TGPicture* disabled=0;
482 m_hints->SetLayoutHints(kLHintsExpandX);
490 GCValues_t
t = *(GetWhiteGC().GetAttributes());
491 t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
492 m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
499 AddFrame(
m_tableWidget,
new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
500 m_tableWidget->Connect(
"rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
"FWCollectionSummaryWidget",
this,
"modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
506 m_hints->SetLayoutHints(kLHintsExpandX|kLHintsExpandY);
526 std::vector<Color_t>
colors;
531 m_colorPopup->Connect(
"ColorSelected(Color_t)",
"FWCollectionSummaryWidget",
this,
"colorChangeRequested(Color_t)");
544 gVirtualX->TranslateCoordinates(
m_colorSelectWidget->GetId(), gClient->GetDefaultRoot()->GetId(), 0,
547 std::vector<Color_t>
colors;
561 std::vector<Color_t>
colors;
572 if(iKeyMod & kKeyControlMask) {
579 if(iButton==kButton3) {
588 Emit(
"requestForInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
594 Emit(
"requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
600 Emit(
"requestForErrorInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
606 Emit(
"requestForController(FWEventItem*)",reinterpret_cast<long>(iItem));
613 args[0]=
static_cast<Long_t
>(iGlobalX);
614 args[1]=
static_cast<Long_t
> (iGlobalY);
615 Emit(
"requestForModelContextMenu(Int_t,Int_t)",args);
657 Pixel_t bc = 0x000000;
658 Pixel_t fg = 0xffffff;
663 SetBackgroundColor(kWidgetColorLight);
669 SetBackgroundColor(kWidgetColor);
672 selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
705 fClient->NeedRedraw(
this);
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
volatile std::atomic< bool > shutdown_flag false
ModelInfo modelInfo(int iIndex) const
void setIsVisible(bool iSet)
void setColor(GContext_t iColorContext)
FWItemChangeSignal filterChanged_