File/dir dialog styles and other changes (patch 1488371):
- check invalid combinations of styles in wxFileDialogBase::Create() - use wxFD_XXX naming convention for wxFileDialog styles - replaces wxDD_NEW_DIR_BUTTON with wxDD_DIR_MUST_EXIST - removes #ifdef __WXGTK24__ / #endif blocks from wxGTK code - removes wxFileDialogBase::Get/SetStyle and wxFileDialogBase::m_fileName - renames wxDirDialogGTK to wxDirDialog git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -597,7 +597,7 @@ public:
|
||||
wxEmptyString,
|
||||
GetValue(),
|
||||
wxT("All files (*.*)|*.*"),
|
||||
wxOPEN);
|
||||
wxFD_OPEN);
|
||||
|
||||
if ( dlg.ShowModal() == wxID_OK )
|
||||
{
|
||||
|
@@ -1712,7 +1712,7 @@ bool CeditorDlg::Initialize()
|
||||
|
||||
void CeditorDlg::OnSelectPict()
|
||||
{
|
||||
wxFileDialog dlg(this, wxT("Choose an image file less than 60K"), wxEmptyString, wxEmptyString, wxT("JPEG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif|BMP files (*.bmp)|*.bmp|All Files (*.*)|*.*"), wxOPEN);
|
||||
wxFileDialog dlg(this, wxT("Choose an image file less than 60K"), wxEmptyString, wxEmptyString, wxT("JPEG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif|BMP files (*.bmp)|*.bmp|All Files (*.*)|*.*"), wxFD_OPEN);
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
|
@@ -729,7 +729,7 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
|
||||
wxFileSelectorDefaultWildcardStr,
|
||||
wxFileSelectorDefaultWildcardStr
|
||||
),
|
||||
wxCHANGE_DIR,
|
||||
wxFD_OPEN|wxFD_CHANGE_DIR,
|
||||
this
|
||||
);
|
||||
|
||||
@@ -758,7 +758,7 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
|
||||
#endif
|
||||
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
|
||||
wxEmptyString, wxEmptyString, wildcards,
|
||||
wxMULTIPLE);
|
||||
wxFD_OPEN|wxFD_MULTIPLE);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
@@ -791,7 +791,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
|
||||
wxEmptyString,
|
||||
_T("myletter.doc"),
|
||||
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
|
||||
wxSAVE|wxOVERWRITE_PROMPT);
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
|
||||
dialog.SetFilterIndex(1);
|
||||
|
||||
@@ -905,12 +905,12 @@ void MyFrame::DoDirChoose(int style)
|
||||
|
||||
void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
DoDirChoose(wxDD_DEFAULT_STYLE & ~wxDD_NEW_DIR_BUTTON);
|
||||
DoDirChoose(wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
|
||||
}
|
||||
|
||||
void MyFrame::DirChooseNew(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
DoDirChoose(wxDD_DEFAULT_STYLE | wxDD_NEW_DIR_BUTTON);
|
||||
DoDirChoose(wxDD_DEFAULT_STYLE & ~wxDD_DIR_MUST_EXIST);
|
||||
}
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
|
@@ -170,7 +170,7 @@ public:
|
||||
wxT("PCX files (*.pcx)|*.pcx|")
|
||||
wxT("ICO files (*.ico)|*.ico|")
|
||||
wxT("CUR files (*.cur)|*.cur"),
|
||||
wxSAVE,
|
||||
wxFD_SAVE,
|
||||
this);
|
||||
|
||||
if ( savefilename.empty() )
|
||||
|
@@ -220,7 +220,7 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
|
||||
|
||||
wxFileDialog dialog( this, _T("Open text"), wxEmptyString, wxEmptyString,
|
||||
_T("Text file (*.txt)|*.txt|Any file (*)|*"),
|
||||
wxOPEN|wxFILE_MUST_EXIST );
|
||||
wxFD_OPEN|wxFD_FILE_MUST_EXIST );
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
m_text->Clear();
|
||||
@@ -275,7 +275,7 @@ void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) )
|
||||
#if wxUSE_FILEDLG
|
||||
wxFileDialog dialog( this, _T("Open text"), wxEmptyString, wxEmptyString,
|
||||
_T("Text file (*.txt)|*.txt|Any file (*)|*"),
|
||||
wxSAVE|wxOVERWRITE_PROMPT );
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT );
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
m_filename = dialog.GetPath();
|
||||
|
@@ -108,7 +108,7 @@ void MyFrame::OnMenuFileOpen( wxCommandEvent& WXUNUSED(event) )
|
||||
#else
|
||||
wxT("DXF Drawing (*.dxf)|*.dxf)|All files (*.*)|*.*"),
|
||||
#endif
|
||||
wxOPEN);
|
||||
wxFD_OPEN);
|
||||
if (!filename.IsEmpty())
|
||||
{
|
||||
m_canvas->LoadDXF(filename);
|
||||
|
@@ -721,7 +721,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
path,
|
||||
filename,
|
||||
filter,
|
||||
wxOPEN);
|
||||
wxFD_OPEN);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
@@ -759,7 +759,7 @@ void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event))
|
||||
path,
|
||||
filename,
|
||||
filter,
|
||||
wxSAVE);
|
||||
wxFD_SAVE);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
|
@@ -984,7 +984,7 @@ void MyFrame::OnSelectFile(wxCommandEvent& WXUNUSED(event))
|
||||
#if wxUSE_FILEDLG
|
||||
wxFileDialog dlg(this, _T("Choose a sound file"),
|
||||
wxEmptyString, wxEmptyString,
|
||||
_T("WAV files (*.wav)|*.wav"), wxOPEN|wxCHANGE_DIR);
|
||||
_T("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR);
|
||||
if ( dlg.ShowModal() == wxID_OK )
|
||||
{
|
||||
m_soundFile = dlg.GetPath();
|
||||
|
@@ -508,7 +508,7 @@ bool Edit::LoadFile ()
|
||||
// get filname
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString,
|
||||
_T("Any file (*)|*"), wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
||||
_T("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
}
|
||||
@@ -557,7 +557,7 @@ bool Edit::SaveFile ()
|
||||
// get filname
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
|
||||
wxSAVE | wxOVERWRITE_PROMPT);
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
}
|
||||
|
@@ -352,7 +352,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
||||
#if wxUSE_FILEDLG
|
||||
wxString fname;
|
||||
wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
|
||||
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
fname = dlg.GetPath ();
|
||||
FileOpen (fname);
|
||||
@@ -373,7 +373,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
||||
if (!m_edit) return;
|
||||
#if wxUSE_FILEDLG
|
||||
wxString filename = wxEmptyString;
|
||||
wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
|
||||
wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
filename = dlg.GetPath();
|
||||
m_edit->SaveFile (filename);
|
||||
|
@@ -350,7 +350,7 @@ void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
||||
|
||||
wxFileDialog dialog(this, wxT("Save Picture as"), wxEmptyString, pChild->GetTitle(),
|
||||
wxT("SVG vector picture files (*.svg)|*.svg"),
|
||||
wxSAVE|wxOVERWRITE_PROMPT);
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
|
Reference in New Issue
Block a user