void FileDialogDisplayer::DisplayFileDialog( const Helium::FileDialogArgs& args ) { int32_t style = 0; switch ( args.m_Type ) { case FileDialogTypes::OpenFile: style = FileDialogStyles::DefaultOpen; break; case FileDialogTypes::SaveFile: style = FileDialogStyles::DefaultSave; break; default: HELIUM_ASSERT( false ); } FileDialog saveDlg( NULL, args.m_Caption.c_str(), args.m_DefaultDirectory.c_str(), args.m_DefaultFile.c_str(), TXT( "" ), style ); saveDlg.AddFilter( args.m_Filters ); Helium::Path path; if ( saveDlg.ShowModal() == wxID_OK ) { path.Set( saveDlg.GetFilePath() ); } args.m_Result = path; }
bool Helium::GetPreferencesDirectory( Helium::Path& preferencesDirectory ) { tstring prefDirectory; if ( !Helium::GetPreferencesDirectory( prefDirectory ) ) { return false; } prefDirectory += TXT( "/.Helium/" ); preferencesDirectory.Set( prefDirectory ); return true; }