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.

49 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. class vgui::Frame;
  16. class vgui::TextEntry;
  17. class vgui::Panel;
  18. class CCvarTextEntry;
  19. //--------------------------------------------------------------------------------------------------------------
  20. /**
  21. * Popup dialog with a text entry, extending the QueryBox, which extends the MessageBox
  22. */
  23. class CTextEntryBox : public vgui::QueryBox
  24. {
  25. public:
  26. CTextEntryBox(const char *title, const char *labelText, const char *entryText, bool isCvar, vgui::Panel *parent = NULL);
  27. virtual ~CTextEntryBox();
  28. virtual void PerformLayout(); ///< Layout override to position the label and text entry
  29. virtual void ShowWindow(vgui::Frame *pFrameOver); ///< Show window override to give focus to text entry
  30. private:
  31. typedef vgui::QueryBox BaseClass;
  32. protected:
  33. CCvarTextEntry *m_pCvarEntry;
  34. vgui::TextEntry *m_pEntry;
  35. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  36. void OnCommand( const char *command); ///< Handle button presses
  37. };
  38. #endif // CVARTEXTENTRYBOX_H