TGToolTip.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGToolTip.h 25229 2008-08-25 15:14:34Z bellenot $
00002 // Author: Fons Rademakers   22/02/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGToolTip
00013 #define ROOT_TGToolTip
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGToolTip                                                            //
00019 //                                                                      //
00020 // A tooltip can be a one or multiple lines help text that is displayed //
00021 // in a window when the mouse cursor overs a widget, without clicking   //
00022 // it. A small box appears with suplementary information regarding the  //
00023 // item being hovered over.                                             //
00024 //                                                                      //
00025 //////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TGFrame
00028 #include "TGFrame.h"
00029 #endif
00030 
00031 class TGLabel;
00032 class TTimer;
00033 class TVirtualPad;
00034 class TBox;
00035 
00036 
00037 class TGToolTip : public TGCompositeFrame {
00038 
00039 private:
00040    TGLabel           *fLabel;   // help text
00041    TGLayoutHints     *fL1;      // layout used to place text in frame
00042    TTimer            *fDelay;   // popup delay timer
00043    const TGFrame     *fWindow;  // frame to which tool tip is associated
00044    const TVirtualPad *fPad;     // pad to which tooltip is associated
00045    const TBox        *fBox;     // box in pad to which tooltip is associated
00046    Int_t              fX;       // X position in fWindow where to popup
00047    Int_t              fY;       // Y position in fWindow where to popup
00048 
00049    TGToolTip(const TGToolTip&);             // not implemented
00050    TGToolTip& operator=(const TGToolTip&);  // not implemented
00051 
00052 public:
00053    TGToolTip(const TGWindow *p = 0, const TGFrame *f = 0, const char *text = 0, Long_t delayms = 350);
00054    TGToolTip(const TGWindow *p, const TBox *b, const char *text, Long_t delayms);
00055    TGToolTip(const TBox *b, const char *text, Long_t delayms);
00056    TGToolTip(Int_t x, Int_t y, const char *text, Long_t delayms);
00057    virtual ~TGToolTip();
00058 
00059    virtual void DrawBorder();
00060 
00061    Bool_t HandleTimer(TTimer *t);
00062    void   Show(Int_t x, Int_t y);    //*SIGNAL*
00063    void   Hide();                    //*SIGNAL*
00064    void   Reset();                   //*SIGNAL*
00065    void   Reset(const TVirtualPad *parent);
00066    void   SetText(const char *new_text);
00067    void   SetPosition(Int_t x, Int_t y);
00068    void   SetDelay(Long_t delayms);
00069    const TGString *GetText() const;
00070 
00071    ClassDef(TGToolTip,0)  //One or multiple lines help text
00072 };
00073 
00074 #endif

Generated on Tue Jul 5 14:20:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1