blob: 104ce2e3987695463551ca5077d016c0a32aa809 (
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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef LABELEDCOMMANDCOMBOBOX_H
#define LABELEDCOMMANDCOMBOBOX_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/ComboBox.h>
#include <vgui_controls/Label.h>
#include <vgui_controls/Panel.h>
#include "utlvector.h"
class CLabeledCommandComboBox : public vgui::ComboBox
{
DECLARE_CLASS_SIMPLE( CLabeledCommandComboBox, vgui::ComboBox );
public:
CLabeledCommandComboBox(vgui::Panel *parent, const char *panelName);
~CLabeledCommandComboBox();
virtual void DeleteAllItems();
virtual void AddItem(char const *text, char const *engineCommand);
virtual void ActivateItem(int itemIndex);
const char *GetActiveItemCommand();
void SetInitialItem(int itemIndex);
void ApplyChanges();
void Reset();
bool HasBeenModified();
enum
{
MAX_NAME_LEN = 256,
MAX_COMMAND_LEN = 256
};
private:
MESSAGE_FUNC_CHARPTR( OnTextChanged, "TextChanged", text );
struct COMMANDITEM
{
char name[ MAX_NAME_LEN ];
char command[ MAX_COMMAND_LEN ];
int comboBoxID;
};
CUtlVector< COMMANDITEM > m_Items;
int m_iCurrentSelection;
int m_iStartSelection;
};
#endif // LABELEDCOMMANDCOMBOBOX_H
|