// @(#)root/gui:$Id$
// Author: Bertrand Bellenot 23/01/2008

/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TGFrame.h"
#include "TGLayout.h"
#include "TGMenu.h"
#include "TGSplitter.h"
#include "TGSplitFrame.h"
#include "TGInputDialog.h"
#include "TGResourcePool.h"
#include "TRootContextMenu.h"
#include "TClassMenuItem.h"
#include "TContextMenu.h"
#include "TString.h"
#include "TClass.h"
#include "TList.h"
#include "Riostream.h"

ClassImp(TGSplitTool)
ClassImp(TGSplitFrame)

//______________________________________________________________________________
TGSplitTool::TGSplitTool(const TGWindow *p, const TGFrame *f)
   : TGCompositeFrame(p, 10, 10, kHorizontalFrame | kRaisedFrame | kFixedSize)
{
   // Create a split frame tool tip. P is the tool tips parent window (normally
   // fClient->GetRoot() and f is the frame to which the tool tip is associated.

   SetWindowAttributes_t attr;
   attr.fMask             = kWAOverrideRedirect | kWASaveUnder;
   attr.fOverrideRedirect = kTRUE;
   attr.fSaveUnder        = kTRUE;

   gVirtualX->ChangeWindowAttributes(fId, &attr);
   SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());

   fRectGC.SetFillStyle(kFillSolid);
   fRectGC.SetForeground(0x99ff99);
   
   TClass *cl = TClass::GetClass("TGSplitFrame");
   cl->MakeCustomMenuList();
   TList *ml = cl->GetMenuList();
   ((TClassMenuItem *)ml->At(1))->SetTitle("Cleanup Frame");
   ((TClassMenuItem *)ml->At(2))->SetTitle("Close and Collapse");
   ((TClassMenuItem *)ml->At(3))->SetTitle("Undock Frame");
   ((TClassMenuItem *)ml->At(4))->SetTitle("Dock Frame Back");
   ((TClassMenuItem *)ml->At(5))->SetTitle("Switch to Main");
   ((TClassMenuItem *)ml->At(6))->SetTitle("Horizontally Split...");
   ((TClassMenuItem *)ml->At(7))->SetTitle("Vertically Split...");
   fContextMenu = new TContextMenu("SplitFrameContextMenu", "Actions");
   fMap.SetOwner(kTRUE);
   fMap.SetOwnerValue(kFALSE);
   MapSubwindows();
   if (f) Resize(f->GetWidth()/10, f->GetHeight()/10);
   AddInput(kButtonPressMask | kButtonReleaseMask | kPointerMotionMask);

   fWindow = f;
   fX = fY = -1;
}

//______________________________________________________________________________
TGSplitTool::~TGSplitTool()
{
   // TGSplitTool destructor.

   delete fContextMenu;
}

//______________________________________________________________________________
void TGSplitTool::AddRectangle(TGFrame *frame, Int_t x, Int_t y, Int_t w, Int_t h)
{
   // Add a rectangle representation of a split frame in the map, together 
   // with the frame itself.

   TGRectMap *rect = new TGRectMap(x, y, w, h); 
   fMap.Add(rect, frame);
}

//______________________________________________________________________________
void TGSplitTool::DoRedraw()
{
   // Redraw split frame tool.

   TGRectMap *rect;
   TMapIter next(&fMap);
   while ((rect = (TGRectMap*)next())) {
      gVirtualX->FillRectangle(fId, GetBckgndGC()(), rect->fX, 
                               rect->fY, rect->fW, rect->fH);
      gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY, 
                               rect->fW, rect->fH);
   }
   DrawBorder();
}

//______________________________________________________________________________
void TGSplitTool::DrawBorder()
{
   // Draw border of tool window.

   gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
   gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
   gVirtualX->DrawLine(fId, GetBlackGC()(),  0, fHeight-1, fWidth-1, fHeight-1);
   gVirtualX->DrawLine(fId, GetBlackGC()(),  fWidth-1, fHeight-1, fWidth-1, 0);
}

//______________________________________________________________________________
Bool_t TGSplitTool::HandleButton(Event_t *event)
{
   // Handle mouse click events in the tool.

   if (event->fType != kButtonPress)
      return kTRUE;
   Int_t px = 0, py = 0;
   Window_t wtarget;
   TGRectMap *rect;
   TGSplitFrame *frm = 0;
   TMapIter next(&fMap);
   while ((rect = (TGRectMap*)next())) {
      if (rect->Contains(event->fX, event->fY)) {
         frm = (TGSplitFrame *)fMap.GetValue((const TObject *)rect);
         gVirtualX->TranslateCoordinates(event->fWindow,
                                         gClient->GetDefaultRoot()->GetId(), 
                                         event->fX, event->fY, px, py, wtarget);
         fContextMenu->Popup(px, py, frm);
         // connect PoppedDown signal to close the tool window 
         // when the menu is closed
         TRootContextMenu *menu = ((TRootContextMenu *)fContextMenu->GetContextMenuImp());
         ((TGPopupMenu *)menu)->Connect("PoppedDown()", "TGSplitTool", this, "Hide()");
         return kTRUE;
      }
   }
   Hide();
   return kTRUE;
}

//______________________________________________________________________________
Bool_t TGSplitTool::HandleMotion(Event_t *event)
{
   // handle mouse motion events

   static TGRectMap *rect = 0, *oldrect = 0;
   TMapIter next(&fMap);
   while ((rect = (TGRectMap*)next())) {
      if (rect->Contains(event->fX, event->fY)) {
         // if inside a rectangle, highlight it
         if (rect != oldrect) {
            if (oldrect) {
               gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX, 
                                        oldrect->fY, oldrect->fW, oldrect->fH);
               gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY, 
                                        oldrect->fW, oldrect->fH);
            }
            gVirtualX->FillRectangle(fId, fRectGC(), rect->fX, rect->fY, rect->fW, 
                                     rect->fH);
            gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY, 
                                     rect->fW, rect->fH);
            oldrect = rect;
         }
         return kTRUE;
      }
   }
   if (oldrect) {
      gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX, 
                               oldrect->fY, oldrect->fW, oldrect->fH);
      gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY, 
                               oldrect->fW, oldrect->fH);
   }
   return kTRUE;
}
//______________________________________________________________________________
void TGSplitTool::Hide()
{
   // Hide tool window. Use this method to hide the tool in a client class.

   gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);  // ungrab pointer
   fMap.Delete();
   UnmapWindow();
}

//______________________________________________________________________________
void TGSplitTool::Reset()
{
   // Reset tool tip popup delay timer. Use this method to activate tool tip
   // in a client class.

   fMap.Delete();
}

//______________________________________________________________________________
void TGSplitTool::SetPosition(Int_t x, Int_t y)
{
   // Set popup position within specified frame (as specified in the ctor).
   // To get back default behaviour (in the middle just below the designated
   // frame) set position to -1,-1.

   fX = x;
   fY = y;

   if (fX < -1)
      fX = 0;
   if (fY < -1)
      fY = 0;

   if (fWindow) {
      if (fX > (Int_t) fWindow->GetWidth())
         fX = fWindow->GetWidth();
      if (fY > (Int_t) fWindow->GetHeight())
         fY = fWindow->GetHeight();
   }
}

//______________________________________________________________________________
void TGSplitTool::Show(Int_t x, Int_t y)
{
   // Show tool window.

   Move(x, y);
   MapWindow();
   RaiseWindow();

   // last argument kFALSE forces all specified events to this window
   gVirtualX->GrabPointer(fId, kButtonPressMask | kPointerMotionMask, kNone, 
                          fClient->GetResourcePool()->GetGrabCursor(), 
                          kTRUE, kFALSE);
   // Long_t args[2];
   // args[0] = x;
   // args[1] = y;
}

//______________________________________________________________________________
TGSplitFrame::TGSplitFrame(const TGWindow *p, UInt_t w, UInt_t h,
        UInt_t options) : TGCompositeFrame(p, w, h, options), 
        fFrame(0), fSplitter(0), fFirst(0), fSecond(0)
{
   // Default constructor.

   fSplitTool = new TGSplitTool(gClient->GetDefaultRoot(), this);
   fHRatio = fWRatio = 0.0;
   fUndocked = 0;
   AddInput(kStructureNotifyMask);
   SetCleanup(kLocalCleanup);
}

//______________________________________________________________________________
TGSplitFrame::~TGSplitFrame()
{
   // Destructor. Make cleanup.
   
   delete fSplitTool;
   Cleanup();
}

//______________________________________________________________________________
void TGSplitFrame::AddFrame(TGFrame *f, TGLayoutHints *l)
{
   // Add a frame in the split frame using layout hints l.

   TGCompositeFrame::AddFrame(f, l);
   fFrame = f;
}

//______________________________________________________________________________
void TGSplitFrame::RemoveFrame(TGFrame *f)
{
   // Add a frame in the split frame using layout hints l.

   TGCompositeFrame::RemoveFrame(f);
   if (f == fFrame)
      fFrame = 0;
}

//______________________________________________________________________________
void TGSplitFrame::Cleanup()
{
   // Recursively cleanup child frames.

   TGCompositeFrame::Cleanup();
   fFirst = 0;
   fSecond = 0;
   fSplitter = 0;
   fUndocked = 0;
}

//______________________________________________________________________________
TGSplitFrame *TGSplitFrame::GetTopFrame()
{
   // Return the top level split frame.

   TGSplitFrame *top = this;
   TGWindow *w = (TGWindow *)GetParent();
   TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
   while (p) {
      top = p;
      w = (TGWindow *)p->GetParent();
      p = dynamic_cast<TGSplitFrame *>(w);
   }
   return top;
}

//______________________________________________________________________________
void TGSplitFrame::Close()
{
   // Close (unmap and remove from the list of frames) the frame contained in
   // this split frame.

   if (fFrame) {
      fFrame->UnmapWindow();
      RemoveFrame(fFrame);
   }
   fFrame = 0;
}

//______________________________________________________________________________
void TGSplitFrame::CloseAndCollapse()
{
   // Close (unmap, remove from the list of frames and destroy) the frame 
   // contained in this split frame. Then unsplit the parent frame.

   if (!fSplitter || !fFirst || !fSecond) {
      TGSplitFrame *parent = (TGSplitFrame *)GetParent();
      if (parent->GetFirst() && parent->GetSecond()) {
         if (parent->GetFirst()  == this)
            parent->UnSplit("first");
         else if (parent->GetSecond() == this)
            parent->UnSplit("second");
      }
   }
}
//______________________________________________________________________________
void TGSplitFrame::Docked(TGFrame* frame)
{
   // Emit Undocked() signal.

   Emit("Docked(TGFrame*)", (Long_t)frame);
}

//______________________________________________________________________________
void TGSplitFrame::ExtractFrame()
{
   // Extract the frame contained in this split frame an reparent it in a 
   // transient frame. Keep a pointer on the transient frame to be able to
   // swallow the child frame back to this.

   if (fFrame) {
      fFrame->UnmapWindow();
      fUndocked = new TGTransientFrame(gClient->GetDefaultRoot(), GetMainFrame(), 800, 600);
      fFrame->ReparentWindow(fUndocked);
      fUndocked->AddFrame(fFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      // Layout...
      fUndocked->MapSubwindows();
      fUndocked->Layout();
      fUndocked->MapWindow();
      RemoveFrame(fFrame);
      fUndocked->Connect("CloseWindow()", "TGSplitFrame", this, "SwallowBack()");
      Undocked(fFrame);
   }
}

//______________________________________________________________________________
Bool_t TGSplitFrame::HandleConfigureNotify(Event_t *)
{
   // Handles resize events for this frame.
   // This is needed to keep as much as possible the sizes ratio between
   // all subframes.

   if (!fFirst) {
      // case of resizing a frame with the splitter (and not from parent)
      TGWindow *w = (TGWindow *)GetParent();
      TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
      if (p) {
         if (p->GetFirst()) {
            // set the correct ratio for this child
            Float_t hratio = (Float_t)p->GetFirst()->GetHeight() / (Float_t)p->GetHeight();
            Float_t wratio = (Float_t)p->GetFirst()->GetWidth() / (Float_t)p->GetWidth();
            p->SetHRatio(hratio);
            p->SetWRatio(wratio);
         }
      }
      return kTRUE;
   }
   // case of resize event comes from the parent (i.e. by rezing TGMainFrame)
   if ((fHRatio > 0.0) && (fWRatio > 0.0)) {
      Float_t h = fHRatio * (Float_t)GetHeight();
      fFirst->SetHeight((UInt_t)h);
      Float_t w = fWRatio * (Float_t)GetWidth();
      fFirst->SetWidth((UInt_t)w);
   }
   // memorize the actual ratio for next resize event
   fHRatio = (Float_t)fFirst->GetHeight() / (Float_t)GetHeight();
   fWRatio = (Float_t)fFirst->GetWidth() / (Float_t)GetWidth();
   fClient->NeedRedraw(this);
   if (!gVirtualX->InheritsFrom("TGX11"))
      Layout();
   return kTRUE;
}

//______________________________________________________________________________
void TGSplitFrame::HSplit(UInt_t h)
{
   // Horizontally split the frame.

   // return if already split
   if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
      return;
   UInt_t height = (h > 0) ? h : fHeight/2;
   // set correct option (vertical frame)
   ChangeOptions((GetOptions() & ~kHorizontalFrame) | kVerticalFrame);
   // create first split frame with fixed height - required for the splitter
   fFirst = new TGSplitFrame(this, fWidth, height, kSunkenFrame | kFixedHeight);
   // create second split frame
   fSecond = new TGSplitFrame(this, fWidth, height, kSunkenFrame);
   // create horizontal splitter
   fSplitter = new TGHSplitter(this, 4, 4);
   // set the splitter's frame to the first one
   fSplitter->SetFrame(fFirst, kTRUE);
   fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this, 
                      "OnSplitterClicked(Event_t*)");
   // add all frames
   TGCompositeFrame::AddFrame(fFirst, new TGLayoutHints(kLHintsExpandX));
   TGCompositeFrame::AddFrame(fSplitter, new TGLayoutHints(kLHintsLeft | 
                              kLHintsTop | kLHintsExpandX));
   TGCompositeFrame::AddFrame(fSecond, new TGLayoutHints(kLHintsExpandX | 
                              kLHintsExpandY));
}

//______________________________________________________________________________
void TGSplitFrame::VSplit(UInt_t w)
{
   // Vertically split the frame.

   // return if already split
   if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
      return;
   UInt_t width = (w > 0) ? w : fWidth/2;
   // set correct option (horizontal frame)
   ChangeOptions((GetOptions() & ~kVerticalFrame) | kHorizontalFrame);
   // create first split frame with fixed width - required for the splitter
   fFirst = new TGSplitFrame(this, width, fHeight, kSunkenFrame | kFixedWidth);
   // create second split frame
   fSecond = new TGSplitFrame(this, width, fHeight, kSunkenFrame);
   // create vertical splitter
   fSplitter = new TGVSplitter(this, 4, 4);
   // set the splitter's frame to the first one
   fSplitter->SetFrame(fFirst, kTRUE);
   fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this, 
                      "OnSplitterClicked(Event_t*)");
   // add all frames
   TGCompositeFrame::AddFrame(fFirst, new TGLayoutHints(kLHintsExpandY));
   TGCompositeFrame::AddFrame(fSplitter, new TGLayoutHints(kLHintsLeft | 
                              kLHintsTop | kLHintsExpandY));
   TGCompositeFrame::AddFrame(fSecond, new TGLayoutHints(kLHintsExpandX | 
                              kLHintsExpandY));
}

//______________________________________________________________________________
void TGSplitFrame::MapToSPlitTool(TGSplitFrame *top)
{
   // Map this split frame in the small overview tooltip.

   Int_t px = 0, py = 0;
   Int_t rx = 0, ry = 0;
   Int_t cx, cy, cw, ch;
   Window_t wtarget;
   if (!fFirst && !fSecond) {
      TGSplitFrame *parent = dynamic_cast<TGSplitFrame *>((TGFrame *)fParent);
      if (parent && parent->fSecond == this) {
         if (parent->GetOptions() & kVerticalFrame)
            ry = parent->GetFirst()->GetHeight();
         if (parent->GetOptions() & kHorizontalFrame)
            rx = parent->GetFirst()->GetWidth();
      }
      gVirtualX->TranslateCoordinates(GetId(), top->GetId(), 
                                      fX, fY, px, py, wtarget);
      cx = ((px-rx)/10)+2;
      cy = ((py-ry)/10)+2;
      cw = (fWidth/10)-4;
      ch = (fHeight/10)-4;
      top->GetSplitTool()->AddRectangle(this, cx, cy, cw, ch);
      return;
   }
   if (fFirst)
      fFirst->MapToSPlitTool(top);
   if (fSecond)
      fSecond->MapToSPlitTool(top);
}

//______________________________________________________________________________
void TGSplitFrame::OnSplitterClicked(Event_t *event)
{
   // Handle mouse click events on the splitter.

   Int_t    px = 0, py = 0;
   Window_t wtarget;
   if (event->fType != kButtonPress)
      return;
   if (event->fCode != kButton3)
      return;
   gVirtualX->TranslateCoordinates(event->fWindow,
                                   gClient->GetDefaultRoot()->GetId(), 
                                   event->fX, event->fY, px, py, wtarget);
   TGSplitFrame *top = GetTopFrame();
   top->GetSplitTool()->Reset();
   top->GetSplitTool()->Resize(1+top->GetWidth()/10, 1+top->GetHeight()/10);
   top->MapToSPlitTool(top);
   top->GetSplitTool()->Show(px, py);
}

//______________________________________________________________________________
void TGSplitFrame::SplitHor()
{
   // Horizontally split the frame, and if it contains a child frame, ask 
   // the user where to keep it (top or bottom). This is the method used 
   // via the context menu.

   char side[200];
   snprintf(side, 200, "top");
   if (fFrame) {
      new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
               "In which side the actual frame has to be kept (top / bottom)", 
               side, side);
      if ( strcmp(side, "") == 0 )  // Cancel button was pressed
         return;
   }
   SplitHorizontal(side);
}

//______________________________________________________________________________
void TGSplitFrame::SplitHorizontal(const char *side)
{
   // Horizontally split the frame, and if it contains a child frame, ask 
   // the user where to keep it (top or bottom). This method is the actual
   // implementation.

   if (fFrame) {
      TGFrame *frame = fFrame;
      frame->UnmapWindow();
      frame->ReparentWindow(gClient->GetDefaultRoot());
      RemoveFrame(fFrame);
      HSplit();
      if (!strcmp(side, "top")) {
         frame->ReparentWindow(GetFirst());
         GetFirst()->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      }
      else if (!strcmp(side, "bottom")) {
         frame->ReparentWindow(GetSecond());
         GetSecond()->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      }
   }
   else {
      HSplit();
   }
   MapSubwindows();
   Layout();
}

//______________________________________________________________________________
void TGSplitFrame::SplitVer()
{
   // Vertically split the frame, and if it contains a child frame, ask 
   // the user where to keep it (left or right). This is the method used 
   // via the context menu.

   char side[200];
   snprintf(side, 200, "left");
   if (fFrame) {
      new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
               "In which side the actual frame has to be kept (left / right)", 
               side, side);
      if ( strcmp(side, "") == 0 )  // Cancel button was pressed
         return;
   }
   SplitVertical(side);
}

//______________________________________________________________________________
void TGSplitFrame::SplitVertical(const char *side)
{
   // Vertically split the frame, and if it contains a child frame, ask 
   // the user where to keep it (left or right). This method is the actual
   // implementation.

   if (fFrame) {
      TGFrame *frame = fFrame;
      frame->UnmapWindow();
      frame->ReparentWindow(gClient->GetDefaultRoot());
      RemoveFrame(fFrame);
      VSplit();
      if (!strcmp(side, "left")) {
         frame->ReparentWindow(GetFirst());
         GetFirst()->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      }
      else if (!strcmp(side, "right")) {
         frame->ReparentWindow(GetSecond());
         GetSecond()->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      }
   }
   else {
      VSplit();
   }
   MapSubwindows();
   Layout();
}

//______________________________________________________________________________
void TGSplitFrame::SwallowBack()
{
   // Swallow back the child frame previously extracted, and close its
   // parent (transient frame).

   if (!fUndocked) {
      fUndocked = dynamic_cast<TGTransientFrame *>((TQObject*)gTQSender);
   }
   if (fUndocked) {
      TGFrameElement *el = dynamic_cast<TGFrameElement*>(fUndocked->GetList()->First());
      if (!el || !el->fFrame) return;
      TGSplitFrame *frame = (TGSplitFrame *)el->fFrame;
      frame->UnmapWindow();
      fUndocked->RemoveFrame(frame);
      frame->ReparentWindow(this);
      AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
      // Layout...
      MapSubwindows();
      Layout();
      fUndocked->CloseWindow();
      fUndocked = 0;
      Docked(frame);
   }
}

//______________________________________________________________________________
void TGSplitFrame::SwitchFrames(TGFrame *frame, TGCompositeFrame *dest,
                                TGFrame *prev)
{
   // Switch (exchange) two frames.
   // frame is the source, dest is the destination (the new parent)
   // prev is the frame that has to be exchanged with the source 
   // (the one actually in the destination)

   // get parent of the source (its container)
   TGCompositeFrame *parent = (TGCompositeFrame *)frame->GetParent();

   // unmap the window (to avoid flickering)
   prev->UnmapWindow();
   // remove it from the destination frame
   dest->RemoveFrame(prev);
   // temporary reparent it to root (desktop window)
   prev->ReparentWindow(gClient->GetDefaultRoot());

   // now unmap the source window (still to avoid flickering)
   frame->UnmapWindow();
   // remove it from its parent (its container)
   parent->RemoveFrame(frame);
   // reparent it to the target location
   frame->ReparentWindow(dest);
   // add it to its new parent (for layout managment)
   dest->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
   // Layout...
   frame->Resize(dest->GetDefaultSize());
   dest->MapSubwindows();
   dest->Layout();

   // now put back the previous one in the previous source parent
   // reparent to the previous source container
   prev->ReparentWindow(parent);
   // add it to the frame (for layout managment)
   parent->AddFrame(prev, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
   // Layout...
   prev->Resize(parent->GetDefaultSize());
   parent->MapSubwindows();
   parent->Layout();
}

//______________________________________________________________________________
void TGSplitFrame::SwitchToMain()
{
   // Switch the actual embedded frame to the main (first) split frame.

   TGFrame *source = fFrame;
   TGSplitFrame *dest = GetTopFrame()->GetFirst();
   TGFrame *prev = (TGFrame *)(dest->GetFrame());
   if ((source != prev) && (source != dest))
      SwitchFrames(source, dest, prev);
}

//______________________________________________________________________________
void TGSplitFrame::Undocked(TGFrame* frame)
{
   // Emit Undocked() signal.

   Emit("Undocked(TGFrame*)", (Long_t)frame);
}

//______________________________________________________________________________
void TGSplitFrame::UnSplit(const char *which)
{
   // Close (unmap and remove from the list of frames) the frame contained in
   // this split frame.

   TGCompositeFrame *keepframe = 0;
   TGSplitFrame *kframe = 0, *dframe = 0;
   if (!strcmp(which, "first")) {
      dframe = GetFirst();
      kframe = GetSecond();
   }
   else if (!strcmp(which, "second")) {
      dframe = GetSecond();
      kframe = GetFirst();
   }
   if (!kframe || !dframe)
      return;
   keepframe = (TGCompositeFrame *)kframe->GetFrame();
   if (keepframe) {
      keepframe->UnmapWindow();
      keepframe->ReparentWindow(gClient->GetDefaultRoot());
      kframe->RemoveFrame(keepframe);
   }
   Cleanup();
   if (keepframe) {
      keepframe->ReparentWindow(this);
      AddFrame(keepframe, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
   }
   MapSubwindows();
   Layout();
}

//______________________________________________________________________________
void TGSplitFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
   // Save a splittable frame as a C++ statement(s) on output stream out.

   if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);

   out << std::endl << "   // splittable frame" << std::endl;
   out << "   TGSplitFrame *";
   out << GetName() << " = new TGSplitFrame(" << fParent->GetName()
       << "," << GetWidth() << "," << GetHeight();

   if (fBackground == GetDefaultFrameBackground()) {
      if (!GetOptions()) {
         out << ");" << std::endl;
      } else {
         out << "," << GetOptionString() <<");" << std::endl;
      }
   } else {
      out << "," << GetOptionString() << ",ucolor);" << std::endl;
   }
   if (option && strstr(option, "keep_names"))
      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;

   // setting layout manager if it differs from the main frame type
   // coverity[returned_null]
   // coverity[dereference]
   TGLayoutManager * lm = GetLayoutManager();
   if ((GetOptions() & kHorizontalFrame) &&
       (lm->InheritsFrom(TGHorizontalLayout::Class()))) {
      ;
   } else if ((GetOptions() & kVerticalFrame) &&
              (lm->InheritsFrom(TGVerticalLayout::Class()))) {
      ;
   } else {
      out << "   " << GetName() <<"->SetLayoutManager(";
      lm->SavePrimitive(out, option);
      out << ");"<< std::endl;
   }

   SavePrimitiveSubframes(out, option);
}
 TGSplitFrame.cxx:1
 TGSplitFrame.cxx:2
 TGSplitFrame.cxx:3
 TGSplitFrame.cxx:4
 TGSplitFrame.cxx:5
 TGSplitFrame.cxx:6
 TGSplitFrame.cxx:7
 TGSplitFrame.cxx:8
 TGSplitFrame.cxx:9
 TGSplitFrame.cxx:10
 TGSplitFrame.cxx:11
 TGSplitFrame.cxx:12
 TGSplitFrame.cxx:13
 TGSplitFrame.cxx:14
 TGSplitFrame.cxx:15
 TGSplitFrame.cxx:16
 TGSplitFrame.cxx:17
 TGSplitFrame.cxx:18
 TGSplitFrame.cxx:19
 TGSplitFrame.cxx:20
 TGSplitFrame.cxx:21
 TGSplitFrame.cxx:22
 TGSplitFrame.cxx:23
 TGSplitFrame.cxx:24
 TGSplitFrame.cxx:25
 TGSplitFrame.cxx:26
 TGSplitFrame.cxx:27
 TGSplitFrame.cxx:28
 TGSplitFrame.cxx:29
 TGSplitFrame.cxx:30
 TGSplitFrame.cxx:31
 TGSplitFrame.cxx:32
 TGSplitFrame.cxx:33
 TGSplitFrame.cxx:34
 TGSplitFrame.cxx:35
 TGSplitFrame.cxx:36
 TGSplitFrame.cxx:37
 TGSplitFrame.cxx:38
 TGSplitFrame.cxx:39
 TGSplitFrame.cxx:40
 TGSplitFrame.cxx:41
 TGSplitFrame.cxx:42
 TGSplitFrame.cxx:43
 TGSplitFrame.cxx:44
 TGSplitFrame.cxx:45
 TGSplitFrame.cxx:46
 TGSplitFrame.cxx:47
 TGSplitFrame.cxx:48
 TGSplitFrame.cxx:49
 TGSplitFrame.cxx:50
 TGSplitFrame.cxx:51
 TGSplitFrame.cxx:52
 TGSplitFrame.cxx:53
 TGSplitFrame.cxx:54
 TGSplitFrame.cxx:55
 TGSplitFrame.cxx:56
 TGSplitFrame.cxx:57
 TGSplitFrame.cxx:58
 TGSplitFrame.cxx:59
 TGSplitFrame.cxx:60
 TGSplitFrame.cxx:61
 TGSplitFrame.cxx:62
 TGSplitFrame.cxx:63
 TGSplitFrame.cxx:64
 TGSplitFrame.cxx:65
 TGSplitFrame.cxx:66
 TGSplitFrame.cxx:67
 TGSplitFrame.cxx:68
 TGSplitFrame.cxx:69
 TGSplitFrame.cxx:70
 TGSplitFrame.cxx:71
 TGSplitFrame.cxx:72
 TGSplitFrame.cxx:73
 TGSplitFrame.cxx:74
 TGSplitFrame.cxx:75
 TGSplitFrame.cxx:76
 TGSplitFrame.cxx:77
 TGSplitFrame.cxx:78
 TGSplitFrame.cxx:79
 TGSplitFrame.cxx:80
 TGSplitFrame.cxx:81
 TGSplitFrame.cxx:82
 TGSplitFrame.cxx:83
 TGSplitFrame.cxx:84
 TGSplitFrame.cxx:85
 TGSplitFrame.cxx:86
 TGSplitFrame.cxx:87
 TGSplitFrame.cxx:88
 TGSplitFrame.cxx:89
 TGSplitFrame.cxx:90
 TGSplitFrame.cxx:91
 TGSplitFrame.cxx:92
 TGSplitFrame.cxx:93
 TGSplitFrame.cxx:94
 TGSplitFrame.cxx:95
 TGSplitFrame.cxx:96
 TGSplitFrame.cxx:97
 TGSplitFrame.cxx:98
 TGSplitFrame.cxx:99
 TGSplitFrame.cxx:100
 TGSplitFrame.cxx:101
 TGSplitFrame.cxx:102
 TGSplitFrame.cxx:103
 TGSplitFrame.cxx:104
 TGSplitFrame.cxx:105
 TGSplitFrame.cxx:106
 TGSplitFrame.cxx:107
 TGSplitFrame.cxx:108
 TGSplitFrame.cxx:109
 TGSplitFrame.cxx:110
 TGSplitFrame.cxx:111
 TGSplitFrame.cxx:112
 TGSplitFrame.cxx:113
 TGSplitFrame.cxx:114
 TGSplitFrame.cxx:115
 TGSplitFrame.cxx:116
 TGSplitFrame.cxx:117
 TGSplitFrame.cxx:118
 TGSplitFrame.cxx:119
 TGSplitFrame.cxx:120
 TGSplitFrame.cxx:121
 TGSplitFrame.cxx:122
 TGSplitFrame.cxx:123
 TGSplitFrame.cxx:124
 TGSplitFrame.cxx:125
 TGSplitFrame.cxx:126
 TGSplitFrame.cxx:127
 TGSplitFrame.cxx:128
 TGSplitFrame.cxx:129
 TGSplitFrame.cxx:130
 TGSplitFrame.cxx:131
 TGSplitFrame.cxx:132
 TGSplitFrame.cxx:133
 TGSplitFrame.cxx:134
 TGSplitFrame.cxx:135
 TGSplitFrame.cxx:136
 TGSplitFrame.cxx:137
 TGSplitFrame.cxx:138
 TGSplitFrame.cxx:139
 TGSplitFrame.cxx:140
 TGSplitFrame.cxx:141
 TGSplitFrame.cxx:142
 TGSplitFrame.cxx:143
 TGSplitFrame.cxx:144
 TGSplitFrame.cxx:145
 TGSplitFrame.cxx:146
 TGSplitFrame.cxx:147
 TGSplitFrame.cxx:148
 TGSplitFrame.cxx:149
 TGSplitFrame.cxx:150
 TGSplitFrame.cxx:151
 TGSplitFrame.cxx:152
 TGSplitFrame.cxx:153
 TGSplitFrame.cxx:154
 TGSplitFrame.cxx:155
 TGSplitFrame.cxx:156
 TGSplitFrame.cxx:157
 TGSplitFrame.cxx:158
 TGSplitFrame.cxx:159
 TGSplitFrame.cxx:160
 TGSplitFrame.cxx:161
 TGSplitFrame.cxx:162
 TGSplitFrame.cxx:163
 TGSplitFrame.cxx:164
 TGSplitFrame.cxx:165
 TGSplitFrame.cxx:166
 TGSplitFrame.cxx:167
 TGSplitFrame.cxx:168
 TGSplitFrame.cxx:169
 TGSplitFrame.cxx:170
 TGSplitFrame.cxx:171
 TGSplitFrame.cxx:172
 TGSplitFrame.cxx:173
 TGSplitFrame.cxx:174
 TGSplitFrame.cxx:175
 TGSplitFrame.cxx:176
 TGSplitFrame.cxx:177
 TGSplitFrame.cxx:178
 TGSplitFrame.cxx:179
 TGSplitFrame.cxx:180
 TGSplitFrame.cxx:181
 TGSplitFrame.cxx:182
 TGSplitFrame.cxx:183
 TGSplitFrame.cxx:184
 TGSplitFrame.cxx:185
 TGSplitFrame.cxx:186
 TGSplitFrame.cxx:187
 TGSplitFrame.cxx:188
 TGSplitFrame.cxx:189
 TGSplitFrame.cxx:190
 TGSplitFrame.cxx:191
 TGSplitFrame.cxx:192
 TGSplitFrame.cxx:193
 TGSplitFrame.cxx:194
 TGSplitFrame.cxx:195
 TGSplitFrame.cxx:196
 TGSplitFrame.cxx:197
 TGSplitFrame.cxx:198
 TGSplitFrame.cxx:199
 TGSplitFrame.cxx:200
 TGSplitFrame.cxx:201
 TGSplitFrame.cxx:202
 TGSplitFrame.cxx:203
 TGSplitFrame.cxx:204
 TGSplitFrame.cxx:205
 TGSplitFrame.cxx:206
 TGSplitFrame.cxx:207
 TGSplitFrame.cxx:208
 TGSplitFrame.cxx:209
 TGSplitFrame.cxx:210
 TGSplitFrame.cxx:211
 TGSplitFrame.cxx:212
 TGSplitFrame.cxx:213
 TGSplitFrame.cxx:214
 TGSplitFrame.cxx:215
 TGSplitFrame.cxx:216
 TGSplitFrame.cxx:217
 TGSplitFrame.cxx:218
 TGSplitFrame.cxx:219
 TGSplitFrame.cxx:220
 TGSplitFrame.cxx:221
 TGSplitFrame.cxx:222
 TGSplitFrame.cxx:223
 TGSplitFrame.cxx:224
 TGSplitFrame.cxx:225
 TGSplitFrame.cxx:226
 TGSplitFrame.cxx:227
 TGSplitFrame.cxx:228
 TGSplitFrame.cxx:229
 TGSplitFrame.cxx:230
 TGSplitFrame.cxx:231
 TGSplitFrame.cxx:232
 TGSplitFrame.cxx:233
 TGSplitFrame.cxx:234
 TGSplitFrame.cxx:235
 TGSplitFrame.cxx:236
 TGSplitFrame.cxx:237
 TGSplitFrame.cxx:238
 TGSplitFrame.cxx:239
 TGSplitFrame.cxx:240
 TGSplitFrame.cxx:241
 TGSplitFrame.cxx:242
 TGSplitFrame.cxx:243
 TGSplitFrame.cxx:244
 TGSplitFrame.cxx:245
 TGSplitFrame.cxx:246
 TGSplitFrame.cxx:247
 TGSplitFrame.cxx:248
 TGSplitFrame.cxx:249
 TGSplitFrame.cxx:250
 TGSplitFrame.cxx:251
 TGSplitFrame.cxx:252
 TGSplitFrame.cxx:253
 TGSplitFrame.cxx:254
 TGSplitFrame.cxx:255
 TGSplitFrame.cxx:256
 TGSplitFrame.cxx:257
 TGSplitFrame.cxx:258
 TGSplitFrame.cxx:259
 TGSplitFrame.cxx:260
 TGSplitFrame.cxx:261
 TGSplitFrame.cxx:262
 TGSplitFrame.cxx:263
 TGSplitFrame.cxx:264
 TGSplitFrame.cxx:265
 TGSplitFrame.cxx:266
 TGSplitFrame.cxx:267
 TGSplitFrame.cxx:268
 TGSplitFrame.cxx:269
 TGSplitFrame.cxx:270
 TGSplitFrame.cxx:271
 TGSplitFrame.cxx:272
 TGSplitFrame.cxx:273
 TGSplitFrame.cxx:274
 TGSplitFrame.cxx:275
 TGSplitFrame.cxx:276
 TGSplitFrame.cxx:277
 TGSplitFrame.cxx:278
 TGSplitFrame.cxx:279
 TGSplitFrame.cxx:280
 TGSplitFrame.cxx:281
 TGSplitFrame.cxx:282
 TGSplitFrame.cxx:283
 TGSplitFrame.cxx:284
 TGSplitFrame.cxx:285
 TGSplitFrame.cxx:286
 TGSplitFrame.cxx:287
 TGSplitFrame.cxx:288
 TGSplitFrame.cxx:289
 TGSplitFrame.cxx:290
 TGSplitFrame.cxx:291
 TGSplitFrame.cxx:292
 TGSplitFrame.cxx:293
 TGSplitFrame.cxx:294
 TGSplitFrame.cxx:295
 TGSplitFrame.cxx:296
 TGSplitFrame.cxx:297
 TGSplitFrame.cxx:298
 TGSplitFrame.cxx:299
 TGSplitFrame.cxx:300
 TGSplitFrame.cxx:301
 TGSplitFrame.cxx:302
 TGSplitFrame.cxx:303
 TGSplitFrame.cxx:304
 TGSplitFrame.cxx:305
 TGSplitFrame.cxx:306
 TGSplitFrame.cxx:307
 TGSplitFrame.cxx:308
 TGSplitFrame.cxx:309
 TGSplitFrame.cxx:310
 TGSplitFrame.cxx:311
 TGSplitFrame.cxx:312
 TGSplitFrame.cxx:313
 TGSplitFrame.cxx:314
 TGSplitFrame.cxx:315
 TGSplitFrame.cxx:316
 TGSplitFrame.cxx:317
 TGSplitFrame.cxx:318
 TGSplitFrame.cxx:319
 TGSplitFrame.cxx:320
 TGSplitFrame.cxx:321
 TGSplitFrame.cxx:322
 TGSplitFrame.cxx:323
 TGSplitFrame.cxx:324
 TGSplitFrame.cxx:325
 TGSplitFrame.cxx:326
 TGSplitFrame.cxx:327
 TGSplitFrame.cxx:328
 TGSplitFrame.cxx:329
 TGSplitFrame.cxx:330
 TGSplitFrame.cxx:331
 TGSplitFrame.cxx:332
 TGSplitFrame.cxx:333
 TGSplitFrame.cxx:334
 TGSplitFrame.cxx:335
 TGSplitFrame.cxx:336
 TGSplitFrame.cxx:337
 TGSplitFrame.cxx:338
 TGSplitFrame.cxx:339
 TGSplitFrame.cxx:340
 TGSplitFrame.cxx:341
 TGSplitFrame.cxx:342
 TGSplitFrame.cxx:343
 TGSplitFrame.cxx:344
 TGSplitFrame.cxx:345
 TGSplitFrame.cxx:346
 TGSplitFrame.cxx:347
 TGSplitFrame.cxx:348
 TGSplitFrame.cxx:349
 TGSplitFrame.cxx:350
 TGSplitFrame.cxx:351
 TGSplitFrame.cxx:352
 TGSplitFrame.cxx:353
 TGSplitFrame.cxx:354
 TGSplitFrame.cxx:355
 TGSplitFrame.cxx:356
 TGSplitFrame.cxx:357
 TGSplitFrame.cxx:358
 TGSplitFrame.cxx:359
 TGSplitFrame.cxx:360
 TGSplitFrame.cxx:361
 TGSplitFrame.cxx:362
 TGSplitFrame.cxx:363
 TGSplitFrame.cxx:364
 TGSplitFrame.cxx:365
 TGSplitFrame.cxx:366
 TGSplitFrame.cxx:367
 TGSplitFrame.cxx:368
 TGSplitFrame.cxx:369
 TGSplitFrame.cxx:370
 TGSplitFrame.cxx:371
 TGSplitFrame.cxx:372
 TGSplitFrame.cxx:373
 TGSplitFrame.cxx:374
 TGSplitFrame.cxx:375
 TGSplitFrame.cxx:376
 TGSplitFrame.cxx:377
 TGSplitFrame.cxx:378
 TGSplitFrame.cxx:379
 TGSplitFrame.cxx:380
 TGSplitFrame.cxx:381
 TGSplitFrame.cxx:382
 TGSplitFrame.cxx:383
 TGSplitFrame.cxx:384
 TGSplitFrame.cxx:385
 TGSplitFrame.cxx:386
 TGSplitFrame.cxx:387
 TGSplitFrame.cxx:388
 TGSplitFrame.cxx:389
 TGSplitFrame.cxx:390
 TGSplitFrame.cxx:391
 TGSplitFrame.cxx:392
 TGSplitFrame.cxx:393
 TGSplitFrame.cxx:394
 TGSplitFrame.cxx:395
 TGSplitFrame.cxx:396
 TGSplitFrame.cxx:397
 TGSplitFrame.cxx:398
 TGSplitFrame.cxx:399
 TGSplitFrame.cxx:400
 TGSplitFrame.cxx:401
 TGSplitFrame.cxx:402
 TGSplitFrame.cxx:403
 TGSplitFrame.cxx:404
 TGSplitFrame.cxx:405
 TGSplitFrame.cxx:406
 TGSplitFrame.cxx:407
 TGSplitFrame.cxx:408
 TGSplitFrame.cxx:409
 TGSplitFrame.cxx:410
 TGSplitFrame.cxx:411
 TGSplitFrame.cxx:412
 TGSplitFrame.cxx:413
 TGSplitFrame.cxx:414
 TGSplitFrame.cxx:415
 TGSplitFrame.cxx:416
 TGSplitFrame.cxx:417
 TGSplitFrame.cxx:418
 TGSplitFrame.cxx:419
 TGSplitFrame.cxx:420
 TGSplitFrame.cxx:421
 TGSplitFrame.cxx:422
 TGSplitFrame.cxx:423
 TGSplitFrame.cxx:424
 TGSplitFrame.cxx:425
 TGSplitFrame.cxx:426
 TGSplitFrame.cxx:427
 TGSplitFrame.cxx:428
 TGSplitFrame.cxx:429
 TGSplitFrame.cxx:430
 TGSplitFrame.cxx:431
 TGSplitFrame.cxx:432
 TGSplitFrame.cxx:433
 TGSplitFrame.cxx:434
 TGSplitFrame.cxx:435
 TGSplitFrame.cxx:436
 TGSplitFrame.cxx:437
 TGSplitFrame.cxx:438
 TGSplitFrame.cxx:439
 TGSplitFrame.cxx:440
 TGSplitFrame.cxx:441
 TGSplitFrame.cxx:442
 TGSplitFrame.cxx:443
 TGSplitFrame.cxx:444
 TGSplitFrame.cxx:445
 TGSplitFrame.cxx:446
 TGSplitFrame.cxx:447
 TGSplitFrame.cxx:448
 TGSplitFrame.cxx:449
 TGSplitFrame.cxx:450
 TGSplitFrame.cxx:451
 TGSplitFrame.cxx:452
 TGSplitFrame.cxx:453
 TGSplitFrame.cxx:454
 TGSplitFrame.cxx:455
 TGSplitFrame.cxx:456
 TGSplitFrame.cxx:457
 TGSplitFrame.cxx:458
 TGSplitFrame.cxx:459
 TGSplitFrame.cxx:460
 TGSplitFrame.cxx:461
 TGSplitFrame.cxx:462
 TGSplitFrame.cxx:463
 TGSplitFrame.cxx:464
 TGSplitFrame.cxx:465
 TGSplitFrame.cxx:466
 TGSplitFrame.cxx:467
 TGSplitFrame.cxx:468
 TGSplitFrame.cxx:469
 TGSplitFrame.cxx:470
 TGSplitFrame.cxx:471
 TGSplitFrame.cxx:472
 TGSplitFrame.cxx:473
 TGSplitFrame.cxx:474
 TGSplitFrame.cxx:475
 TGSplitFrame.cxx:476
 TGSplitFrame.cxx:477
 TGSplitFrame.cxx:478
 TGSplitFrame.cxx:479
 TGSplitFrame.cxx:480
 TGSplitFrame.cxx:481
 TGSplitFrame.cxx:482
 TGSplitFrame.cxx:483
 TGSplitFrame.cxx:484
 TGSplitFrame.cxx:485
 TGSplitFrame.cxx:486
 TGSplitFrame.cxx:487
 TGSplitFrame.cxx:488
 TGSplitFrame.cxx:489
 TGSplitFrame.cxx:490
 TGSplitFrame.cxx:491
 TGSplitFrame.cxx:492
 TGSplitFrame.cxx:493
 TGSplitFrame.cxx:494
 TGSplitFrame.cxx:495
 TGSplitFrame.cxx:496
 TGSplitFrame.cxx:497
 TGSplitFrame.cxx:498
 TGSplitFrame.cxx:499
 TGSplitFrame.cxx:500
 TGSplitFrame.cxx:501
 TGSplitFrame.cxx:502
 TGSplitFrame.cxx:503
 TGSplitFrame.cxx:504
 TGSplitFrame.cxx:505
 TGSplitFrame.cxx:506
 TGSplitFrame.cxx:507
 TGSplitFrame.cxx:508
 TGSplitFrame.cxx:509
 TGSplitFrame.cxx:510
 TGSplitFrame.cxx:511
 TGSplitFrame.cxx:512
 TGSplitFrame.cxx:513
 TGSplitFrame.cxx:514
 TGSplitFrame.cxx:515
 TGSplitFrame.cxx:516
 TGSplitFrame.cxx:517
 TGSplitFrame.cxx:518
 TGSplitFrame.cxx:519
 TGSplitFrame.cxx:520
 TGSplitFrame.cxx:521
 TGSplitFrame.cxx:522
 TGSplitFrame.cxx:523
 TGSplitFrame.cxx:524
 TGSplitFrame.cxx:525
 TGSplitFrame.cxx:526
 TGSplitFrame.cxx:527
 TGSplitFrame.cxx:528
 TGSplitFrame.cxx:529
 TGSplitFrame.cxx:530
 TGSplitFrame.cxx:531
 TGSplitFrame.cxx:532
 TGSplitFrame.cxx:533
 TGSplitFrame.cxx:534
 TGSplitFrame.cxx:535
 TGSplitFrame.cxx:536
 TGSplitFrame.cxx:537
 TGSplitFrame.cxx:538
 TGSplitFrame.cxx:539
 TGSplitFrame.cxx:540
 TGSplitFrame.cxx:541
 TGSplitFrame.cxx:542
 TGSplitFrame.cxx:543
 TGSplitFrame.cxx:544
 TGSplitFrame.cxx:545
 TGSplitFrame.cxx:546
 TGSplitFrame.cxx:547
 TGSplitFrame.cxx:548
 TGSplitFrame.cxx:549
 TGSplitFrame.cxx:550
 TGSplitFrame.cxx:551
 TGSplitFrame.cxx:552
 TGSplitFrame.cxx:553
 TGSplitFrame.cxx:554
 TGSplitFrame.cxx:555
 TGSplitFrame.cxx:556
 TGSplitFrame.cxx:557
 TGSplitFrame.cxx:558
 TGSplitFrame.cxx:559
 TGSplitFrame.cxx:560
 TGSplitFrame.cxx:561
 TGSplitFrame.cxx:562
 TGSplitFrame.cxx:563
 TGSplitFrame.cxx:564
 TGSplitFrame.cxx:565
 TGSplitFrame.cxx:566
 TGSplitFrame.cxx:567
 TGSplitFrame.cxx:568
 TGSplitFrame.cxx:569
 TGSplitFrame.cxx:570
 TGSplitFrame.cxx:571
 TGSplitFrame.cxx:572
 TGSplitFrame.cxx:573
 TGSplitFrame.cxx:574
 TGSplitFrame.cxx:575
 TGSplitFrame.cxx:576
 TGSplitFrame.cxx:577
 TGSplitFrame.cxx:578
 TGSplitFrame.cxx:579
 TGSplitFrame.cxx:580
 TGSplitFrame.cxx:581
 TGSplitFrame.cxx:582
 TGSplitFrame.cxx:583
 TGSplitFrame.cxx:584
 TGSplitFrame.cxx:585
 TGSplitFrame.cxx:586
 TGSplitFrame.cxx:587
 TGSplitFrame.cxx:588
 TGSplitFrame.cxx:589
 TGSplitFrame.cxx:590
 TGSplitFrame.cxx:591
 TGSplitFrame.cxx:592
 TGSplitFrame.cxx:593
 TGSplitFrame.cxx:594
 TGSplitFrame.cxx:595
 TGSplitFrame.cxx:596
 TGSplitFrame.cxx:597
 TGSplitFrame.cxx:598
 TGSplitFrame.cxx:599
 TGSplitFrame.cxx:600
 TGSplitFrame.cxx:601
 TGSplitFrame.cxx:602
 TGSplitFrame.cxx:603
 TGSplitFrame.cxx:604
 TGSplitFrame.cxx:605
 TGSplitFrame.cxx:606
 TGSplitFrame.cxx:607
 TGSplitFrame.cxx:608
 TGSplitFrame.cxx:609
 TGSplitFrame.cxx:610
 TGSplitFrame.cxx:611
 TGSplitFrame.cxx:612
 TGSplitFrame.cxx:613
 TGSplitFrame.cxx:614
 TGSplitFrame.cxx:615
 TGSplitFrame.cxx:616
 TGSplitFrame.cxx:617
 TGSplitFrame.cxx:618
 TGSplitFrame.cxx:619
 TGSplitFrame.cxx:620
 TGSplitFrame.cxx:621
 TGSplitFrame.cxx:622
 TGSplitFrame.cxx:623
 TGSplitFrame.cxx:624
 TGSplitFrame.cxx:625
 TGSplitFrame.cxx:626
 TGSplitFrame.cxx:627
 TGSplitFrame.cxx:628
 TGSplitFrame.cxx:629
 TGSplitFrame.cxx:630
 TGSplitFrame.cxx:631
 TGSplitFrame.cxx:632
 TGSplitFrame.cxx:633
 TGSplitFrame.cxx:634
 TGSplitFrame.cxx:635
 TGSplitFrame.cxx:636
 TGSplitFrame.cxx:637
 TGSplitFrame.cxx:638
 TGSplitFrame.cxx:639
 TGSplitFrame.cxx:640
 TGSplitFrame.cxx:641
 TGSplitFrame.cxx:642
 TGSplitFrame.cxx:643
 TGSplitFrame.cxx:644
 TGSplitFrame.cxx:645
 TGSplitFrame.cxx:646
 TGSplitFrame.cxx:647
 TGSplitFrame.cxx:648
 TGSplitFrame.cxx:649
 TGSplitFrame.cxx:650
 TGSplitFrame.cxx:651
 TGSplitFrame.cxx:652
 TGSplitFrame.cxx:653
 TGSplitFrame.cxx:654
 TGSplitFrame.cxx:655
 TGSplitFrame.cxx:656
 TGSplitFrame.cxx:657
 TGSplitFrame.cxx:658
 TGSplitFrame.cxx:659
 TGSplitFrame.cxx:660
 TGSplitFrame.cxx:661
 TGSplitFrame.cxx:662
 TGSplitFrame.cxx:663
 TGSplitFrame.cxx:664
 TGSplitFrame.cxx:665
 TGSplitFrame.cxx:666
 TGSplitFrame.cxx:667
 TGSplitFrame.cxx:668
 TGSplitFrame.cxx:669
 TGSplitFrame.cxx:670
 TGSplitFrame.cxx:671
 TGSplitFrame.cxx:672
 TGSplitFrame.cxx:673
 TGSplitFrame.cxx:674
 TGSplitFrame.cxx:675
 TGSplitFrame.cxx:676
 TGSplitFrame.cxx:677
 TGSplitFrame.cxx:678
 TGSplitFrame.cxx:679
 TGSplitFrame.cxx:680
 TGSplitFrame.cxx:681
 TGSplitFrame.cxx:682
 TGSplitFrame.cxx:683
 TGSplitFrame.cxx:684
 TGSplitFrame.cxx:685
 TGSplitFrame.cxx:686
 TGSplitFrame.cxx:687
 TGSplitFrame.cxx:688
 TGSplitFrame.cxx:689
 TGSplitFrame.cxx:690
 TGSplitFrame.cxx:691
 TGSplitFrame.cxx:692
 TGSplitFrame.cxx:693
 TGSplitFrame.cxx:694
 TGSplitFrame.cxx:695
 TGSplitFrame.cxx:696
 TGSplitFrame.cxx:697
 TGSplitFrame.cxx:698
 TGSplitFrame.cxx:699
 TGSplitFrame.cxx:700
 TGSplitFrame.cxx:701
 TGSplitFrame.cxx:702
 TGSplitFrame.cxx:703
 TGSplitFrame.cxx:704
 TGSplitFrame.cxx:705
 TGSplitFrame.cxx:706
 TGSplitFrame.cxx:707
 TGSplitFrame.cxx:708
 TGSplitFrame.cxx:709
 TGSplitFrame.cxx:710
 TGSplitFrame.cxx:711
 TGSplitFrame.cxx:712
 TGSplitFrame.cxx:713
 TGSplitFrame.cxx:714
 TGSplitFrame.cxx:715
 TGSplitFrame.cxx:716
 TGSplitFrame.cxx:717
 TGSplitFrame.cxx:718
 TGSplitFrame.cxx:719
 TGSplitFrame.cxx:720
 TGSplitFrame.cxx:721
 TGSplitFrame.cxx:722
 TGSplitFrame.cxx:723
 TGSplitFrame.cxx:724
 TGSplitFrame.cxx:725
 TGSplitFrame.cxx:726
 TGSplitFrame.cxx:727
 TGSplitFrame.cxx:728
 TGSplitFrame.cxx:729
 TGSplitFrame.cxx:730
 TGSplitFrame.cxx:731
 TGSplitFrame.cxx:732
 TGSplitFrame.cxx:733
 TGSplitFrame.cxx:734
 TGSplitFrame.cxx:735
 TGSplitFrame.cxx:736
 TGSplitFrame.cxx:737
 TGSplitFrame.cxx:738
 TGSplitFrame.cxx:739
 TGSplitFrame.cxx:740
 TGSplitFrame.cxx:741
 TGSplitFrame.cxx:742
 TGSplitFrame.cxx:743
 TGSplitFrame.cxx:744
 TGSplitFrame.cxx:745
 TGSplitFrame.cxx:746
 TGSplitFrame.cxx:747
 TGSplitFrame.cxx:748
 TGSplitFrame.cxx:749
 TGSplitFrame.cxx:750
 TGSplitFrame.cxx:751
 TGSplitFrame.cxx:752
 TGSplitFrame.cxx:753
 TGSplitFrame.cxx:754
 TGSplitFrame.cxx:755
 TGSplitFrame.cxx:756
 TGSplitFrame.cxx:757
 TGSplitFrame.cxx:758
 TGSplitFrame.cxx:759
 TGSplitFrame.cxx:760
 TGSplitFrame.cxx:761
 TGSplitFrame.cxx:762
 TGSplitFrame.cxx:763
 TGSplitFrame.cxx:764
 TGSplitFrame.cxx:765
 TGSplitFrame.cxx:766
 TGSplitFrame.cxx:767
 TGSplitFrame.cxx:768
 TGSplitFrame.cxx:769
 TGSplitFrame.cxx:770
 TGSplitFrame.cxx:771
 TGSplitFrame.cxx:772
 TGSplitFrame.cxx:773
 TGSplitFrame.cxx:774
 TGSplitFrame.cxx:775