PixelLightAPI  .
ModTooltip.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: ModTooltip.h                                   *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight 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  *  PixelLight 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 PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLGUI_MODTOOLTIP_H__
00024 #define __PLGUI_MODTOOLTIP_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLGui/Modifiers/Modifier.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLGui {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Modifier that displays a tooltip for a widget
00046 */
00047 class ModTooltip : public Modifier {
00048 
00049 
00050     //[-------------------------------------------------------]
00051     //[ Class definition                                      ]
00052     //[-------------------------------------------------------]
00053     pl_class(PLGUI_RTTI_EXPORT, ModTooltip, "PLGui", PLGui::Modifier, "Modifier that displays a tooltip for a widget")
00054         // Attributes
00055         pl_attribute(Tooltip,   PLCore::String, "", ReadWrite,  GetSet, "Tooltip text", "")
00056         // Constructors
00057         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00058     pl_class_end
00059 
00060 
00061     //[-------------------------------------------------------]
00062     //[ Public functions                                      ]
00063     //[-------------------------------------------------------]
00064     public:
00065         /**
00066         *  @brief
00067         *    Constructor
00068         */
00069         PLGUI_API ModTooltip();
00070 
00071         /**
00072         *  @brief
00073         *    Destructor
00074         */
00075         PLGUI_API virtual ~ModTooltip();
00076 
00077         /**
00078         *  @brief
00079         *    Get tooltip text
00080         *
00081         *  @return
00082         *    Tooltip text
00083         */
00084         PLGUI_API PLCore::String GetTooltip() const;
00085 
00086         /**
00087         *  @brief
00088         *    Set tooltip text
00089         *
00090         *  @param[in] sTooltip
00091         *    Tooltip text
00092         */
00093         PLGUI_API void SetTooltip(const PLCore::String &sTooltip);
00094 
00095 
00096     //[-------------------------------------------------------]
00097     //[ Protected virtual ModTooltip functions                ]
00098     //[-------------------------------------------------------]
00099     protected:
00100         /**
00101         *  @brief
00102         *    Called when a tooltip shall be displayed
00103         */
00104         virtual void OnShowTooltip();
00105 
00106 
00107     //[-------------------------------------------------------]
00108     //[ Protected virtual Modifier functions                  ]
00109     //[-------------------------------------------------------]
00110     protected:
00111         virtual void OnAttach(Widget &cWidget) override;
00112         virtual void OnDetach(Widget &cWidget) override;
00113 
00114 
00115     //[-------------------------------------------------------]
00116     //[ Protected virtual WidgetFunctions functions           ]
00117     //[-------------------------------------------------------]
00118     protected:
00119         virtual void OnMouseHover() override;
00120 
00121 
00122     //[-------------------------------------------------------]
00123     //[ Protected data                                        ]
00124     //[-------------------------------------------------------]
00125     protected:
00126         PLCore::String m_sTooltip;  /**< Tooltip text */
00127 
00128 
00129 };
00130 
00131 
00132 //[-------------------------------------------------------]
00133 //[ Namespace                                             ]
00134 //[-------------------------------------------------------]
00135 } // PLGui
00136 
00137 
00138 #endif // __PLGUI_MODTOOLTIP_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:57
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported