Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
evd::SliceButtonBar Class Reference

Controls for navigating between slices. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-25/EventDisplay/SliceButtonBar.h"

Inheritance diagram for evd::SliceButtonBar:

Public Member Functions

 SliceButtonBar (const TGWindow *p)
 
virtual ~SliceButtonBar ()
 
void Enable ()
 
void Previous ()
 
void Next ()
 
void AutoAdvance ()
 
void GoTo ()
 
void Update ()
 

Protected Member Functions

 ClassDef (SliceButtonBar, 0)
 

Protected Attributes

TGTextButton * fPrevButton
 
TGTextButton * fNextButton
 
TGTextButton * fAutoAdvanceButton
 Start to auto advance. More...
 
TGCheckButton * fEnableButton
 
TGTextEntry * fSliceTextEntry
 
TGLabel * fNSlicesLabel
 

Detailed Description

Controls for navigating between slices.

Definition at line 22 of file SliceButtonBar.h.

Constructor & Destructor Documentation

evd::SliceButtonBar::SliceButtonBar ( const TGWindow *  p)

Definition at line 22 of file SliceButtonBar.cxx.

References evd::SliceNavigator::CurrentSlice(), Enable(), fAutoAdvanceButton, fEnableButton, fNextButton, fNSlicesLabel, genie::utils::style::Format(), fPrevButton, fSliceTextEntry, evd::SliceNavigator::FullEventMode(), and label.

23  : TGCompositeFrame(p, 60, 20, kSunkenFrame | kHorizontalFrame)
24  {
26 
27  TGLabel* label = new TGLabel(this, "Slices: ");
28  AddFrame(label, new TGLayoutHints(kLHintsCenterY | kLHintsLeft,
29  0, 0, 5, 1));
30 
31  // Previous slice button
32  fPrevButton = new TGTextButton(this, "<< Previous", 50);
33  fPrevButton->SetToolTipText("Go to previous slice");
34  fPrevButton->Connect("Clicked()",
35  "evd::SliceButtonBar", this, "Previous()");
36  AddFrame(fPrevButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,
37  2, 0, 2, 2));
38 
39  // Next slice button
40  fNextButton = new TGTextButton(this, "Next >>", 50);
41  fNextButton->SetToolTipText("Go to next slice");
42  fNextButton->Connect("Clicked()", "evd::SliceButtonBar", this, "Next()");
43  AddFrame(fNextButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,
44  2, 0, 2, 2));
45 
46  // Auto-advance button
47  fAutoAdvanceButton = new TGTextButton(this, ">", 50);
48  fAutoAdvanceButton->SetToolTipText("Start slice auto advance");
49  fAutoAdvanceButton->Connect("Clicked()", "evd::SliceButtonBar", this, "AutoAdvance()");
50  AddFrame(fAutoAdvanceButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,
51  2, 0, 2, 2));
52 
53  // Slice-by-slice enable button
54  fEnableButton = new TGCheckButton(this, "Slice-by-slice", 0);
55  AddFrame(fEnableButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft,
56  2, 0, 2, 2));
57  fEnableButton->Connect("Clicked()",
58  "evd::SliceButtonBar", this, "Enable()");
59  fEnableButton->SetState(nav->FullEventMode() ? kButtonUp : kButtonDown);
60 
61  fNSlicesLabel = new TGLabel(this, " / 1 ");
62  AddFrame(fNSlicesLabel, new TGLayoutHints(kLHintsCenterY | kLHintsRight,
63  0, 0, 5, 1));
64 
65  fSliceTextEntry = new TGTextEntry(this, new TGTextBuffer(128));
66  fSliceTextEntry->Connect("ReturnPressed()", "evd::SliceButtonBar",
67  this, "GoTo()");
68  fSliceTextEntry->Resize(50, 20);
69  fSliceTextEntry->SetText(TString::Format("%d", nav->CurrentSlice()));
70  AddFrame(fSliceTextEntry,
71  new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 0, 2, 2));
72 
73  TGLabel* sliceLabel = new TGLabel(this, "[Slice]=");
74  AddFrame(sliceLabel,
75  new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 0, 2, 2));
76 
77  // Set everything to the appropriate enabled state
78  Enable();
79  }
const char * p
Definition: xmltok.h:285
TGTextButton * fPrevButton
TGTextButton * fNextButton
const char * label
TGTextEntry * fSliceTextEntry
TGCheckButton * fEnableButton
TGTextButton * fAutoAdvanceButton
Start to auto advance.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
evd::SliceButtonBar::~SliceButtonBar ( )
virtual

Definition at line 82 of file SliceButtonBar.cxx.

References fEnableButton, fNextButton, fNSlicesLabel, fPrevButton, and fSliceTextEntry.

83  {
84  delete fPrevButton;
85  delete fNextButton;
86  delete fEnableButton;
87  delete fSliceTextEntry;
88  delete fNSlicesLabel;
89  }
TGTextButton * fPrevButton
TGTextButton * fNextButton
TGTextEntry * fSliceTextEntry
TGCheckButton * fEnableButton

Member Function Documentation

void evd::SliceButtonBar::AutoAdvance ( )

Definition at line 115 of file SliceButtonBar.cxx.

References evd::SliceNavigator::AutoAdvance(), evd::SliceNavigator::AutoAdvancing(), fAutoAdvanceButton, and evd::SliceNavigator::StopAutoAdvance().

116  {
118  if(!nav->AutoAdvancing()){
119  fAutoAdvanceButton->SetText("X");
120  nav->AutoAdvance();
121  }
122  else{
123  fAutoAdvanceButton->SetText(">");
124  nav->StopAutoAdvance();
125  }
126  }
TGTextButton * fAutoAdvanceButton
Start to auto advance.
evd::SliceButtonBar::ClassDef ( SliceButtonBar  ,
 
)
protected
void evd::SliceButtonBar::Enable ( )

Definition at line 92 of file SliceButtonBar.cxx.

References fEnableButton, evd::SliceNavigator::SetFullEventMode(), and Update().

Referenced by SliceButtonBar().

93  {
95  nav->SetFullEventMode(fEnableButton->GetState() == kButtonUp);
96 
97  Update();
98  }
TGCheckButton * fEnableButton
void SetFullEventMode(bool mode)
void evd::SliceButtonBar::GoTo ( )

Definition at line 129 of file SliceButtonBar.cxx.

References fSliceTextEntry, and evd::SliceNavigator::SetCurrentSlice().

130  {
132  nav->SetCurrentSlice(atoi(fSliceTextEntry->GetText()));
133  }
TGTextEntry * fSliceTextEntry
void evd::SliceButtonBar::Next ( )

Definition at line 108 of file SliceButtonBar.cxx.

References evd::SliceNavigator::Next().

void evd::SliceButtonBar::Previous ( )
void evd::SliceButtonBar::Update ( )

Definition at line 136 of file SliceButtonBar.cxx.

References evd::SliceNavigator::CurrentSlice(), fAutoAdvanceButton, fEnableButton, fNextButton, fNSlicesLabel, genie::utils::style::Format(), fPrevButton, fSliceTextEntry, and evd::SliceNavigator::MaxSlice().

Referenced by evd::XZYZProjectionsView::Draw(), Enable(), progbar.ProgressBar::Finish(), and progbar.ProgressBar::Start().

137  {
139 
140  fSliceTextEntry->SetText(TString::Format("%d", nav->CurrentSlice()));
141  fNSlicesLabel->SetText(TString::Format(" / %d ", nav->MaxSlice()));
142 
143  const bool enable = fEnableButton->GetState() != kButtonUp;
144  fSliceTextEntry->SetEnabled(enable);
145  fPrevButton->SetEnabled(enable);
146  fNextButton->SetEnabled(enable);
147  fAutoAdvanceButton->SetEnabled(enable);
148 
149  if(!enable) fSliceTextEntry->SetText("N/A");
150  }
TGTextButton * fPrevButton
TGTextButton * fNextButton
TGTextEntry * fSliceTextEntry
TGCheckButton * fEnableButton
TGTextButton * fAutoAdvanceButton
Start to auto advance.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154

Member Data Documentation

TGTextButton* evd::SliceButtonBar::fAutoAdvanceButton
protected

Start to auto advance.

Definition at line 40 of file SliceButtonBar.h.

Referenced by AutoAdvance(), SliceButtonBar(), and Update().

TGCheckButton* evd::SliceButtonBar::fEnableButton
protected

Definition at line 41 of file SliceButtonBar.h.

Referenced by Enable(), SliceButtonBar(), Update(), and ~SliceButtonBar().

TGTextButton* evd::SliceButtonBar::fNextButton
protected

Definition at line 39 of file SliceButtonBar.h.

Referenced by SliceButtonBar(), Update(), and ~SliceButtonBar().

TGLabel* evd::SliceButtonBar::fNSlicesLabel
protected

Definition at line 43 of file SliceButtonBar.h.

Referenced by SliceButtonBar(), Update(), and ~SliceButtonBar().

TGTextButton* evd::SliceButtonBar::fPrevButton
protected

Definition at line 38 of file SliceButtonBar.h.

Referenced by SliceButtonBar(), Update(), and ~SliceButtonBar().

TGTextEntry* evd::SliceButtonBar::fSliceTextEntry
protected

Definition at line 42 of file SliceButtonBar.h.

Referenced by GoTo(), SliceButtonBar(), Update(), and ~SliceButtonBar().


The documentation for this class was generated from the following files: