17 #include <boost/bind.hpp>
19 #include "TGResourcePool.h"
59 class BorderlessTextButton :
public TGTextButton {
61 BorderlessTextButton(
const TGWindow *
p = 0,
const char *
s = 0, Int_t
id = -1,
62 GContext_t norm = GetDefaultGC()(),
63 FontStruct_t font = GetDefaultFontStruct()):
64 TGTextButton(
p,
s,id,norm,font,0){
73 void BorderlessTextButton::DoRedraw() {
74 gVirtualX->ClearArea(fId, fBorderWidth, fBorderWidth,
75 fWidth - (fBorderWidth << 1), fHeight - (fBorderWidth << 1));
79 if (fTMode & kTextLeft) {
81 }
else if (fTMode & kTextRight) {
82 x = fWidth - fTWidth - fMRight - 4;
84 x = (fWidth - fTWidth + fMLeft - fMRight) >> 1;
87 if (fTMode & kTextTop) {
89 }
else if (fTMode & kTextBottom) {
90 y = fHeight - fTHeight - fMBottom - 3;
92 y = (fHeight - fTHeight + fMTop - fMBottom) >> 1;
95 Int_t hotpos = fLabel->GetHotPos();
97 fTLayout->DrawText(fId, fNormGC, x, y, 0, -1);
98 if (hotpos) fTLayout->UnderlineChar(fId, fNormGC, x, y, hotpos - 1);
106 if(iBackgroundIsBlack) {
118 if(iBackgroundIsBlack) {
129 if(iBackgroundIsBlack) {
138 const TGPicture*
alert(
bool iBackgroundIsBlack)
141 if(iBackgroundIsBlack) {
152 if(iBackgroundIsBlack) {
162 if(iBackgroundIsBlack) {
171 const TGPicture*
info(
bool iBackgroundIsBlack)
173 if(iBackgroundIsBlack) {
184 if(iBackgroundIsBlack) {
195 if(iBackgroundIsBlack) {
206 if(iBackgroundIsBlack) {
217 if(iBackgroundIsBlack) {
228 if(iBackgroundIsBlack) {
239 if(iBackgroundIsBlack) {
254 TGCompositeFrame(iParent),
255 m_collection(&iItem),
258 m_collectionShown(
false),
264 m_backgroundIsWhite(
false),
267 SetBackgroundColor(kWidgetColor);
268 const unsigned int backgroundColor=kBlack;
270 TGCompositeFrame* hFrame =
new TGHorizontalFrame(
this, 10, 10, 0, backgroundColor);
272 this->AddFrame(hFrame,
new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
278 m_showHideButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleShowHide()");
281 hFrame->AddFrame(
m_showHideButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft,6,10));
288 m_isVisibleButton->SetToolTipText(
"make all items in collection visible/invisible");
289 hFrame->AddFrame(
m_isVisibleButton,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft,0,1));
290 m_isVisibleButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"toggleItemVisible()");
296 m_colorSelectWidget->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"colorClicked()");
299 GCValues_t
t = *( GetWhiteGC().GetAttributes());
304 m_label =
new BorderlessTextButton(
this,
306 m_label->SetBackgroundColor(backgroundColor);
307 m_label->SetTextJustify(kTextLeft|kTextCenterY);
308 m_label->SetTextColor(static_cast<Pixel_t>(gVirtualX->GetPixel(kWhite)));
309 hFrame->AddFrame(
m_label,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX,5,5));
310 m_label->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"labelClicked()");
311 m_label->SetToolTipText(
"select collection and show controller");
316 hFrame->AddFrame(
m_stateButton,
new TGLayoutHints(kLHintsCenterY| kLHintsLeft));
319 m_stateButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"stateClicked()");
320 m_stateButton->SetToolTipText(
"select collection and show filter");
327 hFrame->AddFrame(
m_infoButton,
new TGLayoutHints(kLHintsCenterY| kLHintsRight,2,2));
328 m_infoButton->Connect(
"Clicked()",
"FWCollectionSummaryWidget",
this,
"infoClicked()");
329 m_infoButton->SetToolTipText(
"select collection and show data info");
381 if(iBackgroundIsWhite) {
382 iLabel->SetBackgroundColor(0x7777FF);
384 iLabel->SetBackgroundColor(0x0000FF);
387 if(iBackgroundIsWhite) {
388 iLabel->SetBackgroundColor(0xFFFFFF);
390 iLabel->SetBackgroundColor(0x000000);
409 const TGPicture* picture = 0;
410 const TGPicture* down = 0;
411 const TGPicture* disabled=0;
427 m_stateButton->SetToolTipText(
"select collection and show filter");
460 static TGGC* s_context = 0;
462 GCValues_t hT = *(gClient->GetResourcePool()->GetSelectedGC()->GetAttributes());
463 s_context = gClient->GetResourcePool()->GetGCPool()->GetGC(&hT,kTRUE);
464 s_context->SetForeground(s_context->GetBackground());
473 const TGPicture* picture = 0;
474 const TGPicture* down = 0;
475 const TGPicture* disabled=0;
483 m_hints->SetLayoutHints(kLHintsExpandX);
491 GCValues_t
t = *(GetWhiteGC().GetAttributes());
492 t.fFont = gClient->GetResourcePool()->GetIconFont()->GetFontHandle();
493 m_tableContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t,kTRUE);
500 AddFrame(
m_tableWidget,
new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY));
501 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)");
507 m_hints->SetLayoutHints(kLHintsExpandX|kLHintsExpandY);
527 std::vector<Color_t>
colors;
532 m_colorPopup->Connect(
"ColorSelected(Color_t)",
"FWCollectionSummaryWidget",
this,
"colorChangeRequested(Color_t)");
545 gVirtualX->TranslateCoordinates(
m_colorSelectWidget->GetId(), gClient->GetDefaultRoot()->GetId(), 0,
548 std::vector<Color_t>
colors;
562 std::vector<Color_t>
colors;
573 if(iKeyMod & kKeyControlMask) {
580 if(iButton==kButton3) {
589 Emit(
"requestForInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
595 Emit(
"requestForFilter(FWEventItem*)", reinterpret_cast<long>(iItem));
601 Emit(
"requestForErrorInfo(FWEventItem*)",reinterpret_cast<long>(iItem));
607 Emit(
"requestForController(FWEventItem*)",reinterpret_cast<long>(iItem));
614 args[0]=
static_cast<Long_t
>(iGlobalX);
615 args[1]=
static_cast<Long_t
> (iGlobalY);
616 Emit(
"requestForModelContextMenu(Int_t,Int_t)",args);
658 Pixel_t bc = 0x000000;
659 Pixel_t fg = 0xffffff;
664 SetBackgroundColor(kWidgetColorLight);
670 SetBackgroundColor(kWidgetColor);
673 selectContext()->SetForeground(gClient->GetResourcePool()->GetSelectedGC()->GetBackground());
706 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_
std::vector< Color_t > colors
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_