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
20class TCanvas;
22class TDNDData;
23
25
27
28protected:
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
43
44private:
47
48public:
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
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kDoubleBorder
Definition: GuiTypes.h:385
Handle_t Atom_t
WM token.
Definition: GuiTypes.h:37
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
The Canvas class.
Definition: TCanvas.h:23
Drag and drop data container.
Definition: TGDNDManager.h:64
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
ROOT GUI Window base class.
Definition: TGWindow.h:23
This class creates a TGCanvas in which a TCanvas is created.
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
Bool_t fAutoFit
canvas container keeps same size as canvas
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.
Int_t fCWinId
window id used by embedded TCanvas
TCanvas * fCanvas
pointer to TCanvas
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
void SetAutoFit(Bool_t fit=kTRUE)
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.
TCanvas * GetCanvas() const
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
TRootEmbeddedCanvas(const TRootEmbeddedCanvas &)=delete
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
Int_t fButton
currently pressed button
Bool_t GetAutoFit() const
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
TRootEmbeddedCanvas & operator=(const TRootEmbeddedCanvas &)=delete
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
Atom_t * fDNDTypeList
handles DND types
TRootEmbeddedContainer * fCanvasContainer
container in canvas widget
Int_t GetCanvasWindowId() const
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.
Utility class used by TRootEmbeddedCanvas.
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
static const std::string name("name")
Event structure.
Definition: GuiTypes.h:174