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.

52 lines
1.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. // Author: Matthew D. Campbell ([email protected]), 2003
  8. #ifndef TEXTENTRYBOX_H
  9. #define TEXTENTRYBOX_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "keyvalues.h"
  14. #include <vgui_controls/QueryBox.h>
  15. namespace vgui
  16. {
  17. class Frame;
  18. class TextEntry;
  19. class Panel;
  20. }
  21. class CCvarTextEntry;
  22. //--------------------------------------------------------------------------------------------------------------
  23. /**
  24. * Popup dialog with a text entry, extending the QueryBox, which extends the MessageBox
  25. */
  26. class CTextEntryBox : public vgui::QueryBox
  27. {
  28. public:
  29. CTextEntryBox(const char *title, const char *labelText, const char *entryText, bool isCvar, vgui::Panel *parent = NULL);
  30. virtual ~CTextEntryBox();
  31. virtual void PerformLayout(); ///< Layout override to position the label and text entry
  32. virtual void ShowWindow(vgui::Frame *pFrameOver); ///< Show window override to give focus to text entry
  33. private:
  34. typedef vgui::QueryBox BaseClass;
  35. protected:
  36. CCvarTextEntry *m_pCvarEntry;
  37. vgui::TextEntry *m_pEntry;
  38. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  39. void OnCommand( const char *command); ///< Handle button presses
  40. };
  41. #endif // CVARTEXTENTRYBOX_H