blob: 36aa102d5fb0f3e67e4f24b7de61a9d5219c10f6 (
plain) (
blame)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "vgui/IScheme.h"
#include "vgui/KeyCode.h"
#include "vgui/ISurface.h"
#include "KeyValues.h"
#include "vgui_controls/PropertyPage.h"
#include "vgui_controls/Controls.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
PropertyPage::PropertyPage(Panel *parent, const char *panelName) : EditablePanel(parent, panelName)
{
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
PropertyPage::~PropertyPage()
{
}
//-----------------------------------------------------------------------------
// Purpose: Called when page is loaded. Data should be reloaded from document into controls.
//-----------------------------------------------------------------------------
void PropertyPage::OnResetData()
{
}
//-----------------------------------------------------------------------------
// Purpose: Called when the OK / Apply button is pressed. Changed data should be written into document.
//-----------------------------------------------------------------------------
void PropertyPage::OnApplyChanges()
{
}
//-----------------------------------------------------------------------------
// Purpose: Designed to be overriden
//-----------------------------------------------------------------------------
void PropertyPage::OnPageShow()
{
}
//-----------------------------------------------------------------------------
// Purpose: Designed to be overriden
//-----------------------------------------------------------------------------
void PropertyPage::OnPageHide()
{
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pageTab -
//-----------------------------------------------------------------------------
void PropertyPage::OnPageTabActivated(Panel *pageTab)
{
_pageTab = pageTab;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void PropertyPage::OnKeyCodeTyped(KeyCode code)
{
switch (code)
{
// left and right only get propogated to parents if our tab has focus
case KEY_RIGHT:
{
if (_pageTab != 0 && _pageTab->HasFocus())
BaseClass::OnKeyCodeTyped(code);
break;
}
case KEY_LEFT:
{
if (_pageTab != 0 && _pageTab->HasFocus())
BaseClass::OnKeyCodeTyped(code);
break;
}
default:
BaseClass::OnKeyCodeTyped(code);
break;
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void PropertyPage::SetVisible(bool state)
{
if (IsVisible() && !state)
{
// if we're going away and we have a current button, get rid of it
if (GetFocusNavGroup().GetCurrentDefaultButton())
{
GetFocusNavGroup().SetCurrentDefaultButton(NULL);
}
}
BaseClass::SetVisible(state);
}
|