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.

87 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include <stdio.h>
  8. #include "RawLogPanel.h"
  9. #include <vgui/ISystem.h>
  10. #include <vgui/ISurface.h>
  11. #include <vgui/IVGui.h>
  12. #include <vgui/ILocalize.h>
  13. #include <KeyValues.h>
  14. #include <vgui_controls/Label.h>
  15. #include <vgui_controls/TextEntry.h>
  16. #include <vgui_controls/RichText.h>
  17. #include <vgui_controls/Button.h>
  18. #include <vgui_controls/ToggleButton.h>
  19. #include <vgui_controls/RadioButton.h>
  20. #include <vgui_controls/ListPanel.h>
  21. #include <vgui_controls/ComboBox.h>
  22. #include <vgui_controls/PHandle.h>
  23. #include <vgui_controls/PropertySheet.h>
  24. #include "vgui_controls/ConsoleDialog.h"
  25. using namespace vgui;
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Constructor
  28. //-----------------------------------------------------------------------------
  29. CRawLogPanel::CRawLogPanel(vgui::Panel *parent, const char *name) : vgui::PropertyPage(parent, name)
  30. {
  31. SetSize(200, 100);
  32. m_pConsole = new CConsolePanel( this, "Console", false );
  33. LoadControlSettings("Admin\\RawLogPanel.res", "PLATFORM");
  34. }
  35. //-----------------------------------------------------------------------------
  36. // Purpose: Destructor
  37. //-----------------------------------------------------------------------------
  38. CRawLogPanel::~CRawLogPanel()
  39. {
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose: Activates the page
  43. //-----------------------------------------------------------------------------
  44. void CRawLogPanel::OnPageShow()
  45. {
  46. BaseClass::OnPageShow();
  47. }
  48. //-----------------------------------------------------------------------------
  49. // Purpose: Hides the page
  50. //-----------------------------------------------------------------------------
  51. void CRawLogPanel::OnPageHide()
  52. {
  53. BaseClass::OnPageHide();
  54. }
  55. //-----------------------------------------------------------------------------
  56. // Purpose: inserts a new string into the main chat panel
  57. //-----------------------------------------------------------------------------
  58. void CRawLogPanel::DoInsertString(const char *str)
  59. {
  60. if ( str )
  61. {
  62. m_pConsole->Print( str );
  63. }
  64. }
  65. //-----------------------------------------------------------------------------
  66. // Purpose: run when the send button is pressed, execs a command on the server
  67. //-----------------------------------------------------------------------------
  68. void CRawLogPanel::OnCommandSubmitted( char const *pchCommand )
  69. {
  70. if ( !pchCommand || !*pchCommand )
  71. return;
  72. // execute the typed command
  73. RemoteServer().SendCommand( pchCommand );
  74. }