Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
1.8 KiB

//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Creates a Message box with a question in it and yes/no buttons
//
// $NoKeywords: $
//=============================================================================//
#ifndef TOOLTIP_H
#define TOOLTIP_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui/vgui.h>
#include <vgui_controls/Controls.h>
#include <utlvector.h>
namespace vgui
{
//-----------------------------------------------------------------------------
// Purpose: Tooltip for a panel - shows text when cursor hovers over a panel
//-----------------------------------------------------------------------------
class BaseTooltip
{
public:
BaseTooltip(Panel *parent, const char *text = NULL);
virtual void SetText(const char *text);
virtual const char *GetText();
virtual void ShowTooltip(Panel *currentPanel);
virtual void HideTooltip();
bool ShouldLayout( void );
virtual void PerformLayout() { return; }
virtual void PositionWindow( Panel *pTipPanel );
void ResetDelay();
void SetTooltipFormatToSingleLine();
void SetTooltipFormatToMultiLine();
void SetTooltipDelay(int tooltipDelayMilliseconds);
int GetTooltipDelay();
void SetEnabled( bool bState );
protected:
Panel *m_pParent;
CUtlVector<char> m_Text;
int _delay; // delay that counts down
int _tooltipDelay; // delay before tooltip comes up.
bool _makeVisible : 1;
bool _displayOnOneLine : 1;
bool _isDirty : 1;
bool _enabled : 1;
};
class TextTooltip : public BaseTooltip
{
public:
TextTooltip(Panel *parent, const char *text = NULL);
~TextTooltip();
virtual void SetText(const char *text);
virtual void ShowTooltip(Panel *currentPanel);
virtual void HideTooltip();
virtual void SizeTextWindow();
virtual void PerformLayout();
};
};
#endif // TOOLTIP_H