Logo ROOT  
Reference Guide
TGToolTip.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 22/02/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 #ifndef ROOT_TGToolTip
13 #define ROOT_TGToolTip
14 
15 
16 #include "TGFrame.h"
17 
18 class TGLabel;
19 class TTimer;
20 class TVirtualPad;
21 class TBox;
22 
23 
24 class TGToolTip : public TGCompositeFrame {
25 
26 private:
27  TGLabel *fLabel; ///< help text
28  TGLayoutHints *fL1; ///< layout used to place text in frame
29  TTimer *fDelay; ///< popup delay timer
30  const TGFrame *fWindow; ///< frame to which tool tip is associated
31  const TVirtualPad *fPad; ///< pad to which tooltip is associated
32  const TBox *fBox; ///< box in pad to which tooltip is associated
33  Int_t fX; ///< X position in fWindow where to popup
34  Int_t fY; ///< Y position in fWindow where to popup
35 
36  TGToolTip(const TGToolTip&) = delete;
37  TGToolTip& operator=(const TGToolTip&) = delete;
38 
39 public:
40  TGToolTip(const TGWindow *p = nullptr, const TGFrame *f = nullptr, const char *text = nullptr, Long_t delayms = 350);
41  TGToolTip(const TGWindow *p, const TBox *b, const char *text, Long_t delayms);
42  TGToolTip(const TBox *b, const char *text, Long_t delayms);
43  TGToolTip(Int_t x, Int_t y, const char *text, Long_t delayms);
44  virtual ~TGToolTip();
45 
46  virtual void DrawBorder();
47 
49  void Show(Int_t x, Int_t y); //*SIGNAL*
50  void Hide(); //*SIGNAL*
51  void Reset(); //*SIGNAL*
52  void Reset(const TVirtualPad *parent);
53  void SetText(const char *new_text);
54  void SetPosition(Int_t x, Int_t y);
55  void SetDelay(Long_t delayms);
56  const TGString *GetText() const;
57 
58  ClassDef(TGToolTip,0) //One or multiple lines help text
59 };
60 
61 #endif
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
f
#define f(i)
Definition: RSha256.hxx:104
TGToolTip::SetDelay
void SetDelay(Long_t delayms)
Set delay in milliseconds.
Definition: TGToolTip.cxx:399
TGToolTip::SetPosition
void SetPosition(Int_t x, Int_t y)
Set popup position within specified frame (as specified in the ctor).
Definition: TGToolTip.cxx:409
TGToolTip::fPad
const TVirtualPad * fPad
pad to which tooltip is associated
Definition: TGToolTip.h:31
TGToolTip::fL1
TGLayoutHints * fL1
layout used to place text in frame
Definition: TGToolTip.h:28
TGToolTip::TGToolTip
TGToolTip(const TGToolTip &)=delete
TGToolTip::GetText
const TGString * GetText() const
Get the tool tip text.
Definition: TGToolTip.cxx:430
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
x
Double_t x[n]
Definition: legend1.C:17
TGToolTip::SetText
void SetText(const char *new_text)
Set new tool tip text.
Definition: TGToolTip.cxx:390
TGToolTip::~TGToolTip
virtual ~TGToolTip()
Delete a tool tip object.
Definition: TGToolTip.cxx:212
TGToolTip
Definition: TGToolTip.h:24
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGToolTip::fY
Int_t fY
Y position in fWindow where to popup.
Definition: TGToolTip.h:34
TGToolTip::fDelay
TTimer * fDelay
popup delay timer
Definition: TGToolTip.h:29
text
TText * text
Definition: entrylist_figure1.C:10
b
#define b(i)
Definition: RSha256.hxx:100
bool
TGToolTip::Reset
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:263
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
y
Double_t y[n]
Definition: legend1.C:17
TGToolTip::fWindow
const TGFrame * fWindow
frame to which tool tip is associated
Definition: TGToolTip.h:30
TGToolTip::HandleTimer
Bool_t HandleTimer(TTimer *t)
If tool tip delay timer times out show tool tip window.
Definition: TGToolTip.cxx:288
TBox
Create a Box.
Definition: TBox.h:22
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGToolTip::DrawBorder
virtual void DrawBorder()
Draw border of tool tip window.
Definition: TGToolTip.cxx:222
TGToolTip::operator=
TGToolTip & operator=(const TGToolTip &)=delete
TGToolTip::Show
void Show(Int_t x, Int_t y)
Show tool tip window.
Definition: TGToolTip.cxx:233
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGToolTip::fX
Int_t fX
X position in fWindow where to popup.
Definition: TGToolTip.h:33
TGToolTip::Hide
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:250
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGToolTip::fBox
const TBox * fBox
box in pad to which tooltip is associated
Definition: TGToolTip.h:32
TGToolTip::fLabel
TGLabel * fLabel
help text
Definition: TGToolTip.h:27
int