Ignore:
Timestamp:
12/17/04 13:27:08 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r5557 r5620  
    15881588// Draws a clone of a canvas into a new canvas. Taken from TCanvas.
    15891589//
    1590 void MStatusDisplay::DrawClonePad(TCanvas &newc, const TCanvas &oldc) const
     1590void MStatusDisplay::DrawClonePad(TCanvas &newc, TCanvas &oldc) const
    15911591{
    15921592    //copy pad attributes
     
    16051605    ((TAttPad&)oldc).Copy((TAttPad&)newc);
    16061606
     1607    // This must be there: Otherwise GetDrawOption() won't work
     1608    TVirtualPad *padsav = gPad;
     1609    oldc.cd();
     1610
    16071611    //copy primitives
    16081612    TObject *obj;
    16091613    TIter next(oldc.GetListOfPrimitives());
    1610     while ((obj=next())) {
    1611         gROOT->SetSelectedPad(&newc);
    1612         newc.GetListOfPrimitives()->Add(obj->Clone(),obj->GetDrawOption());
     1614    while ((obj=next()))
     1615    {
     1616        // Old line - I think it is not necessary anymore because of the cd()
     1617        //gROOT->SetSelectedPad(&newc);
     1618
     1619        // Now make a clone of the object
     1620        TObject *clone = obj->Clone();
     1621
     1622        // Clone also important bits (FIXME: Is this correct)
     1623        clone->SetBit(obj->TestBits(kMustCleanup|kCannotPick|kNoContextMenu));
     1624
     1625        // Now make sure that the clones are deleted at a later time
     1626        clone->SetBit(kCanDelete);
     1627
     1628        // Add the clone and its draw-option to the current pad
     1629        newc.GetListOfPrimitives()->Add(clone, obj->GetDrawOption());
    16131630    }
    16141631    newc.Modified();
    16151632    newc.Update();
     1633
     1634    padsav->cd();
    16161635}
    16171636
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.h

    r5498 r5620  
    117117    void UpdateTab(TGCompositeFrame *f);
    118118
    119     void DrawClonePad(TCanvas &newc, const TCanvas &oldc) const;
     119    void DrawClonePad(TCanvas &newc, TCanvas &oldc) const;
    120120    void CanvasSetFillColor(TPad &c, Int_t col) const;
    121121    Bool_t Display(const TObjArray &list);
Note: See TracChangeset for help on using the changeset viewer.