- wxFileDialog* d = new wxFileDialog (this, _prompt, wxEmptyString, wxEmptyString, _wildcard);
- d->SetPath (_path);
- if (d->ShowModal () == wxID_OK) {
- SetPath (d->GetPath ());
+ long style = _open ? wxFD_OPEN : wxFD_SAVE;
+ if (_warn_overwrite) {
+ style |= wxFD_OVERWRITE_PROMPT;
+ }
+ wxFileDialog dialog(this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style);
+ dialog.SetPath(_path);
+ if (dialog.ShowModal() == wxID_OK) {
+ SetPath(dialog.GetPath());