summaryrefslogtreecommitdiff
path: root/engine/cl_txviewpanel.cpp
blob: 7d5b4727e1a3a9dd8cb9fd54b38837ea4f40be16 (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
115
116
117
118
119
120
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//

#include "client_pch.h"

#include <vgui/ISystem.h>
#include <vgui/ISurface.h>
#include <vgui/IVGui.h>
#include <KeyValues.h>

#include <vgui_controls/BuildGroup.h>
#include <vgui_controls/Tooltip.h>
#include <vgui_controls/TextImage.h>
#include <vgui_controls/CheckButton.h>
#include <vgui_controls/Label.h>
#include <vgui_controls/PropertySheet.h>
#include <vgui_controls/FileOpenDialog.h>
#include <vgui_controls/ProgressBar.h>
#include <vgui_controls/Slider.h>
#include <vgui_controls/Controls.h>
#include <vgui_controls/TextEntry.h>
#include <vgui_controls/ListViewPanel.h>
#include <vgui/IInput.h>

#include "filesystem.h"

#include "cl_txviewpanel.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

using namespace vgui;


TxViewPanel *g_pTxViewPanel = NULL;

void TxViewPanel::Install( vgui::Panel *parent )
{
	if ( g_pTxViewPanel )
		return;

	g_pTxViewPanel = new TxViewPanel( parent );
	Assert( g_pTxViewPanel );
}

TxViewPanel::TxViewPanel( vgui::Panel *parent ) : vgui::Frame( parent, "TxViewPanel" )
{
	m_pRefresh = new vgui::Button( this, "Refresh", "Refresh" );
	m_pView = new vgui::ListViewPanel( this, "Textures" );

	vgui::ivgui()->AddTickSignal( GetVPanel(), 0 );

	LoadControlSettings( "Resource\\TxViewPanel.res" );

	SetVisible( false );
	SetSizeable( true );
	SetMoveable( true );
}

TxViewPanel::~TxViewPanel()
{
	;
}

void TxViewPanel::OnTick()
{
	BaseClass::OnTick();

	if ( !IsVisible() )
		return;

	;
}

void TxViewPanel::OnCommand( const char *command )
{
	if ( !Q_strcasecmp( command, "refresh" ) )
	{
		;
	}
	else
	{
		BaseClass::OnCommand( command );
	}
}

void TxViewPanel::OnMessage( const KeyValues *params, vgui::VPANEL fromPanel )
{
	BaseClass::OnMessage( params, fromPanel );
}

void TxViewPanel::OnFileSelected( const char *fullpath )
{
	if ( !fullpath || !fullpath[0] )
		return;

	;
}

void TxView_f()
{
	if ( !g_pTxViewPanel )
		return;

	if ( g_pTxViewPanel->IsVisible() )
	{
		g_pTxViewPanel->Close();
	}
	else
	{
		g_pTxViewPanel->Activate();
	}
}

// static ConCommand txview( "txview", TxView_f, "Show/hide the internal texture viewer.", FCVAR_DONTRECORD );