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