Changeset 19240 for trunk/Mars/mbase
- Timestamp:
- 10/20/18 21:34:48 (6 years ago)
- Location:
- trunk/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mbase/MGList.cc
r8562 r19240 39 39 #include <TROOT.h> 40 40 #include <TClass.h> 41 #include <TImage.h> 41 42 #include <TGClient.h> 42 43 #include <TGWidget.h> … … 287 288 return pic; 288 289 } 290 291 const TGPicture *MGList::GetPicture(const char *name, const char *xpm[]) 292 { 293 struct MGPicture : public TGPicture 294 { 295 MGPicture (const char *_n, Pixmap_t _p, Pixmap_t _m) : TGPicture(_n, _p, _m) { } 296 }; 297 298 // Add Mars logo picture 299 TImage *img = TImage::Open(const_cast<char **>(xpm)); 300 if (!img) 301 return 0; 302 303 TGPicture *pic = new MGPicture(name, img->GetPixmap(), img->GetMask()); 304 delete img; 305 AddPicture(pic, name); 306 307 return pic; 308 } 309 289 310 // -------------------------------------------------------------------------- 290 311 // -
trunk/Mars/mbase/MGList.h
r5713 r19240 29 29 const TGPicture *GetPicture(const char *name); 30 30 const TGPicture *GetPicture(const char *name, Int_t width, Int_t height); 31 const TGPicture *GetPicture(const char *name, const char *xpm[]); 31 32 32 33 TObject *FindWidget(Int_t id) const; -
trunk/Mars/mbase/MStatusDisplay.cc
r18957 r19240 467 467 f->AddFrame(l, lay); 468 468 469 // Add Mars logo picture 470 const TGPicture *pic2 = fList->GetPicture("marslogo.xpm"); 471 if (pic2) 472 { 473 TGPictureButton *mars = new TGPictureButton(f, pic2, kPicMars); 474 fList->Add(mars); 475 mars->Associate(this); 476 477 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 10, 10, 5, 5); 478 fList->Add(lay2); 479 f->AddFrame(mars, lay2); 469 { 470 #define static static const 471 #include "marslogo.xpm" 472 #undef static 473 474 // Add Mars logo picture 475 const TGPicture *pic2 = fList->GetPicture("marslogo", marslogo); 476 if (pic2) 477 { 478 TGPictureButton *mars = new TGPictureButton(f, pic2, kPicMars); 479 fList->Add(mars); 480 mars->Associate(this); 481 482 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 10, 10, 5, 5); 483 fList->Add(lay2); 484 f->AddFrame(mars, lay2); 485 } 480 486 } 481 487
Note:
See TracChangeset
for help on using the changeset viewer.