Logo ROOT  
Reference Guide
TRootEmbeddedCanvas.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 15/07/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2021, 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 #ifndef ROOT_TRootEmbeddedCanvas
14 #define ROOT_TRootEmbeddedCanvas
15 
16 
17 #include "TGCanvas.h"
18 
19 
20 class TCanvas;
21 class TRootEmbeddedContainer;
22 class TDNDData;
23 
24 class TRootEmbeddedCanvas : public TGCanvas {
25 
27 
28 protected:
29  Int_t fCWinId; // window id used by embedded TCanvas
30  TRootEmbeddedContainer *fCanvasContainer; // container in canvas widget
31  TCanvas *fCanvas; // pointer to TCanvas
32  Bool_t fAutoFit; // canvas container keeps same size as canvas
33  Int_t fButton; // currently pressed button
34  Atom_t *fDNDTypeList; // handles DND types
35 
39  virtual Bool_t HandleContainerKey(Event_t *ev);
43 
44 private:
47 
48 public:
49  TRootEmbeddedCanvas(const char *name = nullptr, const TGWindow *p = nullptr, UInt_t w = 10,
50  UInt_t h = 10, UInt_t options = kSunkenFrame | kDoubleBorder,
52  virtual ~TRootEmbeddedCanvas();
53 
54  void AdoptCanvas(TCanvas *c);
55  TCanvas *GetCanvas() const { return fCanvas; }
56  Int_t GetCanvasWindowId() const { return fCWinId; }
57  Bool_t GetAutoFit() const { return fAutoFit; }
59  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
60 
61  virtual Bool_t HandleDNDDrop(TDNDData *data);
62  virtual Atom_t HandleDNDPosition(Int_t /*x*/, Int_t /*y*/, Atom_t action,
63  Int_t /*xroot*/, Int_t /*yroot*/);
64  virtual Atom_t HandleDNDEnter(Atom_t * typelist);
65  virtual Bool_t HandleDNDLeave();
66 
67  ClassDef(TRootEmbeddedCanvas,0) //A ROOT TCanvas that can be embedded in a TGFrame
68 };
69 
70 #endif
TRootEmbeddedCanvas::HandleDNDEnter
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
Definition: TRootEmbeddedCanvas.cxx:511
c
#define c(i)
Definition: RSha256.hxx:101
TRootEmbeddedCanvas::HandleDNDPosition
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t)
Handle dragging position events.
Definition: TRootEmbeddedCanvas.cxx:488
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:95
TRootEmbeddedCanvas::fDNDTypeList
Atom_t * fDNDTypeList
Definition: TRootEmbeddedCanvas.h:34
Option_t
const char Option_t
Definition: RtypesCore.h:66
TRootEmbeddedCanvas::HandleContainerMotion
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
Definition: TRootEmbeddedCanvas.cxx:374
TRootEmbeddedCanvas::HandleContainerExpose
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.
Definition: TRootEmbeddedCanvas.cxx:398
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TRootEmbeddedCanvas::TRootEmbeddedContainer
friend class TRootEmbeddedContainer
Definition: TRootEmbeddedCanvas.h:26
TRootEmbeddedCanvas::AdoptCanvas
void AdoptCanvas(TCanvas *c)
Canvas c is adopted from this embedded canvas.
Definition: TRootEmbeddedCanvas.cxx:185
TRootEmbeddedCanvas::~TRootEmbeddedCanvas
virtual ~TRootEmbeddedCanvas()
Delete embedded ROOT canvas.
Definition: TRootEmbeddedCanvas.cxx:173
TRootEmbeddedCanvas::operator=
TRootEmbeddedCanvas & operator=(const TRootEmbeddedCanvas &)=delete
Int_t
int Int_t
Definition: RtypesCore.h:45
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TRootEmbeddedCanvas::GetCanvasWindowId
Int_t GetCanvasWindowId() const
Definition: TRootEmbeddedCanvas.h:56
TRootEmbeddedCanvas::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
Definition: TRootEmbeddedCanvas.cxx:536
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
bool
TRootEmbeddedCanvas::SetAutoFit
void SetAutoFit(Bool_t fit=kTRUE)
Definition: TRootEmbeddedCanvas.h:58
TRootEmbeddedCanvas::fCanvas
TCanvas * fCanvas
Definition: TRootEmbeddedCanvas.h:31
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TRootEmbeddedCanvas::fCWinId
Int_t fCWinId
Definition: TRootEmbeddedCanvas.h:29
PyTorch_Generate_CNN_Model.fit
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
Definition: PyTorch_Generate_CNN_Model.py:32
h
#define h(i)
Definition: RSha256.hxx:106
TRootEmbeddedCanvas::TRootEmbeddedCanvas
TRootEmbeddedCanvas(const TRootEmbeddedCanvas &)=delete
Atom_t
Handle_t Atom_t
WM token.
Definition: GuiTypes.h:37
TRootEmbeddedCanvas::HandleContainerCrossing
virtual Bool_t HandleContainerCrossing(Event_t *ev)
Handle enter/leave events. Only leave is activated at the moment.
Definition: TRootEmbeddedCanvas.cxx:411
TRootEmbeddedCanvas::fAutoFit
Bool_t fAutoFit
Definition: TRootEmbeddedCanvas.h:32
TDNDData
Drag and drop data container.
Definition: TGDNDManager.h:64
unsigned int
TRootEmbeddedCanvas::HandleContainerKey
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
Definition: TRootEmbeddedCanvas.cxx:272
TRootEmbeddedCanvas::GetAutoFit
Bool_t GetAutoFit() const
Definition: TRootEmbeddedCanvas.h:57
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TRootEmbeddedCanvas::HandleContainerConfigure
virtual Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
Definition: TRootEmbeddedCanvas.cxx:260
TRootEmbeddedCanvas::fButton
Int_t fButton
Definition: TRootEmbeddedCanvas.h:33
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
Event_t
Event structure.
Definition: GuiTypes.h:174
name
char name[80]
Definition: TGX11.cxx:110
TGCanvas.h
TRootEmbeddedCanvas::HandleDNDDrop
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
Definition: TRootEmbeddedCanvas.cxx:429
TRootEmbeddedCanvas::GetCanvas
TCanvas * GetCanvas() const
Definition: TRootEmbeddedCanvas.h:55
TRootEmbeddedCanvas::HandleDNDLeave
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
Definition: TRootEmbeddedCanvas.cxx:528
TRootEmbeddedCanvas::HandleContainerDoubleClick
virtual Bool_t HandleContainerDoubleClick(Event_t *ev)
Handle mouse button double click events in the canvas container.
Definition: TRootEmbeddedCanvas.cxx:239
TRootEmbeddedCanvas::fCanvasContainer
TRootEmbeddedContainer * fCanvasContainer
Definition: TRootEmbeddedCanvas.h:30
TGCanvas
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
TRootEmbeddedCanvas
This class creates a TGCanvas in which a TCanvas is created.
Definition: TRootEmbeddedCanvas.h:24
int
TRootEmbeddedCanvas::HandleContainerButton
virtual Bool_t HandleContainerButton(Event_t *ev)
Handle mouse button events in the canvas container.
Definition: TRootEmbeddedCanvas.cxx:195