Changeset 1108 for trunk/MagicSoft/Mars/mmain
- Timestamp:
- 12/11/01 15:22:10 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r1086 r1108 113 113 { 114 114 // 115 // Create Dir-Listbox and buttons in first frame116 //117 TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);118 dir->SetHeight(fEntry->GetHeight());119 120 //121 // Get the three picturs from the system (must be deleted by FreePicture)122 //123 const TGPicture *pic1 = fList->GetPicture("tb_uplevel.xpm");124 const TGPicture *pic2 = fList->GetPicture("tb_list.xpm");125 const TGPicture *pic3 = fList->GetPicture("tb_details.xpm");126 127 //128 // Create the corresponding picture buttons129 //130 TGPictureButton *cdup = new TGPictureButton(frame, pic1, kButDirUp);131 TGPictureButton *list = new TGPictureButton(frame, pic2, kButListMode);132 TGPictureButton *detail = new TGPictureButton(frame, pic3, kButDetailMode);133 134 //135 // setup the buttons136 //137 cdup ->SetToolTipText("One Level up!");138 list ->SetToolTipText("List Mode");139 detail->SetToolTipText("Details Mode");140 141 list ->SetState(kButtonUp);142 detail->SetState(kButtonEngaged);143 144 list ->AllowStayDown(kTRUE);145 detail->AllowStayDown(kTRUE);146 147 //148 // send messages to 'this' object149 //150 dir ->Associate(this);151 cdup ->Associate(this);152 detail->Associate(this);153 list ->Associate(this);154 155 //156 // Add to list for 'automatic' deletion157 //158 fList->Add(dir);159 fList->Add(cdup);160 fList->Add(list);161 fList->Add(detail);162 163 //164 115 // Layout Dir-Listbox and buttons in one row (frame) 165 116 // … … 169 120 // 170 121 TGLayoutHints *laydir = new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsCenterY); //, 5, 5, 5, 5); 122 TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5); 123 171 124 fList->Add(laydir); 172 173 TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);174 125 fList->Add(layout); 175 126 176 frame->AddFrame(dir, laydir); 177 frame->AddFrame(list, layout); 178 frame->AddFrame(detail, layout); 179 frame->AddFrame(cdup, layout); 127 // 128 // Create Dir-Listbox and buttons in first frame 129 // 130 TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory); 131 dir->SetHeight(fEntry->GetHeight()); 132 dir->Associate(this); 133 fList->Add(dir); 134 frame->AddFrame(dir, laydir); 135 136 // 137 // Get the three picturs from the system (must be deleted by FreePicture) 138 // 139 const TGPicture *pic1 = fList->GetPicture("tb_list.xpm"); 140 if (pic1) 141 { 142 TGPictureButton *list = new TGPictureButton(frame, pic1, kButListMode); 143 list->SetToolTipText("List Mode"); 144 list->SetState(kButtonUp); 145 list->AllowStayDown(kTRUE); 146 list->Associate(this); 147 fList->Add(list); 148 frame->AddFrame(list, layout); 149 } 150 151 const TGPicture *pic2 = fList->GetPicture("tb_details.xpm"); 152 if (pic2) 153 { 154 TGPictureButton *detail = new TGPictureButton(frame, pic2, kButDetailMode); 155 detail->SetToolTipText("Details Mode"); 156 detail->SetState(kButtonEngaged); 157 detail->AllowStayDown(kTRUE); 158 detail->Associate(this); 159 fList->Add(detail); 160 frame->AddFrame(detail, layout); 161 } 162 163 const TGPicture *pic3 = fList->GetPicture("tb_uplevel.xpm"); 164 if (pic3) 165 { 166 TGPictureButton *cdup = new TGPictureButton(frame, pic3, kButDirUp); 167 cdup->SetToolTipText("One Level up!"); 168 cdup->Associate(this); 169 fList->Add(cdup); 170 frame->AddFrame(cdup, layout); 171 } 180 172 } 181 173 -
trunk/MagicSoft/Mars/mmain/MMars.cc
r1082 r1108 26 26 #include "MMars.h" 27 27 28 #include <iostream.h> 29 28 30 #include <TApplication.h> // gROOT->GetApplication()->... 29 31 … … 35 37 #include <TG3DLine.h> // TGHorizontal3DLine 36 38 39 #include "MGList.h" 37 40 #include "MEvtDisp.h" 38 41 #include "MAnalysis.h" … … 85 88 void MMars::CreateTopFrame(TGHorizontalFrame *top) 86 89 { 87 fPic1 = gClient->GetPicture("magiclogo.xpm"); 88 fPic2 = gClient->GetPicture("marslogo.xpm"); 89 90 TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic); 91 TGPictureButton *mars = new TGPictureButton(top, fPic2, kPicMars); 92 93 fList->Add(magic); 94 fList->Add(mars); 95 96 magic->Associate(this); 97 mars->Associate(this); 98 99 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.); 100 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.); 101 102 fList->Add(lay1); 103 fList->Add(lay2); 104 105 top->AddFrame(magic, lay1); 106 top->AddFrame(mars, lay2); 90 const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm"); 91 if (pic1) 92 { 93 TGPictureButton *magic = new TGPictureButton(top, pic1, kPicMagic); 94 fList->Add(magic); 95 magic->Associate(this); 96 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.); 97 fList->Add(lay1); 98 top->AddFrame(magic, lay1); 99 } 100 101 const TGPicture *pic2 = fList->GetPicture("marslogo.xpm"); 102 if (pic2) 103 { 104 TGPictureButton *mars = new TGPictureButton(top, pic2, kPicMars); 105 fList->Add(mars); 106 mars->Associate(this); 107 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.); 108 fList->Add(lay2); 109 top->AddFrame(mars, lay2); 110 } 107 111 } 108 112 … … 176 180 // Create the deletion list 177 181 // 178 fList = new TList;182 fList = new MGList; 179 183 fList->SetOwner(); 180 184 … … 230 234 MMars::~MMars() 231 235 { 232 gClient->FreePicture(fPic1);233 gClient->FreePicture(fPic2);234 235 236 delete fList; 236 237 } -
trunk/MagicSoft/Mars/mmain/MMars.h
r1052 r1108 10 10 #endif 11 11 12 class TList;12 class MGList; 13 13 class TGVerticalFrame; 14 14 class TGLayoutHints; … … 18 18 private: 19 19 20 TList *fList; 21 22 const TGPicture *fPic1; 23 const TGPicture *fPic2; 20 MGList *fList; 24 21 25 22 void CreateTextButton(TGVerticalFrame *tab, const char *text,
Note:
See TracChangeset
for help on using the changeset viewer.