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