Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18class TGLabel;
19class TTimer;
20class TVirtualPad;
21class TBox;
22
23
25
26private:
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
39public:
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
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
long Long_t
Definition RtypesCore.h:54
#define ClassDef(name, id)
Definition Rtypes.h:325
Create a Box.
Definition TBox.h:22
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
TGToolTip & operator=(const TGToolTip &)=delete
void Show(Int_t x, Int_t y)
Show tool tip window.
void SetDelay(Long_t delayms)
Set delay in milliseconds.
Int_t fX
X position in fWindow where to popup.
Definition TGToolTip.h:33
Int_t fY
Y position in fWindow where to popup.
Definition TGToolTip.h:34
void Hide()
Hide tool tip window.
const TGFrame * fWindow
frame to which tool tip is associated
Definition TGToolTip.h:30
void SetPosition(Int_t x, Int_t y)
Set popup position within specified frame (as specified in the ctor).
TTimer * fDelay
popup delay timer
Definition TGToolTip.h:29
TGLayoutHints * fL1
layout used to place text in frame
Definition TGToolTip.h:28
virtual ~TGToolTip()
Delete a tool tip object.
const TBox * fBox
box in pad to which tooltip is associated
Definition TGToolTip.h:32
virtual void DrawBorder()
Draw border of tool tip window.
const TGString * GetText() const
Get the tool tip text.
TGLabel * fLabel
help text
Definition TGToolTip.h:27
void SetText(const char *new_text)
Set new tool tip text.
void Reset()
Reset tool tip popup delay timer.
TGToolTip(const TGToolTip &)=delete
const TVirtualPad * fPad
pad to which tooltip is associated
Definition TGToolTip.h:31
Bool_t HandleTimer(TTimer *t)
If tool tip delay timer times out show tool tip window.
ROOT GUI Window base class.
Definition TGWindow.h:23
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
TText * text
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17