Logo ROOT   6.16/01
Reference Guide
TSessionLogView.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Bertrand Bellenot, Gerri Ganis 15/09/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TSessionLogView.h"
13#include "TSessionViewer.h"
14#include "TProof.h"
15#include "KeySymbols.h"
16
17//_____________________________________________________________________________
18//
19// TSessionLogView
20//
21// Dialog used to display session logs from the session viewer
22//_____________________________________________________________________________
23
25
26////////////////////////////////////////////////////////////////////////////////
27/// Create an editor in a dialog.
28
30 TGTransientFrame(gClient->GetRoot(), viewer, w, h)
31{
32 fViewer = viewer;
36
37 fClose = new TGTextButton(this, " &Close ");
38 fL2 = new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 0, 0, 5, 5);
40
41 SetTitle();
42 fViewer->SetLogWindow(this);
43
45
47}
48
49////////////////////////////////////////////////////////////////////////////////
50
52{
53}
54
55////////////////////////////////////////////////////////////////////////////////
56/// Set title in editor window.
57
59{
60 TString title;
61 title.Form("PROOF Processing Logs: %s", (fViewer->GetActDesc()->fProof ?
62 fViewer->GetActDesc()->fProof->GetMaster() : "<dummy>"));
63 SetWindowName(title);
64 SetIconName(title);
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Show editor.
69
71{
72 MapWindow();
73}
74
75////////////////////////////////////////////////////////////////////////////////
76/// Load a text buffer in the editor.
77
78void TSessionLogView::AddBuffer(const char *buffer)
79{
80 TGText txt;
81 txt.LoadBuffer(buffer);
82 fTextView->AddText(&txt);
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Clear log window.
88
90{
92}
93
94////////////////////////////////////////////////////////////////////////////////
95/// Load a text buffer in the editor.
96
97void TSessionLogView::LoadBuffer(const char *buffer)
98{
99 fTextView->LoadBuffer(buffer);
101}
102
103////////////////////////////////////////////////////////////////////////////////
104/// Load a file in the editor.
105
107{
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Called when closed via window manager action.
114
116{
117 if (fViewer->GetActDesc()->fProof) {
119 "LogMessage(const char*,Bool_t)", fViewer,
120 "LogMessage(const char*,Bool_t)");
121 }
123 delete fTextView;
124 delete fClose;
125 delete fL1;
126 delete fL2;
128}
129
130////////////////////////////////////////////////////////////////////////////////
131/// Process OK button.
132
134{
135 switch (GET_MSG(msg)) {
136 case kC_COMMAND:
137 switch (GET_SUBMSG(msg)) {
138 case kCM_BUTTON:
139 // Only one button and one action...
140 CloseWindow();
141 break;
142 default:
143 break;
144 }
145 break;
146 default:
147 break;
148 }
149 return kTRUE;
150}
151
#define h(i)
Definition: RSha256.hxx:106
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
#define gClient
Definition: TGClient.h:166
@ kSunkenFrame
Definition: TGFrame.h:61
@ kDoubleBorder
Definition: TGFrame.h:63
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsCenterX
Definition: TGLayout.h:32
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsExpandX
Definition: TGLayout.h:37
Int_t GET_MSG(Long_t val)
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:375
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual void MapWindow()
Definition: TGFrame.h:251
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1759
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:452
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
Definition: TGTextView.cxx:469
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:428
virtual void ShowBottom()
Show bottom of the page.
virtual void AddText(TGText *text)
Add text to the view widget.
Definition: TGTextView.cxx:206
Definition: TGText.h:67
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
Definition: TGText.cxx:512
virtual void DestroyWindow()
Definition: TGWindow.h:92
const char * GetMaster() const
Definition: TProof.h:903
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1025
TGLayoutHints * fL1
TSessionLogView(TSessionViewer *viewer, UInt_t w, UInt_t h)
Create an editor in a dialog.
void LoadFile(const char *file)
Load a file in the editor.
TGTextButton * fClose
void LoadBuffer(const char *buffer)
Load a text buffer in the editor.
TSessionViewer * fViewer
void AddBuffer(const char *buffer)
Load a text buffer in the editor.
virtual ~TSessionLogView()
TGTextView * fTextView
TGLayoutHints * fL2
void Popup()
Show editor.
void SetTitle()
Set title in editor window.
void CloseWindow()
Called when closed via window manager action.
void ClearLogView()
Clear log window.
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process OK button.
void SetLogWindow(TSessionLogView *log)
TSessionDescription * GetActDesc() const
Basic string class.
Definition: TString.h:131
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2264
Definition: file.py:1