Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBoxInteractive.h
Go to the documentation of this file.
1
2// @(#)root/graf:$Id$
3// Author: Sergey Linev 18/09/2026
4
5/*************************************************************************
6 * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#include "TVirtualPad.h"
14
15#ifndef ROOT_TBoxInteractive
16#define ROOT_TBoxInteractive
17
19
20 protected:
21
22 enum EMode { pNone = 0, pA, pB, pC, pD, pTop, pL, pR, pBot, pINSIDE } fMode = pNone;
23
24 public:
26 Int_t px1 = 0, px2 = 0, py1 = 0, py2 = 0, dpx1 = 0, dpy2 = 0;
27 Double_t oldX1 = 0., oldY1 = 0., oldX2 = 0., oldY2 = 0.;
28 Double_t newX1 = 0., newY1 = 0., newX2 = 0., newY2 = 0.;
29
31
33
35
37
38 Bool_t IsResizing() const;
39
40 Bool_t IsOpaque(const TVirtualPad &parent) const;
41
43
44 virtual void PaintOutline(TVirtualPad &parent);
45
46 void ApplyChanges(TVirtualPad &parent);
47
48 void SetCursor(TVirtualPad &parent, Bool_t is_down) const;
49
50 char GetGuideChar() const;
51};
52
53#endif
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetCursor
Option_t Option_t TPoint TPoint const char y1
char GetGuideChar() const
Return character for selecting guide action.
Bool_t IsOpaque(const TVirtualPad &parent) const
Return selected opaque mode.
void ApplyChanges(TVirtualPad &parent)
Apply pixel coordinates changes back to box coordinates.
Bool_t ProcessMouseMove(const TVirtualPad &parent, Int_t px, Int_t py, Bool_t canX=kTRUE, Bool_t canY=kTRUE, Double_t aspectRatio=0.)
Process change of moue position during dragging.
Bool_t IsResizing() const
Return true if doing resize.
enum TBoxInteractive::EMode fMode
void CalcPixelCoord(const TVirtualPad &parent, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Calculate pixel coordinates.
Bool_t SelectCorner(Int_t px, Int_t py, Bool_t canX=kTRUE, Bool_t canY=kTRUE)
Select corner or side for the inetarctive action.
TBoxInteractive(Bool_t bx=kTRUE, Double_t x1=0., Double_t y1=0., Double_t x2=0., Double_t y2=0.)
Constructor.
Bool_t SelectDiamondCorner(Int_t px, Int_t py, Bool_t testInside=kTRUE)
Select diamond corner - or inside area Returns true if any mode was selected Can be reused for diamon...
virtual void PaintOutline(TVirtualPad &parent)
Paint object outline.
Helper class to store interactive parameters for individual objects Should be used via gPad->Interact...
Definition TVirtualPad.h:75
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51