Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGToolTip.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gui:$Id$
0002 // Author: Fons Rademakers   22/02/98
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGToolTip
0013 #define ROOT_TGToolTip
0014 
0015 
0016 #include "TGFrame.h"
0017 
0018 class TGLabel;
0019 class TTimer;
0020 class TVirtualPad;
0021 class TBox;
0022 
0023 
0024 class TGToolTip : public TGCompositeFrame {
0025 
0026 private:
0027    TGLabel           *fLabel;   ///< help text
0028    TGLayoutHints     *fL1;      ///< layout used to place text in frame
0029    TTimer            *fDelay;   ///< popup delay timer
0030    const TGFrame     *fWindow;  ///< frame to which tool tip is associated
0031    const TVirtualPad *fPad;     ///< pad to which tooltip is associated
0032    const TBox        *fBox;     ///< box in pad to which tooltip is associated
0033    Int_t              fX;       ///< X position in fWindow where to popup
0034    Int_t              fY;       ///< Y position in fWindow where to popup
0035 
0036    TGToolTip(const TGToolTip&) = delete;
0037    TGToolTip& operator=(const TGToolTip&) = delete;
0038 
0039 public:
0040    TGToolTip(const TGWindow *p = nullptr, const TGFrame *f = nullptr, const char *text = nullptr, Long_t delayms = 350);
0041    TGToolTip(const TGWindow *p, const TBox *b, const char *text, Long_t delayms);
0042    TGToolTip(const TBox *b, const char *text, Long_t delayms);
0043    TGToolTip(Int_t x, Int_t y, const char *text, Long_t delayms);
0044    ~TGToolTip() override;
0045 
0046    void DrawBorder() override;
0047 
0048    Bool_t HandleTimer(TTimer *t) override;
0049    void   Show(Int_t x, Int_t y);    //*SIGNAL*
0050    void   Hide();                    //*SIGNAL*
0051    void   Reset();                   //*SIGNAL*
0052    void   Reset(const TVirtualPad *parent);
0053    void   SetText(const char *new_text);
0054    void   SetPosition(Int_t x, Int_t y);
0055    void   SetDelay(Long_t delayms);
0056    const TGString *GetText() const;
0057 
0058    ClassDefOverride(TGToolTip,0)  //One or multiple lines help text
0059 };
0060 
0061 #endif