summaryrefslogtreecommitdiff
path: root/gameui/TextEntryBox.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /gameui/TextEntryBox.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'gameui/TextEntryBox.h')
-rw-r--r--gameui/TextEntryBox.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/gameui/TextEntryBox.h b/gameui/TextEntryBox.h
new file mode 100644
index 0000000..71626e0
--- /dev/null
+++ b/gameui/TextEntryBox.h
@@ -0,0 +1,46 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+// Author: Matthew D. Campbell ([email protected]), 2003
+
+#ifndef TEXTENTRYBOX_H
+#define TEXTENTRYBOX_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "KeyValues.h"
+#include <vgui_controls/QueryBox.h>
+
+class CCvarTextEntry;
+
+//--------------------------------------------------------------------------------------------------------------
+/**
+ * Popup dialog with a text entry, extending the QueryBox, which extends the MessageBox
+ */
+class CTextEntryBox : public vgui::QueryBox
+{
+public:
+ CTextEntryBox(const char *title, const char *labelText, const char *entryText, bool isCvar, vgui::Panel *parent = NULL);
+
+ virtual ~CTextEntryBox();
+
+ virtual void PerformLayout(); ///< Layout override to position the label and text entry
+ virtual void ShowWindow(vgui::Frame *pFrameOver); ///< Show window override to give focus to text entry
+
+private:
+ typedef vgui::QueryBox BaseClass;
+
+protected:
+ CCvarTextEntry *m_pCvarEntry;
+ vgui::TextEntry *m_pEntry;
+
+ virtual void OnKeyCodeTyped(vgui::KeyCode code);
+ void OnCommand( const char *command); ///< Handle button presses
+};
+
+#endif // CVARTEXTENTRYBOX_H