Team Fortress 2 Source Code as on 22/4/2020
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.

46 lines
1.3 KiB

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