#include "TSessionLogView.h"
#include "TSessionViewer.h"
#include "TProof.h"
#include "KeySymbols.h"
ClassImp(TSessionLogView)
TSessionLogView::TSessionLogView(TSessionViewer *viewer, UInt_t w, UInt_t h) :
   TGTransientFrame(gClient->GetRoot(), viewer, w, h)
{
   
   fViewer = viewer;
   fTextView = new TGTextView(this, w, h, kSunkenFrame | kDoubleBorder);
   fL1 = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 3, 3, 3, 3);
   AddFrame(fTextView, fL1);
   fClose = new TGTextButton(this, "  &Close  ");
   fL2 = new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 0, 0, 5, 5);
   AddFrame(fClose, fL2);
   SetTitle();
   fViewer->SetLogWindow(this);
   MapSubwindows();
   Resize(GetDefaultSize());
}
TSessionLogView::~TSessionLogView()
{
}
void TSessionLogView::SetTitle()
{
   
   char title[256] = {0};
   strcpy(title,Form("PROOF Processing Logs: %s",
         (fViewer->GetActDesc()->fProof ?
          fViewer->GetActDesc()->fProof->GetMaster() : "<dummy>")));
   SetWindowName(title);
   SetIconName(title);
}
void TSessionLogView::Popup()
{
   
   MapWindow();
}
void TSessionLogView::AddBuffer(const char *buffer)
{
   
   TGText txt;
   txt.LoadBuffer(buffer);
   fTextView->AddText(&txt);
   fTextView->ShowBottom();
}
void TSessionLogView::ClearLogView()
{
   
   fTextView->Clear();
}
void TSessionLogView::LoadBuffer(const char *buffer)
{
   
   fTextView->LoadBuffer(buffer);
   fTextView->ShowBottom();
}
void TSessionLogView::LoadFile(const char *file)
{
   
   fTextView->LoadFile(file);
   fTextView->ShowBottom();
}
void TSessionLogView::CloseWindow()
{
   
   if (fViewer->GetActDesc()->fProof) {
      fViewer->GetActDesc()->fProof->Disconnect(
            "LogMessage(const char*,Bool_t)", fViewer,
            "LogMessage(const char*,Bool_t)");
   }
   fViewer->SetLogWindow(0);
   delete fTextView;
   delete fClose;
   delete fL1;
   delete fL2;
   DestroyWindow();
}
Bool_t TSessionLogView::ProcessMessage(Long_t msg, Long_t, Long_t)
{
   
   switch (GET_MSG(msg)) {
      case kC_COMMAND:
         switch (GET_SUBMSG(msg)) {
            case kCM_BUTTON:
               
               CloseWindow();
               break;
            default:
               break;
         }
         break;
      default:
         break;
   }
   return kTRUE;
}
Last change: Wed Jun 25 08:52:55 2008
Last generated: 2008-06-25 08:52
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.