25 #include "TGComboBox.h"
27 #include "TGTextEntry.h"
28 #include "TEveWindow.h"
29 #include "TVirtualX.h"
47 static TString
path = Form(
"%s/src/Fireworks/Core/icons/", gSystem->Getenv(
"CMSSW_BASE"));
48 if (gSystem->AccessPathName(
path.Data())) {
49 assert(gSystem->Getenv(
"CMSSW_RELEASE_BASE"));
50 path = Form(
"%s/src/Fireworks/Core/icons/", gSystem->Getenv(
"CMSSW_RELEASE_BASE"));
151 if (iBackgroundIsBlack) {
152 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-white-right-blackbg.png");
155 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-black-right-whitebg.png");
160 if (iBackgroundIsBlack) {
161 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-white-right-disabled-blackbg.png");
164 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-black-right-disabled-whitebg.png");
168 static const TGPicture *
arrow_down(
bool iBackgroundIsBlack) {
169 if (iBackgroundIsBlack) {
170 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-white-down-blackbg.png");
173 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-black-down-whitebg.png");
178 if (iBackgroundIsBlack) {
179 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-white-down-disabled-blackbg.png");
182 static const TGPicture *
s = gClient->GetPicture(
coreIcondir() +
"arrow-black-down-disabled-whitebg.png");
203 m_tableWidget(nullptr),
204 m_showColumnUI(
false),
207 m_useColumnsFromConfig(
false)
217 frame->AddFrame(
m_vert,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
218 TGHorizontalFrame *
header =
new TGHorizontalFrame(
m_vert);
219 m_vert->AddFrame(
header,
new TGLayoutHints(kLHintsTop | kLHintsExpandX));
223 m_columnUIButton->Connect(
"Clicked()",
"FWTableView",
this,
"toggleShowHide()");
226 TGCompositeFrame *labfr =
new TGHorizontalFrame(
header, 60, 25, kFixedSize);
227 TGLabel *
label =
new TGLabel(labfr,
"Collection");
228 labfr->AddFrame(
label,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 3, 0, 0));
229 header->AddFrame(labfr,
new TGLayoutHints(kLHintsLeft));
233 header->AddFrame(
m_collection,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY));
234 m_collection->Connect(
"Selected(Int_t)",
"FWTableView",
this,
"selectCollection(Int_t)");
238 TGLabel *column_control_label =
new TGLabel(
m_column_control,
"Column editor");
242 m_column_control->AddFrame(column_control_label,
new TGLayoutHints(kLHintsExpandX));
243 TGHorizontalFrame *column_control_fields =
new TGHorizontalFrame(
m_column_control);
244 m_column_control->AddFrame(column_control_fields,
new TGLayoutHints(kLHintsExpandX));
252 TGLabel *name_label =
new TGLabel(column_control_fields,
"Title");
253 TGLabel *expr_label =
new TGLabel(column_control_fields,
"Expression");
254 TGLabel *prec_label =
new TGLabel(column_control_fields,
"Precision");
255 column_control_fields->AddFrame(name_label,
new TGLayoutHints(kLHintsBottom, 1, 1, 2, 2));
257 column_control_fields->AddFrame(expr_label,
new TGLayoutHints(kLHintsBottom, 1, 1, 2, 2));
259 column_control_fields->AddFrame(prec_label,
new TGLayoutHints(kLHintsBottom, 1, 1, 2, 2));
261 TGTextButton *add_button =
new TGTextButton(column_control_fields,
"Add");
262 TGTextButton *del_button =
new TGTextButton(column_control_fields,
"Delete");
263 TGTextButton *mod_button =
new TGTextButton(column_control_fields,
"Modify");
264 add_button->Connect(
"Clicked()",
"FWTableView",
this,
"addColumn()");
265 del_button->Connect(
"Clicked()",
"FWTableView",
this,
"deleteColumn()");
266 mod_button->Connect(
"Clicked()",
"FWTableView",
this,
"modifyColumn()");
267 column_control_fields->AddFrame(add_button,
new TGLayoutHints);
268 column_control_fields->AddFrame(del_button,
new TGLayoutHints);
269 column_control_fields->AddFrame(mod_button,
new TGLayoutHints);
275 "rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)",
"FWTableView",
this,
"modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
276 m_tableWidget->Connect(
"columnClicked(Int_t,Int_t,Int_t)",
"FWTableView",
this,
"columnSelected(Int_t,Int_t,Int_t)");
278 frame->MapSubwindows();
381 for (std::vector<const FWEventItem *>::const_iterator it =
m_manager->
items().begin(),
392 if (sortColumn !=
nullptr && descendingSort !=
nullptr) {
393 unsigned int sort = sortColumn->
version();
394 bool descending = descendingSort->
version();
400 std::cerr <<
"This configuration file contains tables, but no column information. "
401 "(It is probably old.) Using defaults."
440 size_t ss = textRenderer->
data().size();
454 TString headerFormat;
455 headerFormat.Form(
"%%%ds", ndheader + 3);
456 data.Form(headerFormat,
" ");
457 printf(
"%s",
data.Data());
462 format.Form(
"%%%ds", (
int)widths[
c]);
466 printf(
"%s",
data.Data());
468 printf(
"%s | ",
data.Data());
476 headerFormat.Form(
"[%%%dd] ", ndheader);
481 printf(
"%s",
data.Data());
483 format.Form(
"%%%ds", (
int)widths[
c]);
487 printf(
"%s",
data.Data());
489 printf(
"%s | ",
data.Data());
497 const TGPicture *picture =
nullptr;
498 const TGPicture *
down =
nullptr;
499 const TGPicture *
disabled =
nullptr;
536 if (selected != -1 && selected < m_collection->GetNumberOfEntries())
540 lb->SetHeight(
TMath::Min(lb->GetNumberOfEntries() * lb->GetItemVsize() + 2 * lb->GetBorderWidth(), 200u));
599 if (iKeyMod & kKeyControlMask) {
606 if (iButton == kButton3) {
612 if (iButton == 1 || iButton == 3)
631 char *endptr =
nullptr;
670 char *endptr =
nullptr;