//-----------------------------------------------------------------------------
// Sets a panel to be the main panel
//-----------------------------------------------------------------------------
void CVsVGuiWindow::SetMainPanel( vgui::EditablePanel * pPanel )
{
	Assert( m_hMainPanel.Get() == NULL );
	Assert( m_hVGuiContext == vgui::DEFAULT_VGUI_CONTEXT );

	m_hMainPanel = pPanel;

	m_hMainPanel->SetParent( vgui::surface()->GetEmbeddedPanel() );
	m_hMainPanel->SetVisible( true );
	m_hMainPanel->SetCursor( vgui::dc_arrow );

	m_hVGuiContext = vgui::ivgui()->CreateContext();
	vgui::ivgui()->AssociatePanelWithContext( m_hVGuiContext, m_hMainPanel->GetVPanel() );

	pPanel->InvalidateLayout();

	EnableWindow( m_hWnd, true );
	SetFocus( m_hWnd );
}