summaryrefslogtreecommitdiff
path: root/utils/QCGenerator/CQCGenMain.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/QCGenerator/CQCGenMain.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'utils/QCGenerator/CQCGenMain.cpp')
-rw-r--r--utils/QCGenerator/CQCGenMain.cpp94
1 files changed, 94 insertions, 0 deletions
diff --git a/utils/QCGenerator/CQCGenMain.cpp b/utils/QCGenerator/CQCGenMain.cpp
new file mode 100644
index 0000000..fec3fb4
--- /dev/null
+++ b/utils/QCGenerator/CQCGenMain.cpp
@@ -0,0 +1,94 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Dialog for selecting game configurations
+//
+//=====================================================================================//
+
+#include <windows.h>
+
+#include <vgui/IVGui.h>
+#include <vgui/IInput.h>
+#include <vgui/ISystem.h>
+#include <vgui_controls/MessageBox.h>
+
+#include "matsys_controls/QCGenerator.h"
+#include "CQCGenMain.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include <tier0/memdbgon.h>
+
+using namespace vgui;
+
+CQCGenMain *g_pCQCGenMain = NULL;
+
+class CModalPreserveMessageBox : public vgui::MessageBox
+{
+public:
+ CModalPreserveMessageBox(const char *title, const char *text, vgui::Panel *parent)
+ : vgui::MessageBox( title, text, parent )
+ {
+ m_PrevAppFocusPanel = vgui::input()->GetAppModalSurface();
+ }
+
+ ~CModalPreserveMessageBox()
+ {
+ vgui::input()->SetAppModalSurface( m_PrevAppFocusPanel );
+ }
+
+public:
+ vgui::VPANEL m_PrevAppFocusPanel;
+};
+
+//-----------------------------------------------------------------------------
+// Constructor
+//-----------------------------------------------------------------------------
+CQCGenMain::CQCGenMain( Panel *parent, const char *pszPath, const char *pszScene , const char *name ) : BaseClass( parent, name ), m_bChanged( false )
+{
+ Assert( !g_pCQCGenMain );
+ g_pCQCGenMain = this;
+
+ SetMinimizeButtonVisible( true );
+
+ SetSize( 846, 770 );
+ SetMinimumSize(846, 770);
+ char szTitle[MAX_PATH];
+ strcpy( szTitle, pszPath );
+ strcat( szTitle, "\\" );
+ strcat( szTitle, pszScene );
+ SetTitle( szTitle, true );
+
+ m_pQCGenerator = new CQCGenerator( this, pszPath, pszScene );
+}
+
+//-----------------------------------------------------------------------------
+// Destructor
+//-----------------------------------------------------------------------------
+CQCGenMain::~CQCGenMain()
+{
+ g_pCQCGenMain = NULL;
+}
+
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Kills the whole app on close
+//-----------------------------------------------------------------------------
+void CQCGenMain::OnClose( void )
+{
+ BaseClass::OnClose();
+ ivgui()->Stop();
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Parse commands coming in from the VGUI dialog
+//-----------------------------------------------------------------------------
+void CQCGenMain::OnCommand( const char *command )
+{
+ BaseClass::OnCommand( command );
+}
+
+void CQCGenMain::OnRefresh()
+{
+ Repaint();
+}
+