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 ~TGToolTip() override;
45
46 void DrawBorder() override;
47
48 Bool_t HandleTimer(TTimer *t) override;
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 ClassDefOverride(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 ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char text
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
A tooltip can be a one or multiple lines help text that is displayed in a window when the mouse curso...
Definition TGToolTip.h:24
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 DrawBorder() override
Draw border of tool tip window.
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
Bool_t HandleTimer(TTimer *t) override
If tool tip delay timer times out show tool tip window.
const TBox * fBox
box in pad to which tooltip is associated
Definition TGToolTip.h:32
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
~TGToolTip() override
Delete a tool tip object.
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
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17