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.

40 lines
981 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #include "vgui_controls/HTML.h"
  3. #include "CMDDetailPanel.h"
  4. using namespace vgui;
  5. CMDDetailPanel::CMDDetailPanel( vgui::Panel *pParent, const char *pName ) :
  6. BaseClass( pParent, pName, true )
  7. {
  8. SetParent( pParent );
  9. m_pDetailWindow = new vgui::HTML(this, "Details");
  10. m_pDetailWindow->SetParent( this );
  11. m_pDetailWindow->SetSize( 770, 475 );
  12. LoadControlSettings( "MDDetailPanel.res" );
  13. m_pDetailWindow->OpenURL( "about:blank" );
  14. }
  15. void CMDDetailPanel::OpenURL( const char *url )
  16. {
  17. m_pDetailWindow->OpenURL( "about:blank" );
  18. m_pDetailWindow->OpenURL( url );
  19. m_pDetailWindow->SetVisible( true );
  20. }
  21. void CMDDetailPanel::OnCommand( const char *pCommand )
  22. {
  23. if ( !Q_strcmp( pCommand, "Close" ) )
  24. {
  25. Close();
  26. }
  27. }
  28. void CMDDetailPanel::Close()
  29. {
  30. m_pDetailWindow->SetVisible( false );
  31. SetVisible( false );
  32. KeyValues *kv = new KeyValues( "Refresh" );
  33. this->PostActionSignal( kv );
  34. }