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.

58 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "DemoPage.h"
  8. #include <VGUI/IVGui.h>
  9. #include <Keyvalues.h>
  10. #include <vgui_controls/Controls.h>
  11. #include <vgui_controls/TextEntry.h>
  12. using namespace vgui;
  13. class SampleEditFields: public DemoPage
  14. {
  15. public:
  16. SampleEditFields(Panel *parent, const char *name);
  17. ~SampleEditFields();
  18. private:
  19. TextEntry *m_pTextEntry;
  20. };
  21. //-----------------------------------------------------------------------------
  22. // Purpose: Constructor
  23. //-----------------------------------------------------------------------------
  24. SampleEditFields::SampleEditFields(Panel *parent, const char *name) : DemoPage(parent, name)
  25. {
  26. m_pTextEntry = new TextEntry (this, "ATextEntry");
  27. int wide, tall;
  28. m_pTextEntry->GetSize(wide, tall);
  29. m_pTextEntry->SetBounds(150, 200, 150, tall);
  30. m_pTextEntry->InsertString("with content");
  31. m_pTextEntry->SetEnabled(false);
  32. LoadControlSettings("Demo/SampleEditFields.res");
  33. }
  34. //-----------------------------------------------------------------------------
  35. // Purpose: Destructor
  36. //-----------------------------------------------------------------------------
  37. SampleEditFields::~SampleEditFields()
  38. {
  39. }
  40. Panel* SampleEditFields_Create(Panel *parent)
  41. {
  42. return new SampleEditFields(parent, "Edit Fields");
  43. }