Logo ROOT  
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
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kDoubleBorder
Definition: GuiTypes.h:385
#define h(i)
Definition: RSha256.hxx:106
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
#define gClient
Definition: TGClient.h:166
@ 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:1101
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void MapWindow()
map window
Definition: TGFrame.h:229
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1761
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:453
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
Definition: TGTextView.cxx:470
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:429
virtual void ShowBottom()
Show bottom of the page.
virtual void AddText(TGText *text)
Add text to the view widget.
Definition: TGTextView.cxx:207
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()
destroy window
Definition: TGWindow.cxx:182
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:1024
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:2289
Definition: file.py:1