Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Creates a Message box with a question in it and yes/no buttons
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef QUERYBOX_H
  8. #define QUERYBOX_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <keyvalues.h>
  13. #include <vgui_controls/MessageBox.h>
  14. #include <vgui_controls/Button.h>
  15. namespace vgui
  16. {
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Creates A Message box with a question in it and yes/no buttons
  19. //-----------------------------------------------------------------------------
  20. class QueryBox : public MessageBox
  21. {
  22. DECLARE_CLASS_SIMPLE( QueryBox, MessageBox );
  23. public:
  24. QueryBox(const char *title, const char *queryText,vgui::Panel *parent = NULL );
  25. QueryBox(const wchar_t *wszTitle, const wchar_t *wszQueryText,vgui::Panel *parent = NULL);
  26. ~QueryBox();
  27. // Layout the window for drawing
  28. virtual void PerformLayout();
  29. // Set the keyvalues to send when ok button is hit
  30. void SetOKCommand(KeyValues *keyValues);
  31. // Set the keyvalues to send when the cancel button is hit
  32. void SetCancelCommand(KeyValues *keyValues);
  33. // Set the text on the Cancel button
  34. void SetCancelButtonText(const char *buttonText);
  35. void SetCancelButtonText(const wchar_t *wszButtonText);
  36. // Set a value of the ok command
  37. void SetOKCommandValue(const char *keyName, int value);
  38. protected:
  39. virtual void OnKeyCodeTyped(KeyCode code);
  40. virtual void OnCommand(const char *command);
  41. Button *m_pCancelButton;
  42. private:
  43. KeyValues *m_pCancelCommand;
  44. KeyValues *m_pOkCommand;
  45. };
  46. }
  47. #endif // QUERYBOX_H