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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef BUILDMODEDIALOG_H
#define BUILDMODEDIALOG_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/Frame.h>
struct PanelItem_t;
namespace vgui
{
//-----------------------------------------------------------------------------
// Purpose: Dialog for use in build mode editing
//-----------------------------------------------------------------------------
class BuildModeDialog : public Frame
{
DECLARE_CLASS_SIMPLE( BuildModeDialog, Frame );
public:
BuildModeDialog( BuildGroup *buildGroup );
~BuildModeDialog();
// Set the current control to edit
MESSAGE_FUNC_PTR( SetActiveControl, "SetActiveControl", panelPtr );
// Update the current control with the current resource settings.
MESSAGE_FUNC_PTR( UpdateControlData, "UpdateControlData", panel );
// Store the current settings of all panels in the build group.
virtual KeyValues *StoreSettings();
// Store the current settings of the current panel
MESSAGE_FUNC( StoreUndoSettings, "StoreUndo" );
/* CUSTOM MESSAGE HANDLING
"SetActiveControl"
input: "PanelPtr" - panel to set active control to edit to
*/
MESSAGE_FUNC( OnShowNewControlMenu, "ShowNewControlMenu" );
protected:
virtual void PerformLayout();
virtual void OnClose();
virtual void OnCommand( const char *command );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual bool IsBuildGroupEnabled();
private:
void CreateControls();
void OnKeyCodeTyped(KeyCode code);
MESSAGE_FUNC( ApplyDataToControls, "ApplyDataToControls" );
MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel );
MESSAGE_FUNC( OnDeletePanel, "DeletePanel" );
void ExitBuildMode();
Panel *OnNewControl(const char *name, int x = 0, int y = 0);
MESSAGE_FUNC( DoUndo, "Undo" );
MESSAGE_FUNC( DoCopy, "Copy" );
MESSAGE_FUNC( DoPaste, "Paste" );
MESSAGE_FUNC( EnableSaveButton, "EnableSaveButton" );
void RevertToSaved();
void ShowHelp();
MESSAGE_FUNC( ShutdownBuildMode, "Close" );
MESSAGE_FUNC( OnPanelMoved, "PanelMoved" );
MESSAGE_FUNC( OnTextKillFocus, "TextKillFocus" );
MESSAGE_FUNC( OnReloadLocalization, "ReloadLocalization" );
MESSAGE_FUNC_CHARPTR( OnCreateNewControl, "CreateNewControl", text );
MESSAGE_FUNC_CHARPTR( OnSetClipboardText, "SetClipboardText", text );
MESSAGE_FUNC_INT( OnChangeChild, "OnChangeChild", direction );
Panel *m_pCurrentPanel;
BuildGroup *m_pBuildGroup;
Label *m_pStatusLabel;
ComboBox *m_pFileSelectionCombo;
Divider *m_pDivider;
class PanelList;
PanelList *m_pPanelList;
Button *m_pSaveButton;
Button *m_pApplyButton;
Button *m_pExitButton;
Button *m_pDeleteButton;
Button *m_pReloadLocalization;
MenuButton *m_pVarsButton;
bool _autoUpdate;
ComboBox *m_pAddNewControlCombo; // combo box for adding new controls
KeyValues *_undoSettings; // settings for the Undo command
KeyValues *_copySettings; // settings for the Copy/Paste command
char _copyClassName[255];
int m_nClick[ 2 ];
void RemoveAllControls( void );
void UpdateEditControl(PanelItem_t &panelItem, const char *datstring);
enum {
TYPE_STRING,
TYPE_INTEGER,
TYPE_COLOR,
TYPE_ALIGNMENT,
TYPE_AUTORESIZE,
TYPE_CORNER,
TYPE_LOCALIZEDSTRING,
};
vgui::DHANDLE< Menu > m_hContextMenu;
ComboBox *m_pEditableParents;
ComboBox *m_pEditableChildren;
Button *m_pNextChild;
Button *m_pPrevChild;
friend class PanelList;
};
} // namespace vgui
#endif // BUILDMODEDIALOG_H
|