Logo ROOT   6.10/09
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 
46 class TRootEmbeddedContainer : public TGCompositeFrame {
47 private:
48  TRootEmbeddedCanvas *fCanvas; // pointer back to embedded canvas
49 public:
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 
73 TRootEmbeddedContainer::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 
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);
146  fCanvasContainer = new TRootEmbeddedContainer(this, win, GetViewPort());
147  SetContainer(fCanvasContainer);
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) {
163  fCanvas->SetBorderMode(0);
164  MapSubwindows();
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)
206  fCanvas->HandleInput(EEventType(7), x, y);
207  else
208  fCanvas->HandleInput(kButton1Down, x, y);
209  }
210  if (button == kButton2)
211  fCanvas->HandleInput(kButton2Down, x, y);
212  if (button == kButton3) {
213  fCanvas->HandleInput(kButton3Down, x, y);
214  fButton = 0; // button up is consumed by TContextMenu
215  }
216 
217  } else if (event->fType == kButtonRelease) {
218  if (button == kButton1)
219  fCanvas->HandleInput(kButton1Up, x, y);
220  if (button == kButton2)
221  fCanvas->HandleInput(kButton2Up, x, y);
222  if (button == kButton3)
223  fCanvas->HandleInput(kButton3Up, x, y);
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)
247  fCanvas->HandleInput(kButton1Double, x, y);
248  if (button == kButton2)
249  fCanvas->HandleInput(kButton2Double, x, y);
250  if (button == kButton3)
251  fCanvas->HandleInput(kButton3Double, x, y);
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();
286  fCanvas->HandleInput(kButton1Up, 0, 0);
287  fCanvas->HandleInput(kMouseMotion, 0, 0);
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);
304  fCanvas->HandleInput(kArrowKeyPress, tx, ty);
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  }
324  fCanvas->HandleInput(kArrowKeyRelease, tx, ty);
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);
361  fCanvas->HandleInput(kArrowKeyRelease, tx, ty);
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)
381  fCanvas->HandleInput(kMouseMotion, x, y);
382  if (fButton == kButton1) {
383  if (event->fState & kKeyShiftMask)
384  fCanvas->HandleInput(EEventType(8), x, y);
385  else
386  fCanvas->HandleInput(kButton1Motion, x, y);
387  }
388  if (fButton == kButton2)
389  fCanvas->HandleInput(kButton2Motion, x, y);
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)
420  fCanvas->HandleInput(kMouseLeave, x, y);
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();
436  TObject *obj = (TObject *)buf.ReadObjectAny(TObject::Class());
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 
535 void TRootEmbeddedCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
536 {
537  if (!GetCanvas()) return;
538 
539  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
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 
549  if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
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 }
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
const Mask_t kKeyReleaseMask
Definition: GuiTypes.h:159
const TGWindow * fParent
Definition: TGWindow.h:37
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
Int_t fDataLength
Definition: TGDNDManager.h:78
virtual Bool_t HandleContainerCrossing(Event_t *ev)
Handle enter/leave events. Only leave is activated at the moment.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:47
virtual UInt_t GetOptions() const
Definition: TGFrame.h:244
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:383
virtual Bool_t HandleKey(Event_t *)
Definition: TGFrame.h:387
virtual Bool_t HandleDoubleClick(Event_t *)
Definition: TGFrame.h:384
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
const char Option_t
Definition: RtypesCore.h:62
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
This class represents a WWW compatible URL.
Definition: TUrl.h:35
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:640
Int_t fCount
Definition: GuiTypes.h:182
R__EXTERN TStyle * gStyle
Definition: TStyle.h:402
UInt_t GetHeight() const
Definition: TGFrame.h:272
TH1 * h
Definition: legend2.C:5
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
EGEventType
Definition: GuiTypes.h:58
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
EEventType
Definition: Buttons.h:15
#define gROOT
Definition: TROOT.h:375
virtual Bool_t HandleContainerDoubleClick(Event_t *ev)
Handle mouse button double click events in the canvas container.
Int_t LoadPlugin()
Load the plugin library for this handler.
Basic string class.
Definition: TString.h:129
Pixel_t fBackground
Definition: TGFrame.h:142
#define gClient
Definition: TGClient.h:166
virtual void Update()
Update pad.
Definition: TPad.cxx:2786
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:202
virtual void * ReadObjectAny(const TClass *cast)
Read object from I/O buffer.
An abstract interface to image processing library.
Definition: TImage.h:29
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
Handle_t GetId() const
Definition: TGObject.h:48
void AdoptCanvas(TCanvas *c)
Canvas c is adopted from this embedded canvas.
void SetDNDTarget(Bool_t onoff)
Definition: TGFrame.h:317
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:565
Double_t x[n]
Definition: legend1.C:17
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:2345
void Class()
Definition: Class.C:29
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
Handle_t Atom_t
Definition: GuiTypes.h:36
void * fData
Definition: TGDNDManager.h:77
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2231
virtual Bool_t HandleExpose(Event_t *event)
Definition: TGWindow.h:101
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Definition: TStyle.h:316
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
virtual Bool_t HandleContainerButton(Event_t *ev)
Handle mouse button events in the canvas container.
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
virtual ~TRootEmbeddedCanvas()
Delete embedded ROOT canvas.
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t)
Handle dragging position events.
EGEventType fType
Definition: GuiTypes.h:174
Long_t ExecPlugin(int nargs, const T &... params)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:436
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:221
const Mask_t kExposureMask
Definition: GuiTypes.h:164
unsigned int UInt_t
Definition: RtypesCore.h:42
The most important graphics class in the ROOT system.
Definition: TPad.h:29
char * Form(const char *fmt,...)
const Handle_t kNone
Definition: GuiTypes.h:87
Ssiz_t Length() const
Definition: TString.h:388
void SetReadMode()
Set buffer in read mode.
Definition: TBuffer.cxx:271
Atom_t fDataType
Definition: TGDNDManager.h:75
virtual void SetEditable(Bool_t=kTRUE)
Definition: TImage.h:225
#define gVirtualX
Definition: TVirtualX.h:350
UInt_t fWidth
Definition: TGFrame.h:134
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual Bool_t HandleMotion(Event_t *)
Definition: TGFrame.h:386
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:425
The Canvas class.
Definition: TCanvas.h:31
#define ClassImp(name)
Definition: Rtypes.h:336
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
UInt_t fCode
Definition: GuiTypes.h:179
unsigned long ULong_t
Definition: RtypesCore.h:51
Double_t y[n]
Definition: legend1.C:17
#define gGLManager
Definition: TVirtualGL.h:162
UInt_t fHeight
Definition: TGFrame.h:135
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
Handle_t fId
Definition: TGObject.h:36
Mother of all ROOT objects.
Definition: TObject.h:37
Handle_t Window_t
Definition: GuiTypes.h:28
void EmbedInto(Int_t winid, Int_t ww, Int_t wh)
Embedded a canvas into a TRootEmbeddedCanvas.
Definition: TCanvas.cxx:981
#define gPad
Definition: TVirtualPad.h:284
UInt_t fState
Definition: GuiTypes.h:180
UInt_t fEditDisabled
Definition: TGWindow.h:41
Atom_t * fDNDTypeList
Definition: TGFrame.h:482
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2433
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2460
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:110
Bool_t GetCanvasPreferGL() const
Definition: TStyle.h:173
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:930
Definition: Buttons.h:22
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
const Bool_t kTRUE
Definition: RtypesCore.h:91
const Int_t n
Definition: legend1.C:16
virtual Bool_t HandleCrossing(Event_t *)
Definition: TGFrame.h:385
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:859
virtual Int_t MustCleanup() const
Definition: TGFrame.h:420
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
const char * Data() const
Definition: TString.h:347