Changeset 1540 for trunk/MagicSoft/Mars/mmain
- Timestamp:
- 10/15/02 17:02:46 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MMars.cc
r1330 r1540 111 111 } 112 112 113 void MMars::CreateTextButton(TGVerticalFrame *tab, const char *text, 114 const UInt_t id, TGLayoutHints *hints) const 113 #include <TGLabel.h> 114 115 void MMars::CreateTextButton(TGVerticalFrame *tab, 116 const char *text, const char *descr, 117 const UInt_t id) const 115 118 { 116 119 // 117 120 // Create the button 118 121 // 119 TGTextButton *button = new TGTextButton(tab, text, id); 122 TGHorizontalFrame *frame = new TGHorizontalFrame(tab, 1, 1); 123 TGTextButton *button = new TGTextButton(frame, text, id); 124 TGLabel *label = new TGLabel(frame, descr); 125 TGLayoutHints *hints1 = new TGLayoutHints(kLHintsLeft|kLHintsCenterY|kLHintsExpandX, 5, 5, 2, 2); 120 126 121 127 // 122 128 // Add button for 'auto-delete' 123 129 // 130 fList->Add(hints1); 124 131 fList->Add(button); 132 fList->Add(label); 133 fList->Add(frame); 125 134 126 135 // … … 132 141 // Add button with corresponding layout to containing frame 133 142 // 134 tab->AddFrame(button, hints); 143 tab->AddFrame(frame, hints1); 144 frame->AddFrame(button, hints1); 145 frame->AddFrame(label, hints1); 135 146 } 136 147 … … 143 154 fList->Add(laytabs); 144 155 145 TGTab *tabs = new TGTab(low, 400, 400);156 TGTab *tabs = new TGTab(low, 1, 1); 146 157 fList->Add(tabs); 147 158 low->AddFrame(tabs, laytabs); … … 152 163 TGCompositeFrame *tf = tabs->AddTab("Control"); 153 164 154 TGVerticalFrame *tab1 = new TGVerticalFrame(tf, 300, 100); 155 TGVerticalFrame *tab2 = new TGVerticalFrame(tf, 300, 100); 156 157 fList->Add(tab1); 158 fList->Add(tab2); 159 160 TGLayoutHints *laytabx = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 161 fList->Add(laytabx); 162 163 tf->AddFrame(tab1, laytabx); 164 tf->AddFrame(tab2, laytabx); 165 166 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX, 10, 10, 10, 10); 167 fList->Add(laybut); 168 169 CreateTextButton(tab2, "Event Display", kButEvtDisplay, laybut); 170 CreateTextButton(tab2, "Data Check", kButDataCheck, laybut); 171 CreateTextButton(tab2, "Analysis", kButAnalysis, laybut); 172 CreateTextButton(tab2, "Monte Carlo", kButMonteCarlo, laybut); 173 CreateTextButton(tab2, "Camera Display", kButCameraDisplay, laybut); 165 TGLayoutHints *laytab = new TGLayoutHints(kLHintsCenterY|kLHintsExpandX); 166 TGVerticalFrame *tab = new TGVerticalFrame(tf, 1, 1); 167 fList->Add(laytab); 168 fList->Add(tab); 169 170 CreateTextButton(tab, "Event Display", "Historgrams: Pix per Event", 171 kButEvtDisplay); 172 CreateTextButton(tab, "Data Check", "Histograms: Pix per Run", 173 kButDataCheck); 174 CreateTextButton(tab, "Analysis", "Calculate image parameters", 175 kButAnalysis); 176 CreateTextButton(tab, "Monte Carlo", "Calculate MC stuff", 177 kButMonteCarlo); 178 CreateTextButton(tab, "Camera Display", "Display Cerenekov Photons", 179 kButCameraDisplay); 180 181 tf->AddFrame(tab, laytab); 174 182 } 175 183 176 184 MMars::MMars() 177 : TGMainFrame(gClient->GetRoot(), 330, 400, kVerticalFrame|kFixedSize)185 : TGMainFrame(gClient->GetRoot(), 400, 400, kVerticalFrame) 178 186 { 179 187 // … … 191 199 // create and layout the frame/contents 192 200 // 193 TGHorizontalFrame *top = new TGHorizontalFrame(this, 300, 100);194 TGHorizontalFrame *low = new TGHorizontalFrame(this, 300, 100);201 TGHorizontalFrame *top = new TGHorizontalFrame(this, 1, 1); 202 TGHorizontalFrame *low = new TGHorizontalFrame(this, 1, 1); 195 203 196 204 TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this); … … 203 211 CreateBottomFrame(low); 204 212 205 TGLayoutHints *layout = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 206 fList->Add(layout); 207 208 AddFrame(top, layout); 209 AddFrame(linesep, layout); 210 AddFrame(low, layout); 211 212 // CreateTopFrame(fTop2); 213 // CreateBottomFrame(fTop3); 213 TGLayoutHints *layout1 = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 214 TGLayoutHints *layout2 = new TGLayoutHints(kLHintsTop|kLHintsExpandX|kLHintsExpandY); 215 fList->Add(layout1); 216 fList->Add(layout2); 217 218 AddFrame(top, layout1); 219 AddFrame(linesep, layout1); 220 AddFrame(low, layout2); 214 221 215 222 // 216 223 // Map the window, set up the layout, etc. 217 // kFixedSize seems to be ignored 218 // 219 SetWMSizeHints(GetWidth(), GetHeight(), GetWidth(), GetHeight(), 0, 0); // set the smallest and biggest size of the Main frame 224 // 220 225 Move(rand()%100, rand()%100); 221 226 227 Layout(); 228 222 229 MapSubwindows(); 223 224 Layout();225 230 226 231 SetWindowName("MARS Main Window"); -
trunk/MagicSoft/Mars/mmain/MMars.h
r1108 r1540 21 21 22 22 void CreateTextButton(TGVerticalFrame *tab, const char *text, 23 const UInt_t id, TGLayoutHints *hints) const;23 const char *descr, const UInt_t id) const; 24 24 25 25 void CreateMenuBar(); -
trunk/MagicSoft/Mars/mmain/MProgressBar.cc
r1527 r1540 53 53 fList->SetOwner(); 54 54 55 //SetMWMHints(0, 0, 0); 56 55 57 SetWMSizeHints(150, 15, 640, 480, 10, 10); // set the smallest and biggest size of the Main frame 56 58 Move(rand()%100+50, rand()%100+50);
Note:
See TracChangeset
for help on using the changeset viewer.