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_controls/WizardPanel.h"
#include "vgui_controls/WizardSubPanel.h"
#include "vgui_controls/BuildGroup.h"
#include "KeyValues.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
#include <stdio.h>
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
WizardSubPanel::WizardSubPanel(Panel *parent, const char *panelName) : EditablePanel(parent, panelName), _wizardPanel(NULL)
{
SetVisible(false);
m_iDesiredWide = 0;
m_iDesiredTall = 0;
SetBuildGroup(GetBuildGroup());
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
WizardSubPanel::~WizardSubPanel()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void WizardSubPanel::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
SetBgColor(GetSchemeColor("WizardSubPanel.BgColor",pScheme));
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void WizardSubPanel::GetSettings( KeyValues *outResourceData )
{
BaseClass::GetSettings(outResourceData);
outResourceData->SetInt("WizardWide", m_iDesiredWide);
outResourceData->SetInt("WizardTall", m_iDesiredTall);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void WizardSubPanel::ApplySettings(KeyValues *inResourceData)
{
// don't adjust visiblity during settings application (since it's our parent who really controls it)
bool bVisible = IsVisible();
BaseClass::ApplySettings(inResourceData);
m_iDesiredWide = inResourceData->GetInt("WizardWide", 0);
m_iDesiredTall = inResourceData->GetInt("WizardTall", 0);
if (GetWizardPanel() && m_iDesiredWide && m_iDesiredTall)
{
GetWizardPanel()->SetSize(m_iDesiredWide, m_iDesiredTall);
}
SetVisible(bVisible);
}
//-----------------------------------------------------------------------------
// Purpose: build mode description
//-----------------------------------------------------------------------------
const char *WizardSubPanel::GetDescription()
{
static char buf[1024];
_snprintf(buf, sizeof(buf), "%s, int WizardWide, int WizardTall", BaseClass::GetDescription());
return buf;
}
//-----------------------------------------------------------------------------
// Purpose: gets the size this subpanel would like the wizard to be
//-----------------------------------------------------------------------------
bool WizardSubPanel::GetDesiredSize(int &wide, int &tall)
{
wide = m_iDesiredWide;
tall = m_iDesiredTall;
return (m_iDesiredWide && m_iDesiredTall);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
KeyValues *WizardSubPanel::GetWizardData()
{
return GetWizardPanel()->GetWizardData();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
WizardSubPanel *WizardSubPanel::GetSiblingSubPanelByName(const char *pageName)
{
return GetWizardPanel()->GetSubPanelByName(pageName);
}
|