diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/dod/VGUI/dodmouseoverpanelbutton.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/dod/VGUI/dodmouseoverpanelbutton.h')
| -rw-r--r-- | game/client/dod/VGUI/dodmouseoverpanelbutton.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/game/client/dod/VGUI/dodmouseoverpanelbutton.h b/game/client/dod/VGUI/dodmouseoverpanelbutton.h new file mode 100644 index 0000000..4521823 --- /dev/null +++ b/game/client/dod/VGUI/dodmouseoverpanelbutton.h @@ -0,0 +1,72 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef DOD_MOUSE_OVER_BUTTON_H +#define DOD_MOUSE_OVER_BUTTON_H + +#include "dodbutton.h" +#include "mouseoverpanelbutton.h" + +template <class T> +class CDODMouseOverButton : public MouseOverButton<T>, public CDODButtonShape +{ +private: + //DECLARE_CLASS_SIMPLE( CDODMouseOverButton, MouseOverButton ); + +public: + CDODMouseOverButton(vgui::Panel *parent, const char *panelName, T *templatePanel ) : + MouseOverButton<T>( parent, panelName, templatePanel ) + { + } + +protected: + virtual void PaintBackground(); + virtual void PaintBorder(); + +public: + virtual void ShowPage( void ); + virtual void HidePage( void ); +}; + +//=============================================== +// CDODMouseOverButton - shaped mouseover button +//=============================================== +template <class T> +void CDODMouseOverButton<T>::PaintBackground() +{ + int wide, tall; + this->GetSize(wide,tall); + DrawShapedBackground( 0, 0, wide, tall, this->GetBgColor() ); +} + +template <class T> +void CDODMouseOverButton<T>::PaintBorder() +{ + int wide, tall; + this->GetSize(wide,tall); + DrawShapedBorder( 0, 0, wide, tall, this->GetFgColor() ); +} + +template <class T> +void CDODMouseOverButton<T>::ShowPage( void ) +{ + MouseOverButton<T>::ShowPage(); + + // send message to parent that we triggered something + this->PostActionSignal( new KeyValues("ShowPage", "page", this->GetName() ) ); +} + +template <class T> +void CDODMouseOverButton<T>::HidePage( void ) +{ + MouseOverButton<T>::HidePage(); + + // send message to parent that we triggered something + this->PostActionSignal( new KeyValues("ShowPage", "page", this->GetName() ) ); +} + +#endif // DOD_MOUSE_OVER_BUTTON_H
\ No newline at end of file |