Logo ROOT  
Reference Guide
TRootEmbeddedCanvas.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 15/07/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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//////////////////////////////////////////////////////////////////////////
13// //
14// TRootEmbeddedCanvas //
15// //
16// This class creates a TGCanvas in which a TCanvas is created. Use //
17// GetCanvas() to get a pointer to the TCanvas. //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "TRootEmbeddedCanvas.h"
22#include "TCanvas.h"
23#include "TROOT.h"
24#include "Riostream.h"
25#include "TStyle.h"
26#include "TPluginManager.h"
27#include "TVirtualGL.h"
28#include "TGDNDManager.h"
29#include "TBufferFile.h"
30#include "TImage.h"
31#include "TClass.h"
32#include "TUrl.h"
33#include "TVirtualX.h"
34
35//////////////////////////////////////////////////////////////////////////
36// //
37// TRootEmbeddedContainer //
38// //
39// Utility class used by TRootEmbeddedCanvas. The TRootEmbeddedContainer//
40// is the frame embedded in the TGCanvas widget. The ROOT graphics goes //
41// into this frame. This class is used to enable input events on this //
42// graphics frame and forward the events to the TRootEmbeddedCanvas //
43// handlers. //
44// //
45//////////////////////////////////////////////////////////////////////////
46
47class TRootEmbeddedContainer : public TGCompositeFrame {
48private:
49 TRootEmbeddedCanvas *fCanvas; // pointer back to embedded canvas
50public:
51 TRootEmbeddedContainer(TRootEmbeddedCanvas *c, Window_t id, const TGWindow *parent);
52
54 { return fCanvas->HandleContainerButton(ev); }
56 { return fCanvas->HandleContainerDoubleClick(ev); }
59 return fCanvas->HandleContainerConfigure(ev); }
61 { return fCanvas->HandleContainerKey(ev); }
63 { return fCanvas->HandleContainerMotion(ev); }
65 { return fCanvas->HandleContainerExpose(ev); }
67 { return fCanvas->HandleContainerCrossing(ev); }
68 void SetEditable(Bool_t) { }
69};
70
71////////////////////////////////////////////////////////////////////////////////
72/// Create a canvas container.
73
74TRootEmbeddedContainer::TRootEmbeddedContainer(TRootEmbeddedCanvas *c, Window_t id,
75 const TGWindow *p) : TGCompositeFrame(gClient, id, p)
76{
77 fCanvas = c;
78
79 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
82
85
86 fEditDisabled = kEditDisableGrab;
87}
88
89
90
91
93
94////////////////////////////////////////////////////////////////////////////////
95/// Create an TCanvas embedded in a TGFrame. A pointer to the TCanvas can
96/// be obtained via the GetCanvas() member function. To embed a canvas
97/// derived from a TCanvas do the following:
98/// TRootEmbeddedCanvas *embedded = new TRootEmbeddedCanvas(0, p, w, h);
99/// [note name must be 0, not null string ""]
100/// Int_t wid = embedded->GetCanvasWindowId();
101/// TMyCanvas *myc = new TMyCanvas("myname", 10, 10, wid);
102/// embedded->AdoptCanvas(myc);
103/// [ the MyCanvas is adopted by the embedded canvas and will be
104/// destroyed by it ]
105
107 UInt_t w, UInt_t h, UInt_t options, ULong_t back)
108 : TGCanvas(p, w, h, options, back)
109{
110 fCanvas = 0;
111 fButton = 0;
112 fAutoFit = kTRUE;
114
115 fCWinId = -1;
116
117 if (gStyle->GetCanvasPreferGL()) {
118 //first, initialize GL (if not yet)
119 if (!gGLManager) {
120 TString x = "win32";
121 if (gVirtualX->InheritsFrom("TGX11"))
122 x = "x11";
123 else if (gVirtualX->InheritsFrom("TGCocoa"))
124 x = "osx";
125
126 TPluginHandler *ph = gROOT->GetPluginManager()->FindHandler("TGLManager", x);
127
128 if (ph && ph->LoadPlugin() != -1) {
129 if (!ph->ExecPlugin(0)) {
130 Warning("CreateCanvas",
131 "Cannot load GL, will use default canvas imp instead\n");
132 }
133 }
134 }
135
136 if (gGLManager)
137 fCWinId = gGLManager->InitGLWindow((ULong_t)GetViewPort()->GetId());
138 //Context creation deferred till TCanvas creation (since there is no way to pass it to TCanvas).
139
140 if (!gGLManager || fCWinId == -1)
141 gStyle->SetCanvasPreferGL(kFALSE);//TCanvas should not use gl.
142 }
143 if (fCWinId == -1)
144 fCWinId = gVirtualX->InitWindow((ULong_t)GetViewPort()->GetId());
145
146 Window_t win = gVirtualX->GetWindowID(fCWinId);
149
150 TString cname;
151 if (name) cname = name;
152 else cname = TString::Format("%s_canvas", GetName());
153 fCanvas = new TCanvas(cname.Data(), w, h, fCWinId);
154
155 // define DND types
156 fDNDTypeList = new Atom_t[3];
157 fDNDTypeList[0] = gVirtualX->InternAtom("application/root", kFALSE);
158 fDNDTypeList[1] = gVirtualX->InternAtom("text/uri-list", kFALSE);
159 fDNDTypeList[2] = 0;
160 gVirtualX->SetDNDAware(fId, fDNDTypeList);
162
163 if (!p) {
166 Resize(100, 100);
167 }
168}
169
170////////////////////////////////////////////////////////////////////////////////
171/// Delete embedded ROOT canvas.
172
174{
175 if (!MustCleanup()) {
176 delete fCanvas;
177 delete fCanvasContainer;
178 }
179 delete [] fDNDTypeList;
180}
181
182////////////////////////////////////////////////////////////////////////////////
183/// Canvas c is adopted from this embedded canvas.
184
186{
187 if(c == 0) return;
188 c->EmbedInto(fCWinId, fWidth, fHeight);
189 fCanvas = c;
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// Handle mouse button events in the canvas container.
194
196{
197 if (!fCanvas) return kTRUE;
198
199 Int_t button = event->fCode;
200 Int_t x = event->fX;
201 Int_t y = event->fY;
202
203 if (event->fType == kButtonPress) {
204 fButton = button;
205 if (button == kButton1) {
206 if (event->fState & kKeyShiftMask)
208 else
210 }
211 if (button == kButton2)
213 if (button == kButton3) {
215 fButton = 0; // button up is consumed by TContextMenu
216 }
217
218 } else if (event->fType == kButtonRelease) {
219 if (button == kButton1)
221 if (button == kButton2)
223 if (button == kButton3)
225 if (button == kButton4)
226 fCanvas->HandleInput(EEventType(5), x, y);//hack
227 if (button == kButton5)
228 fCanvas->HandleInput(EEventType(6), x, y);//hack
229
230 fButton = 0;
231 }
232
233 return kTRUE;
234}
235
236////////////////////////////////////////////////////////////////////////////////
237/// Handle mouse button double click events in the canvas container.
238
240{
241 if (!fCanvas) return kTRUE;
242
243 Int_t button = event->fCode;
244 Int_t x = event->fX;
245 Int_t y = event->fY;
246
247 if (button == kButton1)
249 if (button == kButton2)
251 if (button == kButton3)
253
254 return kTRUE;
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// Handle configure (i.e. resize) event.
259
261{
262 if (fAutoFit && fCanvas) {
263 fCanvas->Resize();
264 fCanvas->Update();
265 }
266 return kTRUE;
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// Handle keyboard events in the canvas container.
271
273{
274 static EGEventType previous_event = kOtherEvent;
275 static UInt_t previous_keysym = 0;
276
277 if (!fCanvas) return kTRUE;
278
279 if (event->fType == kGKeyPress) {
280 fButton = event->fCode;
281 UInt_t keysym;
282 char str[2];
283 gVirtualX->LookupString(event, str, sizeof(str), keysym);
284
285 if (str[0] == kESC){ // ESC sets the escape flag
286 gROOT->SetEscape();
289 gPad->Modified();
290 return kTRUE;
291 }
292 if (str[0] == 3) // ctrl-c sets the interrupt flag
293 gROOT->SetInterrupt();
294
295 // handle arrow keys
296 if (keysym > 0x1011 && keysym < 0x1016) {
297 Window_t dum1, dum2, wid;
298 UInt_t mask = 0;
299 Int_t mx, my, tx, ty;
300 wid = gVirtualX->GetDefaultRootWindow();
301 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
302 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(),
303 fCanvasContainer->GetId(),
304 mx, my, tx, ty, dum1);
306 // handle case where we got consecutive same keypressed events coming
307 // from auto-repeat on Windows (as it fires only successive keydown events)
308 if ((previous_keysym == keysym) && (previous_event == kGKeyPress)) {
309 switch (keysym) {
310 case 0x1012: // left
311 gVirtualX->Warp(--mx, my, wid); --tx;
312 break;
313 case 0x1013: // up
314 gVirtualX->Warp(mx, --my, wid); --ty;
315 break;
316 case 0x1014: // right
317 gVirtualX->Warp(++mx, my, wid); ++tx;
318 break;
319 case 0x1015: // down
320 gVirtualX->Warp(mx, ++my, wid); ++ty;
321 break;
322 default:
323 break;
324 }
326 }
327 previous_keysym = keysym;
328 }
329 else {
330 fCanvas->HandleInput(kKeyPress, str[0], keysym);
331 }
332 } else if (event->fType == kKeyRelease) {
333 UInt_t keysym;
334 char str[2];
335 gVirtualX->LookupString(event, str, sizeof(str), keysym);
336
337 if (keysym > 0x1011 && keysym < 0x1016) {
338 Window_t dum1, dum2, wid;
339 UInt_t mask = 0;
340 Int_t mx, my, tx, ty;
341 wid = gVirtualX->GetDefaultRootWindow();
342 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
343 switch (keysym) {
344 case 0x1012: // left
345 gVirtualX->Warp(--mx, my, wid);
346 break;
347 case 0x1013: // up
348 gVirtualX->Warp(mx, --my, wid);
349 break;
350 case 0x1014: // right
351 gVirtualX->Warp(++mx, my, wid);
352 break;
353 case 0x1015: // down
354 gVirtualX->Warp(mx, ++my, wid);
355 break;
356 default:
357 break;
358 }
359 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(),
360 fCanvasContainer->GetId(),
361 mx, my, tx, ty, dum1);
363 previous_keysym = keysym;
364 }
365 fButton = 0;
366 }
367 previous_event = event->fType;
368 return kTRUE;
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Handle mouse motion event in the canvas container.
373
375{
376 if (!fCanvas) return kTRUE;
377
378 Int_t x = event->fX;
379 Int_t y = event->fY;
380
381 if (fButton == 0)
383 if (fButton == kButton1) {
384 if (event->fState & kKeyShiftMask)
386 else
388 }
389 if (fButton == kButton2)
391
392 return kTRUE;
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Handle expose events.
397
399{
400 if (!fCanvas) return kTRUE;
401
402 if (event->fCount == 0)
403 fCanvas->Flush();
404
405 return kTRUE;
406}
407
408////////////////////////////////////////////////////////////////////////////////
409/// Handle enter/leave events. Only leave is activated at the moment.
410
412{
413 if (!fCanvas) return kTRUE;
414
415 Int_t x = event->fX;
416 Int_t y = event->fY;
417
418 // pointer grabs create also an enter and leave event but with fCode
419 // either kNotifyGrab or kNotifyUngrab, don't propagate these events
420 if (event->fType == kLeaveNotify && event->fCode == kNotifyNormal)
422
423 return kTRUE;
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Handle drop events.
428
430{
431 static Atom_t rootObj = gVirtualX->InternAtom("application/root", kFALSE);
432 static Atom_t uriObj = gVirtualX->InternAtom("text/uri-list", kFALSE);
433
434 if (data->fDataType == rootObj) {
435 TBufferFile buf(TBuffer::kRead, data->fDataLength, (void *)data->fData);
436 buf.SetReadMode();
438 if (!obj) return kTRUE;
439 gPad->Clear();
440 if (obj->InheritsFrom("TKey")) {
441 TObject *object = (TObject *)gROOT->ProcessLine(Form("((TKey *)0x%lx)->ReadObj();", (ULong_t)obj));
442 if (!object) return kTRUE;
443 if (object->InheritsFrom("TGraph"))
444 object->Draw("ALP");
445 else if (object->InheritsFrom("TImage"))
446 object->Draw("x");
447 else if (object->IsA()->GetMethodAllAny("Draw"))
448 object->Draw();
449 }
450 else if (obj->InheritsFrom("TGraph"))
451 obj->Draw("ALP");
452 else if (obj->IsA()->GetMethodAllAny("Draw"))
453 obj->Draw();
454 gPad->Modified();
455 gPad->Update();
456 return kTRUE;
457 }
458 else if (data->fDataType == uriObj) {
459 TString sfname((char *)data->fData);
460 if (sfname.Length() > 7) {
461 sfname.ReplaceAll("\r\n", "");
462 TUrl uri(sfname.Data());
463 if (sfname.EndsWith(".bmp") ||
464 sfname.EndsWith(".gif") ||
465 sfname.EndsWith(".jpg") ||
466 sfname.EndsWith(".png") ||
467 sfname.EndsWith(".ps") ||
468 sfname.EndsWith(".eps") ||
469 sfname.EndsWith(".pdf") ||
470 sfname.EndsWith(".tiff") ||
471 sfname.EndsWith(".xpm")) {
472 TImage *img = TImage::Open(uri.GetFile());
473 if (img) {
474 img->Draw("x");
475 img->SetEditable(kTRUE);
476 }
477 }
478 gPad->Modified();
479 gPad->Update();
480 }
481 }
482 return kFALSE;
483}
484
485////////////////////////////////////////////////////////////////////////////////
486/// Handle dragging position events.
487
489 Int_t xroot, Int_t yroot)
490{
491 Int_t px = 0, py = 0;
492 Window_t wtarget;
493
494 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(),
495 gVirtualX->GetWindowID(fCanvas->GetCanvasID()),
496 xroot, yroot, px, py, wtarget);
497
498 TPad *pad = fCanvas->Pick(px, py, 0);
499 if (pad) {
500 pad->cd();
501 gROOT->SetSelectedPad(pad);
502 // make sure the pad is highlighted (on Windows)
503 pad->Update();
504 }
505 return action;
506}
507
508////////////////////////////////////////////////////////////////////////////////
509/// Handle drag enter events.
510
512{
513 static Atom_t rootObj = gVirtualX->InternAtom("application/root", kFALSE);
514 static Atom_t uriObj = gVirtualX->InternAtom("text/uri-list", kFALSE);
515 Atom_t ret = kNone;
516 for (int i = 0; typelist[i] != kNone; ++i) {
517 if (typelist[i] == rootObj)
518 ret = rootObj;
519 if (typelist[i] == uriObj)
520 ret = uriObj;
521 }
522 return ret;
523}
524
525////////////////////////////////////////////////////////////////////////////////
526/// Handle drag leave events.
527
529{
530 return kTRUE;
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// Save an embedded canvas as a C++ statement(s) on output stream out.
535
536void TRootEmbeddedCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
537{
538 if (!GetCanvas()) return;
539
541
542 char quote ='"';
543
544 out << std::endl << " // embedded canvas" << std::endl;
545 out << " TRootEmbeddedCanvas *";
546 out << GetName() << " = new TRootEmbeddedCanvas(0" << "," << fParent->GetName()
547 << "," << GetWidth() << "," << GetHeight();
548
551 out <<");" << std::endl;
552 } else {
553 out << "," << GetOptionString() <<");" << std::endl;
554 }
555 } else {
556 out << "," << GetOptionString() << ",ucolor);" << std::endl;
557 }
558 if (option && strstr(option, "keep_names"))
559 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
560
561 out << " Int_t w" << GetName() << " = " << GetName()
562 << "->GetCanvasWindowId();" << std::endl;
563
564 static int n = 123;
565 TString cname = TString::Format("c%d", n);
566
567 out << " TCanvas *";
568 out << cname << " = new TCanvas(";
569 out << quote << cname.Data() << quote << ", 10, 10, w"
570 << GetName() << ");" << std::endl;
571 out << " " << GetName() << "->AdoptCanvas(" << cname
572 << ");" << std::endl;
573
574 n++;
575 //Next line is a connection to TCanvas::SavePrimitives()
576 //GetCanvas()->SavePrimitive(out,option);
577}
EEventType
Definition: Buttons.h:15
@ kMouseMotion
Definition: Buttons.h:23
@ kButton3Up
Definition: Buttons.h:19
@ kButton2Motion
Definition: Buttons.h:20
@ kButton3Down
Definition: Buttons.h:17
@ kButton2Down
Definition: Buttons.h:17
@ kKeyPress
Definition: Buttons.h:20
@ kButton2Double
Definition: Buttons.h:24
@ kArrowKeyRelease
Definition: Buttons.h:21
@ kButton1Double
Definition: Buttons.h:24
@ kButton3Double
Definition: Buttons.h:24
@ kButton1Motion
Definition: Buttons.h:20
@ kButton1Up
Definition: Buttons.h:19
@ kArrowKeyPress
Definition: Buttons.h:21
@ kButton2Up
Definition: Buttons.h:19
@ kMouseLeave
Definition: Buttons.h:23
@ kButton1Down
Definition: Buttons.h:17
@ kESC
Definition: Buttons.h:22
void Class()
Definition: Class.C:29
EGEventType
Definition: GuiTypes.h:58
@ kGKeyPress
Definition: GuiTypes.h:59
@ kButtonRelease
Definition: GuiTypes.h:59
@ kButtonPress
Definition: GuiTypes.h:59
@ kOtherEvent
Definition: GuiTypes.h:63
@ kKeyRelease
Definition: GuiTypes.h:59
@ kLeaveNotify
Definition: GuiTypes.h:60
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
@ kNotifyNormal
Definition: GuiTypes.h:218
const Mask_t kExposureMask
Definition: GuiTypes.h:164
const Mask_t kKeyReleaseMask
Definition: GuiTypes.h:159
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kDoubleBorder
Definition: GuiTypes.h:385
Handle_t Atom_t
Definition: GuiTypes.h:36
const Handle_t kNone
Definition: GuiTypes.h:87
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
@ kButton4
Definition: GuiTypes.h:214
@ kButton2
Definition: GuiTypes.h:213
@ kButton5
Definition: GuiTypes.h:214
@ kButton3
Definition: GuiTypes.h:213
@ kButton1
Definition: GuiTypes.h:213
@ kAnyButton
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
#define gClient
Definition: TGClient.h:166
XFontStruct * id
Definition: TGX11.cxx:108
char name[80]
Definition: TGX11.cxx:109
#define gROOT
Definition: TROOT.h:406
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
Definition: TStyle.h:410
#define gGLManager
Definition: TVirtualGL.h:162
#define gPad
Definition: TVirtualPad.h:287
#define gVirtualX
Definition: TVirtualX.h:338
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition: TBufferFile.h:46
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
@ kRead
Definition: TBuffer.h:72
void SetReadMode()
Set buffer in read mode.
Definition: TBuffer.cxx:302
The Canvas class.
Definition: TCanvas.h:27
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
Definition: TCanvas.cxx:1638
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
Definition: TCanvas.cxx:1210
Int_t GetCanvasID() const
Get canvas identifier.
Definition: TCanvas.h:159
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2433
void Flush()
Flush canvas buffers.
Definition: TCanvas.cxx:1127
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
Search for an object at pixel position px,py.
Definition: TCanvas.h:184
Atom_t fDataType
Definition: TGDNDManager.h:75
Int_t fDataLength
Definition: TGDNDManager.h:78
void * fData
Definition: TGDNDManager.h:77
virtual void SetContainer(TGFrame *f)
Definition: TGCanvas.h:232
virtual void MapSubwindows()
Map all canvas sub windows.
Definition: TGCanvas.cxx:2160
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:227
virtual Bool_t HandleCrossing(Event_t *)
Definition: TGFrame.h:363
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:361
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:932
virtual Bool_t HandleDoubleClick(Event_t *)
Definition: TGFrame.h:362
virtual Bool_t HandleMotion(Event_t *)
Definition: TGFrame.h:364
virtual Bool_t HandleKey(Event_t *)
Definition: TGFrame.h:365
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:427
UInt_t fHeight
Definition: TGFrame.h:113
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:667
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2464
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t fWidth
Definition: TGFrame.h:112
UInt_t GetHeight() const
Definition: TGFrame.h:250
void SetDNDTarget(Bool_t onoff)
Definition: TGFrame.h:295
UInt_t GetWidth() const
Definition: TGFrame.h:249
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2437
Pixel_t fBackground
Definition: TGFrame.h:120
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:326
virtual Bool_t HandleExpose(Event_t *event)
Definition: TGWindow.h:102
const TGWindow * fParent
Definition: TGWindow.h:36
virtual Int_t MustCleanup() const
Definition: TGWindow.h:117
@ kEditDisableLayout
Definition: TGWindow.h:61
UInt_t fEditDisabled
Definition: TGWindow.h:40
An abstract interface to image processing library.
Definition: TImage.h:29
virtual void SetEditable(Bool_t=kTRUE)
Definition: TImage.h:225
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:119
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:877
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:195
The most important graphics class in the ROOT system.
Definition: TPad.h:29
virtual void SetBorderMode(Short_t bordermode)
Definition: TPad.h:320
virtual void Update()
Update pad.
Definition: TPad.cxx:2838
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:593
Long_t ExecPlugin(int nargs, const T &... params)
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
virtual ~TRootEmbeddedCanvas()
Delete embedded ROOT canvas.
virtual Bool_t HandleContainerCrossing(Event_t *ev)
Handle enter/leave events. Only leave is activated at the moment.
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t)
Handle dragging position events.
virtual Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
void AdoptCanvas(TCanvas *c)
Canvas c is adopted from this embedded canvas.
TRootEmbeddedCanvas(const TRootEmbeddedCanvas &)
virtual Bool_t HandleContainerButton(Event_t *ev)
Handle mouse button events in the canvas container.
virtual Bool_t HandleContainerDoubleClick(Event_t *ev)
Handle mouse button double click events in the canvas container.
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
TCanvas * GetCanvas() const
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
friend class TRootEmbeddedContainer
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
TRootEmbeddedContainer * fCanvasContainer
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
Bool_t GetCanvasPreferGL() const
Definition: TStyle.h:177
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:323
This class represents a WWW compatible URL.
Definition: TUrl.h:35
const char * GetFile() const
Definition: TUrl.h:71
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
EGEventType fType
Definition: GuiTypes.h:174
Int_t fCount
Definition: GuiTypes.h:182
UInt_t fState
Definition: GuiTypes.h:180
UInt_t fCode
Definition: GuiTypes.h:179