Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXToolTip.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                           T o o l   T i p   W i d g e t                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXTOOLTIP_H
00022 #define FXTOOLTIP_H
00023 
00024 #ifndef FXSHELL_H
00025 #include "FXShell.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXFont;
00032 
00033 
00035 enum {
00036   TOOLTIP_PERMANENT  = 0x00020000,      
00037   TOOLTIP_VARIABLE   = 0x00040000,      
00038   TOOLTIP_NORMAL     = 0                
00039   };
00040 
00041 
00043 class FXAPI FXToolTip : public FXShell {
00044   FXDECLARE(FXToolTip)
00045 protected:
00046   FXString  label;                      // Text in the tip
00047   FXFont   *font;                       // Font of the tip
00048   FXColor   textColor;                  // Text color
00049   FXbool    popped;                     // Is currently popped up
00050 protected:
00051   FXToolTip();
00052   virtual FXbool doesOverrideRedirect() const;
00053   void place(FXint x,FXint y);
00054   void autoplace();
00055 private:
00056   FXToolTip(const FXToolTip&);
00057   FXToolTip& operator=(const FXToolTip&);
00058 #ifdef WIN32
00059   virtual const void* GetClass() const;
00060 #endif
00061 public:
00062   long onPaint(FXObject*,FXSelector,void*);
00063   long onUpdate(FXObject*,FXSelector,void*);
00064   long onTipShow(FXObject*,FXSelector,void*);
00065   long onTipHide(FXObject*,FXSelector,void*);
00066   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00067   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00068 public:
00069   enum {
00070     ID_TIP_SHOW=FXShell::ID_LAST,
00071     ID_TIP_HIDE,
00072     ID_LAST
00073     };
00074 public:
00076   FXToolTip(FXApp* a,FXuint opts=TOOLTIP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00077 
00079   virtual void create();
00080 
00082   virtual void detach();
00083 
00085   virtual void show();
00086 
00088   virtual FXint getDefaultWidth();
00089 
00091   virtual FXint getDefaultHeight();
00092 
00094   void setText(const FXString& text);
00095 
00097   FXString getText() const { return label; }
00098 
00100   void setFont(FXFont *fnt);
00101 
00103   FXFont* getFont() const { return font; }
00104 
00106   FXColor getTextColor() const { return textColor; }
00107 
00109   void setTextColor(FXColor clr);
00110 
00111   virtual FXbool doesSaveUnder() const;
00112 
00114   virtual void save(FXStream& store) const;
00115 
00117   virtual void load(FXStream& store);
00118 
00120   virtual ~FXToolTip();
00121   };
00122 
00123 }
00124 
00125 #endif

Copyright © 1997-2011 Jeroen van der Zijp