Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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/** \class TSessionLogView
19 \ingroup sessionviewer
20
21Dialog used to display session logs from the session viewer
22
23*/
24
25
27
28////////////////////////////////////////////////////////////////////////////////
29/// Create an editor in a dialog.
30
32 TGTransientFrame(gClient->GetRoot(), viewer, w, h)
33{
34 fViewer = viewer;
38
39 fClose = new TGTextButton(this, " &Close ");
40 fL2 = new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 0, 0, 5, 5);
42
43 SetTitle();
44 fViewer->SetLogWindow(this);
45
47
49}
50
51////////////////////////////////////////////////////////////////////////////////
52
54{
55}
56
57////////////////////////////////////////////////////////////////////////////////
58/// Set title in editor window.
59
61{
62 TString title;
63 title.Form("PROOF Processing Logs: %s", (fViewer->GetActDesc()->fProof ?
64 fViewer->GetActDesc()->fProof->GetMaster() : "<dummy>"));
65 SetWindowName(title);
66 SetIconName(title);
67}
68
69////////////////////////////////////////////////////////////////////////////////
70/// Show editor.
71
73{
74 MapWindow();
75}
76
77////////////////////////////////////////////////////////////////////////////////
78/// Load a text buffer in the editor.
79
80void TSessionLogView::AddBuffer(const char *buffer)
81{
82 TGText txt;
83 txt.LoadBuffer(buffer);
84 fTextView->AddText(&txt);
86}
87
88////////////////////////////////////////////////////////////////////////////////
89/// Clear log window.
90
92{
94}
95
96////////////////////////////////////////////////////////////////////////////////
97/// Load a text buffer in the editor.
98
99void TSessionLogView::LoadBuffer(const char *buffer)
100{
101 fTextView->LoadBuffer(buffer);
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Load a file in the editor.
107
108void TSessionLogView::LoadFile(const char *file)
109{
110 fTextView->LoadFile(file);
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Called when closed via window manager action.
116
118{
119 if (fViewer->GetActDesc()->fProof) {
121 "LogMessage(const char*,Bool_t)", fViewer,
122 "LogMessage(const char*,Bool_t)");
123 }
125 delete fTextView;
126 delete fClose;
127 delete fL1;
128 delete fL2;
130}
131
132////////////////////////////////////////////////////////////////////////////////
133/// Process OK button.
134
136{
137 switch (GET_MSG(msg)) {
138 case kC_COMMAND:
139 switch (GET_SUBMSG(msg)) {
140 case kCM_BUTTON:
141 // Only one button and one action...
142 CloseWindow();
143 break;
144 default:
145 break;
146 }
147 break;
148 default:
149 break;
150 }
151 return kTRUE;
152}
153
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
#define h(i)
Definition RSha256.hxx:106
long Longptr_t
Definition RtypesCore.h:75
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
#define gClient
Definition TGClient.h:156
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsExpandX
Definition TGLayout.h:30
Int_t GET_MSG(Long_t val)
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void MapWindow() override
map window
Definition TGFrame.h:204
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition TGFrame.cxx:1801
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextView is a text viewer widget.
Definition TGTextView.h:22
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
virtual void ShowBottom()
Show bottom of the page.
virtual void AddText(TGText *text)
Add text to the view widget.
void Clear(Option_t *="") override
Clear text view widget.
A TGText is a multi line text buffer.
Definition TGText.h:57
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
Definition TGText.cxx:513
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:498
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:192
const char * GetMaster() const
Definition TProof.h:903
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
Dialog used to display session logs from the session viewer.
~TSessionLogView() override
TGLayoutHints * fL1
TSessionLogView(TSessionViewer *viewer, UInt_t w, UInt_t h)
Create an editor in a dialog.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process OK button.
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.
TGTextView * fTextView
TGLayoutHints * fL2
void Popup()
Show editor.
void SetTitle()
Set title in editor window.
void CloseWindow() override
Called when closed via window manager action.
void ClearLogView()
Clear log window.
Widget used to manage PROOF or local sessions, PROOF connections, queries construction and results ha...
void SetLogWindow(TSessionLogView *log)
TSessionDescription * GetActDesc() const
Basic string class.
Definition TString.h:139
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2356