Changes: you can now see each file type in the open file dialog, but an error is raised, if opening an unsupported file type

This commit is contained in:
code@koerner-de.net
2011-10-06 19:18:23 +00:00
parent d04480d460
commit a4a7a957b9
5 changed files with 29 additions and 10 deletions
+8 -2
View File
@@ -267,11 +267,17 @@ void OTM_Frame::OnButtonOpen(wxCommandEvent& WXUNUSED(event))
OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage();
if (page==NULL) return;
wxString file_name = wxFileSelector( Language.ChooseFile, page->GetOpenPath(), "", "*.*", "textures (*.dds)|*.dds|zip (*.zip)|*.zip|tpf (*.tpf)|*.tpf", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
//wxString file_name = wxFileSelector( Language.ChooseFile, page->GetOpenPath(), "", "*.*", "textures (*.dds)|*.dds|zip (*.zip)|*.zip|tpf (*.tpf)|*.tpf", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
wxString file_name = wxFileSelector( Language.ChooseFile, page->GetOpenPath(), "", "", "", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if ( !file_name.empty() )
{
page->SetOpenPath(file_name.BeforeLast( '/'));
page->AddTexture( file_name);
if (page->AddTexture( file_name))
{
wxMessageBox(page->LastError, "ERROR", wxOK|wxICON_ERROR);
page->LastError.Empty();
}
}
}