- Timestamp:
- 09/26/01 12:22:51 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r946 r947 1 1 -*-*- END -*-*- 2 3 2001/09/26: Thomas Bretz 4 5 * mmain/MMars.[cc,h], mmain/MBrowser.[cc,h], MDataCheck.[cc,h], 6 mmain/MEvtDisp.[cc,h], mmain/MMonteCarlo.[cc,h]: 7 - reorganized code (constructor) 8 - reorganized deletion of gui objects 9 - fixed many, many memory leaks 10 - small changes in layout 11 12 2 13 3 14 2001/09/25: Thomas Bretz -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r945 r947 36 36 #include <TGFSContainer.h> // TGFileContainer 37 37 38 #include <TG3DLine.h> // TGHorizontal3DLine 39 // use TGSplitter.h for root<3.00 40 38 41 #include <sys/stat.h> // S_ISDIR 39 42 … … 236 239 CreateMenuBar(); 237 240 241 TGLayoutHints *laylinesep = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 242 fList->Add(laylinesep); 243 244 TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this); 245 fList->Add(linesep); 246 AddFrame(linesep, laylinesep); 247 248 238 249 // 239 250 // ---- Create the top window with a lot of buttons ---- … … 242 253 fList->Add(frametop); 243 254 AddFrame(frametop); 255 256 linesep = new TGHorizontal3DLine(this); 257 fList->Add(linesep); 258 AddFrame(linesep, laylinesep); 244 259 245 260 // -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r945 r947 10 10 #endif 11 11 12 class TGMenuBar; 13 class TGPopupMenu; 14 class TGTab; 12 class TList; 13 class TGListView; 15 14 class TGComboBox; 16 class TGTextButton;17 class TGListBox;18 15 class TGPictureButton; 19 16 class TGFileContainer; 20 class TGListView;21 class TList;22 17 23 18 class MBrowser : public TGTransientFrame 24 19 { 25 20 private: 26 27 //28 // Create a main frame with a number of different buttons.29 //30 31 //32 // the things in the file selector33 //34 21 TGComboBox *fDir; 35 22 … … 40 27 TGFileContainer *fFileCont; 41 28 TGListView *fFileView; 42 43 44 TList *fList;45 46 // some icons and pictures often used47 29 48 30 const TGPicture *fPic1; … … 58 40 59 41 protected: 60 Char_t fInputFile[256]; 42 TList *fList; 43 Char_t fInputFile[256]; 61 44 62 45 void DisplError(const char *txt); … … 74 57 const UInt_t w=500, const UInt_t h=500) ; 75 58 76 ~MBrowser();59 virtual ~MBrowser(); 77 60 78 61 void CloseWindow(); -
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r749 r947 41 41 : MBrowser(main, p, w, h) 42 42 { 43 TGTextButton *pedadc = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC); 44 TGTextButton *cradc = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC); 45 TGTextButton *pedtdc = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC); 46 TGTextButton *crtdc = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC); 43 47 44 fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC ); 45 fButPedADC->Associate(this) ; 46 fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 48 pedadc->Associate(this); 49 cradc ->Associate(this); 50 pedtdc->Associate(this); 51 crtdc ->Associate(this); 47 52 48 fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC ); 49 fButCrADC->Associate(this) ; 50 fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 53 fList->Add(pedadc); 54 fList->Add(cradc); 55 fList->Add(pedtdc); 56 fList->Add(crtdc); 51 57 52 fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC ); 53 fButPedTDC->Associate(this) ; 54 fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 58 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 59 fList->Add(laybut); 55 60 56 fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC ); 57 fButCrTDC->Associate(this) ; 58 fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 61 fTop2->AddFrame(pedadc, laybut); 62 fTop2->AddFrame(cradc, laybut); 63 64 fTop3->AddFrame(pedtdc, laybut); 65 fTop3->AddFrame(crtdc, laybut); 59 66 60 67 MapSubwindows(); … … 68 75 } 69 76 70 MDataCheck::~MDataCheck()71 {72 delete fButPedADC;73 delete fButCrADC;74 delete fButPedTDC;75 delete fButCrTDC;76 }77 78 77 // ====================================================================== 79 78 80 79 Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) 81 { 82 // Process events generated by the buttons in the frame.83 80 { 81 // Process events generated by the buttons in the frame. 82 84 83 if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON) 85 84 return MBrowser::ProcessMessage(msg, parm1, parm2); … … 92 91 case M_BUTTON_CRTDC: 93 92 if (!InputFileSelected()) 94 { 93 { 95 94 DisplError("No Input (root) File selected!"); 96 95 return kTRUE; … … 100 99 { 101 100 case M_BUTTON_PEDADC: 102 fViewAdc.AdcSpectra(fInputFile, "PedEvents" );101 fViewAdc.AdcSpectra(fInputFile, "PedEvents"); 103 102 return kTRUE; 104 103 105 104 case M_BUTTON_CRADC: 106 fViewAdc.AdcSpectra(fInputFile, "Events" );105 fViewAdc.AdcSpectra(fInputFile, "Events"); 107 106 return kTRUE; 108 107 … … 118 117 119 118 return MBrowser::ProcessMessage(msg, parm1, parm2); 120 } 119 } -
trunk/MagicSoft/Mars/mmain/MDataCheck.h
r765 r947 6 6 #endif 7 7 8 #ifndef ROOT_TGFrame9 #include <TGFrame.h>8 #ifndef MBROWSER_H 9 #include "MBrowser.h" 10 10 #endif 11 11 … … 14 14 #endif 15 15 16 #ifndef MBROWSER_H17 #include "MBrowser.h"18 #endif19 20 class TGTextButton;21 22 16 class MDataCheck : public MBrowser 23 17 { 24 18 private: 25 26 19 MViewAdcSpectra fViewAdc; 27 28 TGTextButton *fButPedADC;29 TGTextButton *fButPedTDC;30 TGTextButton *fButCrADC;31 TGTextButton *fButCrTDC;32 20 33 21 public: 34 22 MDataCheck(const TGWindow *main=NULL, const TGWindow *p=NULL, 35 23 const UInt_t w=500, const UInt_t h=500) ; 36 37 ~MDataCheck();38 24 39 25 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); -
trunk/MagicSoft/Mars/mmain/MEvtDisp.cc
r860 r947 39 39 40 40 MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p, 41 41 const UInt_t w, const UInt_t h) 42 42 : MBrowser(main, p, w, h) 43 43 { 44 TGTextButton *fadcevt = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT); 45 TGTextButton *fadcped = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED); 46 TGTextButton *fadccal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL); 44 47 45 f ButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT);46 f ButFadcDispEvts->Associate(this);47 f Top1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5));48 fadcevt->Associate(this); 49 fadcped->Associate(this); 50 fadccal->Associate(this); 48 51 49 f ButFadcDispPed = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED);50 f ButFadcDispPed->Associate(this);51 f Top1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5));52 fList->Add(fadcevt); 53 fList->Add(fadcped); 54 fList->Add(fadccal); 52 55 53 fButFadcDispCal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL ); 54 fButFadcDispCal->Associate(this) ; 55 fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 56 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 57 fList->Add(laybut); 58 59 fTop1->AddFrame(fadcevt, laybut); 60 fTop1->AddFrame(fadcped, laybut); 61 fTop1->AddFrame(fadccal, laybut); 56 62 57 63 MapSubwindows(); … … 63 69 64 70 MapWindow(); 65 }66 67 MEvtDisp::~MEvtDisp()68 {69 delete fButFadcDispCal;70 delete fButFadcDispPed;71 delete fButFadcDispEvts;72 71 } 73 72 … … 100 99 101 100 case M_BUT_DISP1_PED: 102 new MGFadcDisp( 103 fClient->GetRoot(), this, 600, 500 );101 new MGFadcDisp(fInputFile , "PedEvts", 102 fClient->GetRoot(), this, 600, 500); 104 103 return kTRUE; 105 104 106 105 case M_BUT_DISP1_CAL: 107 new MGFadcDisp( 108 fClient->GetRoot(), this, 600, 500 );106 new MGFadcDisp(fInputFile , "CalEvts", 107 fClient->GetRoot(), this, 600, 500); 109 108 return kTRUE; 110 109 } -
trunk/MagicSoft/Mars/mmain/MEvtDisp.h
r714 r947 6 6 #endif 7 7 8 #ifndef ROOT_TGFrame9 #include <TGFrame.h>10 #endif11 12 8 #ifndef MBROWSER_H 13 9 #include "MBrowser.h" 14 10 #endif 15 11 16 class TGTextButton;17 18 12 class MEvtDisp : public MBrowser 19 13 { 20 private:21 22 TGTextButton *fButFadcDispEvts;23 TGTextButton *fButFadcDispPed;24 TGTextButton *fButFadcDispCal;25 26 14 public: 27 15 MEvtDisp(const TGWindow *main=NULL, const TGWindow *p=NULL, 28 const UInt_t w=500, const UInt_t h=500) ; 29 30 ~MEvtDisp(); 16 const UInt_t w=500, const UInt_t h=500) ; 31 17 32 18 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); -
trunk/MagicSoft/Mars/mmain/MMars.cc
r946 r947 103 103 104 104 top->AddFrame(magic, lay1); 105 top->AddFrame(mars, lay 1);105 top->AddFrame(mars, lay2); 106 106 } 107 107 … … 188 188 CreateBottomFrame(low); 189 189 190 AddFrame(top, new TGLayoutHints(kLHintsTop|kLHintsExpandX)); 191 AddFrame(linesep, new TGLayoutHints(kLHintsTop|kLHintsExpandX)); 192 AddFrame(low, new TGLayoutHints(kLHintsTop|kLHintsExpandX)); 190 TGLayoutHints *layout = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 191 fList->Add(layout); 192 193 AddFrame(top, layout); 194 AddFrame(linesep, layout); 195 AddFrame(low, layout); 193 196 194 197 // 195 198 // Map the window, set up the layout, etc. 196 199 // 197 SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ); // set the smallest and biggest size of the Main frame200 SetWMSizeHints(400, 380, 400, 380, 10, 10); // set the smallest and biggest size of the Main frame 198 201 199 202 MapSubwindows(); -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
r749 r947 34 34 }; 35 35 36 MMonteCarlo::MMonteCarlo(const TGWindow *main, const TGWindow *p, 37 const UInt_t w, const UInt_t h)38 : MBrowser(p, main, w, h)36 MMonteCarlo::MMonteCarlo(const TGWindow *main, const TGWindow *p, 37 const UInt_t w, const UInt_t h) 38 : MBrowser(main, p, w, h) 39 39 { 40 TGTextButton *action = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION); 41 fList->Add(action); 42 action->Associate(this); 40 43 41 fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION ); 42 fButAction->Associate(this) ; 43 fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 44 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 45 fList->Add(laybut); 46 47 fTop1->AddFrame(action, laybut); 44 48 45 49 MapSubwindows(); … … 52 56 MapWindow(); 53 57 } 54 55 MMonteCarlo::~MMonteCarlo()56 {57 delete fButAction;58 }59 58 60 59 // ====================================================================== -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.h
r765 r947 6 6 #endif 7 7 8 #ifndef ROOT_TGFrame9 #include <TGFrame.h>10 #endif11 8 #ifndef MBROWSER_H 12 9 #include "MBrowser.h" 13 10 #endif 14 11 15 class TGTextButton;16 17 12 class MMonteCarlo : public MBrowser 18 13 { 19 private:20 21 TGTextButton *fButAction;22 23 14 public: 24 15 MMonteCarlo(const TGWindow *main=NULL, const TGWindow *p=NULL, 25 const UInt_t w=500, const UInt_t h=500) ; 26 27 ~MMonteCarlo(); 16 const UInt_t w=500, const UInt_t h=500); 28 17 29 18 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
Note:
See TracChangeset
for help on using the changeset viewer.