397 {
398 wxFileName fn = GetValue();
399
402 else
404
406 {
407 wxFileDialog dlg(
m_dlg,
_(
"Select a File" ), fn.GetPath(), fn.GetFullName(), *
m_ext,
408 wxFD_FILE_MUST_EXIST | wxFD_OPEN );
409
410 if( dlg.ShowModal() == wxID_OK )
411 {
412 wxString filePath = dlg.GetPath();
413 wxString lastPath = dlg.GetDirectory();
414 wxString relPath = wxEmptyString;
415
417 {
420 lastPath =
NormalizePath( dlg.GetDirectory(), &
Pgm().GetLocalEnvVariables(),
422 }
423 else
424 {
425 relPath = filePath;
426 }
427
428 SetValue( relPath );
429
431 {;}
432
435 }
436 }
437 else
438 {
439 wxDirDialog dlg(
m_dlg,
_(
"Select Path" ), fn.GetPath(),
440 wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
441
442 if( dlg.ShowModal() == wxID_OK )
443 {
444 wxString filePath = dlg.GetPath();
445 wxString relPath = wxEmptyString;
446
448 {
451 }
452 else
453 {
454 relPath = filePath;
455 }
456
457 SetValue( relPath );
458
460 {;}
461
463 }
464 }
465 }
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.