aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/vgui_controls/PerforceFileExplorer.h
blob: 4d3dd8762db605251b0788d5c4e9f033aacd8416 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Allows you to browse a directory structure, showing perforce files
//
// $NoKeywords: $
//===========================================================================//

#ifndef PERFORCEFILEEXPLORER_H
#define PERFORCEFILEEXPLORER_H

#ifdef _WIN32
#pragma once
#endif


#include "tier1/utlstring.h"
#include "vgui_controls/Frame.h"


namespace vgui
{

//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class PerforceFileList;
class ComboBox;
class Button;


//-----------------------------------------------------------------------------
// Contains a list of files, determines their perforce status
//-----------------------------------------------------------------------------
class PerforceFileExplorer : public vgui::Frame
{
	DECLARE_CLASS_SIMPLE( PerforceFileExplorer, Frame );

public:
	// The context keyvalues are added to all messages sent by this dialog if they are specified
	PerforceFileExplorer( Panel *parent, const char *pPanelName );
	~PerforceFileExplorer();

	// Inherited from Frame
	virtual void ApplySchemeSettings( IScheme *pScheme );
	virtual void PerformLayout();

protected:
	MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );
	MESSAGE_FUNC( OnItemDoubleClicked, "ItemDoubleClicked" );
	MESSAGE_FUNC( OnFolderUp, "FolderUp" );

	void PopulateFileList();
	void PopulateDriveList();

	// Returns the current directory
	void SetCurrentDirectory( const char *pCurrentDirectory );

	Button *m_pFolderUpButton;
	ComboBox *m_pFullPathCombo;
	PerforceFileList *m_pFileList;
	CUtlString m_CurrentDirectory;
};


} // namespace vgui

#endif // PERFORCEFILEEXPLORER_H