87 fEditDisabled = kEditDisableGrab;
124 else if (
gVirtualX->InheritsFrom(
"TGCocoa"))
132 "Cannot load GL, will use default canvas imp instead\n");
200 Int_t button =
event->fCode;
244 Int_t button =
event->fCode;
276 static UInt_t previous_keysym = 0;
284 gVirtualX->LookupString(event, str,
sizeof(str), keysym);
294 gROOT->SetInterrupt();
297 if (keysym > 0x1011 && keysym < 0x1016) {
300 Int_t mx, my, tx, ty;
302 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
305 mx, my, tx, ty, dum1);
309 if ((previous_keysym == keysym) && (previous_event ==
kGKeyPress)) {
328 previous_keysym = keysym;
336 gVirtualX->LookupString(event, str,
sizeof(str), keysym);
338 if (keysym > 0x1011 && keysym < 0x1016) {
341 Int_t mx, my, tx, ty;
343 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
362 mx, my, tx, ty, dum1);
364 previous_keysym = keysym;
368 previous_event =
event->fType;
439 if (!obj)
return kTRUE;
443 if (!
object)
return kTRUE;
444 if (
object->InheritsFrom(
"TGraph"))
446 else if (
object->InheritsFrom(
"TImage"))
448 else if (
object->IsA()->GetMethodAllAny(
"Draw"))
453 else if (obj->IsA()->GetMethodAllAny(
"Draw"))
461 if (sfname.
Length() > 7) {
492 Int_t px = 0, py = 0;
497 xroot, yroot, px, py, wtarget);
502 gROOT->SetSelectedPad(pad);
517 for (
int i = 0; typelist[i] !=
kNone; ++i) {
518 if (typelist[i] == rootObj)
520 if (typelist[i] == uriObj)
545 out << std::endl <<
" // embedded canvas" << std::endl;
546 out <<
" TRootEmbeddedCanvas *";
552 out <<
");" << std::endl;
559 if (option && strstr(option,
"keep_names"))
560 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
563 <<
"->GetCanvasWindowId();" << std::endl;
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;
const Mask_t kButtonPressMask
const Mask_t kExposureMask
const Mask_t kKeyReleaseMask
const Mask_t kAnyModifier
const Mask_t kKeyPressMask
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kLeaveWindowMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
Handle_t Window_t
Window handle.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
void SetReadMode()
Set buffer in read mode.
void EmbedInto(Int_t winid, Int_t ww, Int_t wh)
Embedded a canvas into a TRootEmbeddedCanvas.
TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj) override
Search for an object at pixel position px,py.
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
Int_t GetCanvasID() const override
void Update() override
Update canvas pad buffers.
void Flush()
Flush canvas buffers.
virtual void SetContainer(TGFrame *f)
virtual void MapSubwindows()
Map all canvas sub windows.
TGViewPort * GetViewPort() const
virtual Bool_t HandleCrossing(Event_t *)
virtual Bool_t HandleButton(Event_t *)
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
virtual Bool_t HandleDoubleClick(Event_t *)
virtual Bool_t HandleMotion(Event_t *)
virtual Bool_t HandleKey(Event_t *)
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
void SetDNDTarget(Bool_t onoff)
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual Bool_t HandleExpose(Event_t *event)
virtual Int_t MustCleanup() const
An abstract interface to image processing library.
virtual void SetEditable(Bool_t=kTRUE)
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The most important graphics class in the ROOT system.
void Update() override
Update pad.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void SetBorderMode(Short_t bordermode) override
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.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t GetCanvasPreferGL() const
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
This class represents a WWW compatible URL.
const char * GetFile() const
EGEventType fType
of event (see EGEventType)
Int_t fCount
if non-zero, at least this many more exposes
UInt_t fState
key or button mask
UInt_t fCode
key or button code