#include <ButtonBar.h>
Public Member Functions | |
| ButtonBar (TGMainFrame *frame) | |
| virtual | ~ButtonBar () |
| void | PrevEvt () |
| void | NextEvt () |
| void | ReloadEvt () |
| void | FileList () |
| void | GoTo () |
| void | Print () |
| int | NoImpl (const char *c) |
| void | NewEvent () |
Private Attributes | |
| TGCompositeFrame * | fButtonBar |
| TGLayoutHints * | fLayout |
| TGTextButton * | fPrevEvt |
| TGTextButton * | fNextEvt |
| TGTextButton * | fReload |
| TGTextEntry * | fCurrentFile |
| TGPictureButton * | fFileList |
| TGLabel * | fRunEvtLabel |
| TGTextEntry * | fRunTextEntry |
| TGTextEntry * | fEventTextEntry |
| TGTextButton * | fGoTo |
| TGTextButton * | fPrint |
|
|
Definition at line 43 of file ButtonBar.cxx. References fButtonBar, fCurrentFile, fEventTextEntry, fFileList, fGoTo, fLayout, fNextEvt, fPrevEvt, fPrint, fReload, fRunEvtLabel, fRunTextEntry, evdb::IoModule::Instance(), and NewEvent(). 00044 {
00045 fButtonBar = new TGCompositeFrame(frame, 60, 20,
00046 kSunkenFrame|kHorizontalFrame);
00047 fLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 0);
00048
00049 // Previous event button
00050 fPrevEvt = new TGTextButton(fButtonBar, "<-Previous", 150);
00051 fPrevEvt->SetToolTipText("Go to previous event");
00052 fPrevEvt->Connect("Clicked()", "evdb::ButtonBar", this, "PrevEvt()");
00053 fButtonBar->AddFrame(fPrevEvt, new TGLayoutHints(kLHintsTop |
00054 kLHintsLeft, 2, 0, 2, 2));
00055
00056 // Next event button
00057 fNextEvt = new TGTextButton(fButtonBar, "Next->", 150);
00058 fNextEvt->SetToolTipText("Go to next event");
00059 fNextEvt->Connect("Clicked()", "evdb::ButtonBar", this, "NextEvt()");
00060 fButtonBar->AddFrame(fNextEvt, new TGLayoutHints(kLHintsTop |
00061 kLHintsLeft, 2, 0, 2, 2));
00062
00063 // Reload button
00064 fReload = new TGTextButton(fButtonBar, "Reload", 150);
00065 fReload->SetToolTipText("Reload current event");
00066 fReload->Connect("Clicked()", "evdb::ButtonBar", this, "ReloadEvt()");
00067 fButtonBar->AddFrame(fReload, new TGLayoutHints(kLHintsTop |
00068 kLHintsLeft, 2, 0, 2, 2));
00069
00070 fCurrentFile = new TGTextEntry(fButtonBar, new TGTextBuffer(256));
00071 fCurrentFile->SetToolTipText("Name of current file");
00072 fCurrentFile->Resize(400, fCurrentFile->GetDefaultHeight());
00073 fButtonBar->AddFrame(fCurrentFile,
00074 new TGLayoutHints(kLHintsTop | kLHintsLeft,
00075 8, 2, 2, 2));
00076
00077 // Button to list attached files
00078 const TGPicture* p = ::PicturePool()->GetPicture("arrow_down.xpm");
00079 GContext_t norm = TGPictureButton::GetDefaultGC()();
00080 fFileList = new TGPictureButton(fButtonBar, p, -1, norm, kRaisedFrame);
00081 fFileList->SetToolTipText("List files");
00082 fFileList->Connect("Clicked()", "evdb::ButtonBar", this, "FileList()");
00083 fButtonBar->AddFrame(fFileList, new TGLayoutHints(kLHintsCenterY,
00084 2, 0, 2, 2));
00085
00086 // Print button
00087 fPrint = new TGTextButton(fButtonBar, "Print", 150);
00088 fPrint->SetToolTipText("Print Display");
00089 fPrint->Connect("Clicked()", "evdb::ButtonBar", this, "Print()");
00090 fButtonBar->AddFrame(fPrint, new TGLayoutHints(kLHintsTop|kLHintsRight,
00091 2, 0, 2, 2));
00092
00093 // Go To button
00094 fGoTo = new TGTextButton(fButtonBar, "Go");
00095 fGoTo->SetToolTipText("Go to event");
00096 fGoTo->Connect("Clicked()", "evdb::ButtonBar", this, "GoTo()");
00097 fButtonBar->AddFrame(fGoTo, new TGLayoutHints(kLHintsTop|kLHintsRight,
00098 2, 0, 2, 2));
00099
00100 // Go to event text entry
00101 fEventTextEntry = new TGTextEntry(fButtonBar, new TGTextBuffer(128));
00102 fEventTextEntry->Connect("ReturnPressed()","evdb::ButtonBar",this,"GoTo()");
00103 fEventTextEntry->Resize(75,20);
00104 fButtonBar->AddFrame(fEventTextEntry,
00105 new TGLayoutHints(kLHintsTop|kLHintsRight,2,0,2,2));
00106
00107 fRunTextEntry = new TGTextEntry(fButtonBar, new TGTextBuffer(128));
00108 fRunTextEntry->Connect("ReturnPressed()","evdb::ButtonBar",this,"GoTo()");
00109 fRunTextEntry->Resize(50,20);
00110 fButtonBar->AddFrame(fRunTextEntry,
00111 new TGLayoutHints(kLHintsCenterY|kLHintsRight,2,0,2,2));
00112
00113 fRunEvtLabel = new TGLabel(fButtonBar, new TGHotString("[Run/Event]="));
00114 fButtonBar->AddFrame(fRunEvtLabel,
00115 new TGLayoutHints(kLHintsCenterY|kLHintsRight,2,0,2,2));
00116
00117 // Add button bar to frame
00118 frame->AddFrame(fButtonBar, fLayout);
00119
00120 // Connect the new event signal from the iomodule to the new event slot
00121 IoModule::Instance()->Connect("NewEvent()",
00122 "evdb::ButtonBar",this,"NewEvent()");
00123
00124 this->NewEvent();
00125 }
|
|
|
Definition at line 129 of file ButtonBar.cxx. References fButtonBar, fCurrentFile, fEventTextEntry, fFileList, fGoTo, fLayout, fNextEvt, fPrevEvt, fPrint, fReload, fRunEvtLabel, fRunTextEntry, and evdb::IoModule::Instance(). 00130 {
00131 IoModule::Instance()->Disconnect(0,this,0);
00132
00133 delete fEventTextEntry; fEventTextEntry=0;
00134 delete fRunTextEntry; fRunTextEntry =0;
00135 delete fRunEvtLabel; fRunEvtLabel =0;
00136 delete fPrint; fPrint =0;
00137 delete fGoTo; fGoTo =0;
00138 delete fFileList; fFileList =0;
00139 delete fCurrentFile; fCurrentFile =0;
00140 delete fReload; fReload =0;
00141 delete fNextEvt; fNextEvt =0;
00142 delete fPrevEvt; fPrevEvt =0;
00143 delete fLayout; fLayout =0;
00144 delete fButtonBar; fButtonBar =0;
00145 }
|
|
|
Definition at line 161 of file ButtonBar.cxx. References evdb::IoModule::FileName(), and evdb::IoModule::Instance(). 00162 {
00163 int i;
00164 const char* f;
00165 for (i=0; (f=IoModule::Instance()->FileName(i)); ++i) {
00166 std::cerr << f << std::endl;
00167 }
00168 }
|
|
|
Definition at line 176 of file ButtonBar.cxx. References fEventTextEntry, fRunTextEntry, evdb::IoModule::GoTo(), and evdb::IoModule::Instance(). 00177 {
00178 int run = atoi(fRunTextEntry ->GetText());
00179 int evt = atoi(fEventTextEntry->GetText());
00180 IoModule::Instance()->GoTo(run,evt);
00181 }
|
|
|
Definition at line 185 of file ButtonBar.cxx. References fCurrentFile, fEventTextEntry, fRunTextEntry, and gsGetEventNumbers(). Referenced by ButtonBar(). 00186 {
00187 int run;
00188 int evt;
00189 char runtxt[128];
00190 char evttxt[128];
00191
00192 gsGetEventNumbers(run,evt);
00193 sprintf(runtxt,"%d",run);
00194 sprintf(evttxt,"%d",evt);
00195 fRunTextEntry ->SetText(runtxt);
00196 fEventTextEntry->SetText(evttxt);
00197
00198 fCurrentFile->SetText(IoModule::Instance()->CurrentFile());
00199 }
|
|
|
Definition at line 153 of file ButtonBar.cxx. References evdb::IoModule::Advance(), and evdb::IoModule::Instance(). 00153 { IoModule::Instance()->Advance(); }
|
|
|
Definition at line 203 of file ButtonBar.cxx. References fButtonBar. 00204 {
00205 std::string s;
00206 s = "Sorry action '"; s += method; s+= "' is not implemented.\n";
00207 new TGMsgBox(evdb::TopWindow(), fButtonBar,
00208 "No implementation",s.c_str(),kMBIconExclamation);
00209 return 0;
00210 }
|
|
|
Definition at line 149 of file ButtonBar.cxx. References evdb::IoModule::Instance(), and evdb::IoModule::Rewind(). 00149 { IoModule::Instance()->Rewind(); }
|
|
|
Definition at line 172 of file ButtonBar.cxx. 00172 { new PrintDialog(); }
|
|
|
Definition at line 157 of file ButtonBar.cxx. References evdb::IoModule::Instance(), and evdb::IoModule::Reload(). 00157 { IoModule::Instance()->Reload(); }
|
|
|
Definition at line 41 of file ButtonBar.h. Referenced by ButtonBar(), NoImpl(), and ~ButtonBar(). |
|
|
Definition at line 46 of file ButtonBar.h. Referenced by ButtonBar(), NewEvent(), and ~ButtonBar(). |
|
|
Definition at line 51 of file ButtonBar.h. Referenced by ButtonBar(), GoTo(), NewEvent(), and ~ButtonBar(). |
|
|
Definition at line 47 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 53 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 42 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 44 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 43 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 54 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 45 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 49 of file ButtonBar.h. Referenced by ButtonBar(), and ~ButtonBar(). |
|
|
Definition at line 50 of file ButtonBar.h. Referenced by ButtonBar(), GoTo(), NewEvent(), and ~ButtonBar(). |
1.3.9.1