//========= 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 CDODMouseOverButton : public MouseOverButton, public CDODButtonShape { private: //DECLARE_CLASS_SIMPLE( CDODMouseOverButton, MouseOverButton ); public: CDODMouseOverButton(vgui::Panel *parent, const char *panelName, T *templatePanel ) : MouseOverButton( parent, panelName, templatePanel ) { } protected: virtual void PaintBackground(); virtual void PaintBorder(); public: virtual void ShowPage( void ); virtual void HidePage( void ); }; //=============================================== // CDODMouseOverButton - shaped mouseover button //=============================================== template void CDODMouseOverButton::PaintBackground() { int wide, tall; this->GetSize(wide,tall); DrawShapedBackground( 0, 0, wide, tall, this->GetBgColor() ); } template void CDODMouseOverButton::PaintBorder() { int wide, tall; this->GetSize(wide,tall); DrawShapedBorder( 0, 0, wide, tall, this->GetFgColor() ); } template void CDODMouseOverButton::ShowPage( void ) { MouseOverButton::ShowPage(); // send message to parent that we triggered something this->PostActionSignal( new KeyValues("ShowPage", "page", this->GetName() ) ); } template void CDODMouseOverButton::HidePage( void ) { MouseOverButton::HidePage(); // send message to parent that we triggered something this->PostActionSignal( new KeyValues("ShowPage", "page", this->GetName() ) ); } #endif // DOD_MOUSE_OVER_BUTTON_H