- // Different file, so clear index entries.
- ClearKeyWordTable();
- ResetContentsLevels(0);
- passNumber = 1;
- errorCount = 0;
-
- InputFile = copystring(s);
- wxString str = wxFileNameFromPath(InputFile);
- wxString buf;
- buf.Printf(_T("Tex2RTF [%s]"), str.c_str());
- frame->SetTitle((wxChar *)buf.c_str());
- OutputFile = NULL;
+ wxString s = wxFileSelector(_T("Choose LaTeX input file"), wxPathOnly(InputFile), wxFileNameFromPath(InputFile), _T("tex"), _T("*.tex"));
+ if (!s.empty())
+ {
+ // Different file, so clear index entries.
+ ClearKeyWordTable();
+ ResetContentsLevels(0);
+ passNumber = 1;
+ errorCount = 0;
+
+ InputFile = s;
+ wxString str = wxFileNameFromPath(InputFile);
+ wxString buf;
+ buf.Printf(_T("Tex2RTF [%s]"), str.c_str());
+ frame->SetTitle((wxChar *)buf.c_str());
+ OutputFile = wxEmptyString;
+ }