1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
|