Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
60
62 Atom_t HandleDNDPosition(Int_t /*x*/, Int_t /*y*/, Atom_t action,
63 Int_t /*xroot*/, Int_t /*yroot*/) override;
65 Bool_t HandleDNDLeave() override;
66
67 ClassDefOverride(TRootEmbeddedCanvas,0) //A ROOT TCanvas that can be embedded in a TGFrame
68};
69
70#endif
Handle_t Atom_t
WM token.
Definition GuiTypes.h:37
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
RooFitResult * fit(const char *options)
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t Atom_t typelist
char name[80]
Definition TGX11.cxx:110
The Canvas class.
Definition TCanvas.h:23
Drag and drop data container.
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.
Atom_t HandleDNDEnter(Atom_t *typelist) override
Handle drag enter events.
Bool_t HandleDNDDrop(TDNDData *data) override
Handle drop 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 Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an embedded canvas as a C++ statement(s) on output stream out.
Int_t fCWinId
window id used by embedded TCanvas
Bool_t HandleDNDLeave() override
Handle drag leave events.
TCanvas * fCanvas
pointer to TCanvas
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.
TRootEmbeddedCanvas(const TRootEmbeddedCanvas &)=delete
TCanvas * GetCanvas() const
Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t) override
Handle dragging position events.
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
Int_t fButton
currently pressed button
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
TRootEmbeddedCanvas & operator=(const TRootEmbeddedCanvas &)=delete
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.
Event structure.
Definition GuiTypes.h:174