void CDialog_PPEPrecache::OpenFiledialog()
{
	if ( m_hEffectBrowser.Get() )
		m_hEffectBrowser.Get()->MarkForDeletion();

	m_hEffectBrowser = new FileOpenDialog( this, "Select post processing effect",
		FOD_OPEN, NULL );

	if ( m_hEffectBrowser.Get() )
	{
		m_hEffectBrowser->SetStartDirectoryContext( GetFODPathContext( FODPC_CANVAS ), GetCanvasDirectory() );
		m_hEffectBrowser->AddFilter( "*.txt", "Canvas", true );
		m_hEffectBrowser->DoModal( true );
	}
}
void CShaderPrecache::OpenFileBrowser()
{
	if ( m_hDumpBrowser.Get() )
		m_hDumpBrowser.Get()->MarkForDeletion();

	m_hDumpBrowser = new FileOpenDialog( this,
		"Load shader info",
		FOD_OPEN,
		new KeyValues("FileOpenContext", "context", "open_si" ) );

	if ( m_hDumpBrowser.Get() )
	{
		m_hDumpBrowser->SetStartDirectoryContext( GetFODPathContext( FODPC_DUMPFILE ), ::GetDumpDirectory() );
		m_hDumpBrowser->AddFilter( "*.dump", "ShaderInfo", true );
		m_hDumpBrowser->DoModal();
	}
}
void CEditorRoot::OpenFileDialog( bool bSave )
{
	if ( m_hShaderBrowser.Get() )
		m_hShaderBrowser.Get()->MarkForDeletion();

	m_hShaderBrowser = new FileOpenDialog( this,
		bSave ? "Save canvas" : "Load canvas",
		bSave ? FOD_SAVE : FOD_OPEN,
		new KeyValues("FileOpenContext", "context",
		bSave ? "savec" : "openc" )
		);

	if ( m_hShaderBrowser.Get() )
	{
		//m_hShaderBrowser->SetStartDirectory( GetCanvasDirectory() );
		m_hShaderBrowser->SetStartDirectoryContext( GetFODPathContext( FODPC_CANVAS ), GetCanvasDirectory() );
		m_hShaderBrowser->AddFilter( "*.txt", "Canvas", true );
#if MAKE_DEFAULT_CANVAS_EDITABLE
		m_hShaderBrowser->AddFilter( "*.def", "Default canvas", true );
#endif
		m_hShaderBrowser->DoModal( true );
	}
}