Changeset 587 for trunk/MagicSoft/Mars/mgui/MGPrototyp.cc
- Timestamp:
- 01/23/01 10:43:18 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/MGPrototyp.cc
r571 r587 9 9 #include <TGListBox.h> // TGListBox 10 10 #include <TGFSContainer.h> // TGFileContainer 11 #include <TGSplitter.h> // TGHorizontal3DLine 12 #include <TGTextEntry.h> 13 #include <TGLabel.h> // TGLabel 14 11 15 12 16 // FIXME: Move to MAGIC.h … … 15 19 ClassImp(MGPrototyp) 16 20 17 enum Command DataChecker{21 enum CommandPrototyp { 18 22 M_FILE_CLOSE , 19 23 M_BUTTON_ACTION, 20 24 25 M_FILERESET, 21 26 M_PBUTTON_CDIR_UP, 22 27 M_PBUTTON_LIST_MODE, … … 58 63 AddFrame(fMenuBar, fLayMenuBar ) ; 59 64 65 fLineSep1 = new TGHorizontal3DLine(this) ; 66 AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ); 67 68 60 69 // 61 70 // Create the top window with a lot of buttons … … 74 83 AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ; 75 84 85 // a line between top and low frame 86 87 fLineSep2 = new TGHorizontal3DLine(this) ; 88 AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ); 76 89 77 90 // … … 92 105 // tf->AddFrame(fTabF1, fLayTab ) ; 93 106 94 95 107 fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 96 108 tf->AddFrame(fTabF1a, new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 97 109 98 fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 99 // tf->AddFrame(fTabF1b, new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY , 5, 5, 5, 5 ) ) ; 100 tf->AddFrame(fTabF1b, new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5, 5, 5, 5 ) ) ; 101 102 103 fDir = new TGListBox(fTabF1a, -1) ; 110 fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 111 tf->AddFrame(fTabF1b, new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 112 113 fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 114 // tf->AddFrame(fTabF1c, new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY , 5, 5, 5, 5 ) ) ; 115 tf->AddFrame(fTabF1c, new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5, 5, 5, 5 ) ) ; 116 117 // the items in the first subframe 118 119 fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") ); 120 fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 121 122 fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(256) ); 123 fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight()); 124 fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); 125 126 fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ; 127 fButFileReset->Associate(this) ; 128 fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10 ) ) ; 129 130 131 132 // the items in the second subfraem 133 134 fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") ); 135 fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 136 137 fDir = new TGListBox(fTabF1b, -1) ; 104 138 fDir->Resize(350,20) ; 105 139 char temp[100] ; … … 107 141 sprintf ( temp, "%s", gSystem->WorkingDirectory() ) ; 108 142 fDir->AddEntry(temp, 1) ; 109 fTabF1 a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;143 fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 110 144 111 145 112 146 fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 113 fCdup = new TGPictureButton(fTabF1 a, fPicCdup, M_PBUTTON_CDIR_UP ) ;147 fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ; 114 148 fCdup->SetToolTipText("One Level up!") ; 115 149 fCdup->Associate(this) ; 116 fTabF1 a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;150 fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 117 151 118 152 fPicList = fClient->GetPicture("tb_list.xpm") ; 119 fListMode = new TGPictureButton(fTabF1 a, fPicList, M_PBUTTON_LIST_MODE ) ;153 fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ; 120 154 fListMode->SetToolTipText("List Mode") ; 121 155 fListMode->Associate(this) ; 122 156 fListMode->SetState(kButtonUp) ; 123 157 fListMode->AllowStayDown(kTRUE) ; 124 fListMode->AllowStayDown(kTRUE) ; fTabF1 a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;158 fListMode->AllowStayDown(kTRUE) ; fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 125 159 126 160 fPicDetail = fClient->GetPicture("tb_details.xpm") ; 127 fDetail = new TGPictureButton(fTabF1 a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ;161 fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 128 162 fDetail->SetToolTipText("Details Mode") ; 129 163 fDetail->Associate(this) ; 130 164 fDetail->SetState(kButtonEngaged) ; 131 165 fDetail->AllowStayDown(kTRUE) ; 132 fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 133 134 135 fFileView = new TGListView(fTabF1b, 540, 380 ) ; 166 fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 167 168 // the items in the third subframe 169 170 fFileView = new TGListView(fTabF1c, 540, 380 ) ; 136 171 fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100, 137 172 kVerticalFrame, fgWhitePixel) ; … … 146 181 fFileCont->Sort(kSortByName) ; 147 182 148 fTabF1 b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ;183 fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 149 184 150 185 tf->AddFrame(fTabF1, fLayTab) ; … … 187 222 delete fDetail; 188 223 delete fDir ; 224 delete fLabDir ; 225 226 delete fButFileReset ; 227 delete fTxtFileName ; 228 delete fLabFileName ; 229 230 delete fTabF1c; 189 231 delete fTabF1b; 190 232 delete fTabF1a; … … 193 235 delete fTop1; 194 236 delete fTab; 237 195 238 delete fFrameTop; 196 239 delete fFrameLow; 240 delete fLineSep2 ; 241 delete fLineSep1 ; 242 197 243 delete fFileMenu; 198 244 delete fMenuBar; … … 269 315 270 316 break ; 271 317 318 319 case M_FILERESET: 320 321 sprintf ( fInputFile, "\n" ) ; 322 fTxtFileName->SetText( fInputFile ) ; 323 324 break; 272 325 case M_PBUTTON_CDIR_UP : 273 326 … … 375 428 else if ( ! strcmp(extens, "root") ) { // root file 376 429 sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ; 377 378 printf (" %s \n", fInputFile ) ; 430 fTxtFileName->SetText( fInputFile ) ; 431 379 432 break ; 380 433 }
Note:
See TracChangeset
for help on using the changeset viewer.