Changeset 8899


Ignore:
Timestamp:
05/25/08 11:42:34 (13 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MClone.cc

    r2206 r8899  
    6666// constructors.
    6767//
    68 void MClone::Init(const char *name, const char *title)
     68void MClone::Init(const char *name, const char *title) : fForceClone(kFALSE)
    6969{
    7070    fName  = name  ? name  : "MClone";
     
    160160Int_t MClone::Process()
    161161{
    162     //
    163     // Delete an existing clone
    164     //
     162    if (fClone && !fForceClone)
     163    {
     164        fObject->Copy(*fClone);
     165        return kTRUE;
     166    }
     167
    165168    Clear();
    166169
    167     //
    168     // Clone the given parameter container
    169     //
    170170    fClone = fObject->Clone();
     171    return kTRUE;
     172}
    171173
    172     return kTRUE;
    173 }
    174 
  • trunk/MagicSoft/Mars/mbase/MClone.h

    r2206 r8899  
    11#ifndef MARS_MClone
    22#define MARS_MClone
    3 
    4 #ifndef MARS_MAGIC
    5 #include "MAGIC.h"
    6 #endif
    73
    84#ifndef MARS_MTask
     
    2016    TObject* fClone;        // pointer to the cloned object. deletion is handled by MClone
    2117
     18    Bool_t fForceClone;
     19
     20    // MClone
    2221    void Init(const char *name, const char *title);
     22
     23    // MTask
     24    Int_t PreProcess(MParList *pList);
     25    Int_t Process();
    2326
    2427public:
     
    2730    ~MClone();
    2831
    29     Int_t PreProcess(MParList *pList);
    30     Int_t Process();
     32    // TObject
     33    void Clear(Option_t *opt=NULL);
    3134
     35    // MClone
    3236    TObject *GetClone() const  { return fClone; }
    3337    const TObject *GetObject() const { return fObject; }
    3438
    35     void Clear(Option_t *opt=NULL);
     39    void SetForceClone(Bool_t b=kTRUE) { fForceClone = b; }
    3640
    3741    ClassDef(MClone, 0) // Task to clone (duplicate) an object in memory
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r8891 r8899  
    825825// to the corresponding TCanvas. If it isn't found NULL is returned.
    826826//
    827 TRootEmbeddedCanvas *MStatusDisplay::GetEmbeddedCanvas(TGCompositeFrame *cf) const
    828 {
    829     TIter Next(cf->GetList());
     827TRootEmbeddedCanvas *MStatusDisplay::GetEmbeddedCanvas(TGCompositeFrame &cf)
     828{
     829    TIter Next(cf.GetList());
    830830
    831831    TGFrameElement *f;
     
    843843// to the corresponding TCanvas. If it isn't found NULL is returned.
    844844//
    845 TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame *cf) const
     845TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame &cf)
    846846{
    847847    TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(cf);
     
    877877    }
    878878
    879     return GetCanvas(fTab->GetTabContainer(i));
     879    return GetCanvas(*fTab->GetTabContainer(i));
    880880}
    881881
     
    938938        TObject *frame = f->fFrame;
    939939        if (frame->InheritsFrom(TGCompositeFrame::Class()))
    940             return GetCanvas((TGCompositeFrame*)frame);
     940            return GetCanvas(*(TGCompositeFrame*)frame);
    941941    }
    942942
     
    11131113        return;
    11141114
    1115     TCanvas *c=GetCanvas(f);
     1115    TCanvas *c=GetCanvas(*f);
    11161116    if (!c)
    11171117        return;
     
    13151315        return;
    13161316
    1317     TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(f);
     1317    TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(*f);
    13181318    if (!ec)
    13191319        return;
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.h

    r8680 r8899  
    118118    void AddLogTab();
    119119
    120     TCanvas *GetCanvas(TGCompositeFrame *f) const;
    121 
    122120    Bool_t ProcessMessageCommandMenu(Long_t mp1);
    123121    Bool_t ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2);
     
    146144    void RemoveTab(int i);
    147145    void SetStatusLine(const char *txt, Int_t idx);
    148 
    149     TRootEmbeddedCanvas *GetEmbeddedCanvas(TGCompositeFrame *cf) const;
    150146
    151147    Bool_t SaveAsImage(Int_t num, TString name, TImage::EImageFileTypes type);
     
    274270     void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected);
    275271
     272     // Public helper functions
     273     static TRootEmbeddedCanvas *GetEmbeddedCanvas(TGCompositeFrame &cf);
     274     static TCanvas *GetCanvas(TGCompositeFrame &f);
     275
    276276     ClassDef(MStatusDisplay, 0)   // Window for a status display
    277277};
Note: See TracChangeset for help on using the changeset viewer.