diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/vgui_controls/QueryBox.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/vgui_controls/QueryBox.h')
| -rw-r--r-- | mp/src/public/vgui_controls/QueryBox.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mp/src/public/vgui_controls/QueryBox.h b/mp/src/public/vgui_controls/QueryBox.h new file mode 100644 index 00000000..d3df48d5 --- /dev/null +++ b/mp/src/public/vgui_controls/QueryBox.h @@ -0,0 +1,62 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Creates a Message box with a question in it and yes/no buttons
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef QUERYBOX_H
+#define QUERYBOX_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <KeyValues.h>
+#include <vgui_controls/MessageBox.h>
+#include <vgui_controls/Button.h>
+
+namespace vgui
+{
+
+//-----------------------------------------------------------------------------
+// Purpose: Creates A Message box with a question in it and yes/no buttons
+//-----------------------------------------------------------------------------
+class QueryBox : public MessageBox
+{
+ DECLARE_CLASS_SIMPLE( QueryBox, MessageBox );
+
+public:
+ QueryBox(const char *title, const char *queryText,vgui::Panel *parent = NULL );
+ QueryBox(const wchar_t *wszTitle, const wchar_t *wszQueryText,vgui::Panel *parent = NULL);
+ ~QueryBox();
+
+ // Layout the window for drawing
+ virtual void PerformLayout();
+
+ // Set the keyvalues to send when ok button is hit
+ void SetOKCommand(KeyValues *keyValues);
+
+ // Set the keyvalues to send when the cancel button is hit
+ void SetCancelCommand(KeyValues *keyValues);
+
+ // Set the text on the Cancel button
+ void SetCancelButtonText(const char *buttonText);
+ void SetCancelButtonText(const wchar_t *wszButtonText);
+
+ // Set a value of the ok command
+ void SetOKCommandValue(const char *keyName, int value);
+
+protected:
+ virtual void OnKeyCodeTyped( KeyCode code );
+ virtual void OnKeyCodePressed( KeyCode code );
+ virtual void OnCommand(const char *command);
+ Button *m_pCancelButton;
+
+private:
+ KeyValues *m_pCancelCommand;
+ KeyValues *m_pOkCommand;
+};
+
+}
+#endif // QUERYBOX_H
|