Apply WinCE OK-button policy. Use standard buttons routines.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
49089236aa
commit
c81c9392fa
@ -998,7 +998,11 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!wxDialog::Create( parent, wxID_ANY, message, pos, wxDefaultSize,
|
if (!wxDialog::Create( parent, wxID_ANY, message, pos, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ))
|
wxDEFAULT_DIALOG_STYLE
|
||||||
|
#ifndef __WXWINCE__
|
||||||
|
| wxRESIZE_BORDER
|
||||||
|
#endif
|
||||||
|
))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1126,10 +1130,15 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
|
|||||||
m_choice = new wxChoice( this, ID_CHOICE );
|
m_choice = new wxChoice( this, ID_CHOICE );
|
||||||
textsizer->Add( m_choice, 1, wxCENTER|wxALL, 5 );
|
textsizer->Add( m_choice, 1, wxCENTER|wxALL, 5 );
|
||||||
|
|
||||||
buttonsizer = new wxBoxSizer( wxHORIZONTAL );
|
wxSizer *bsizer = CreateButtonSizer( wxOK|wxCANCEL , false, 5 );
|
||||||
buttonsizer->Add( new wxButton( this, wxID_OK ), 0, wxCENTER | wxALL, 5 );
|
if(bsizer->GetChildren().GetCount() > 0 )
|
||||||
buttonsizer->Add( new wxButton( this, wxID_CANCEL ), 0, wxCENTER | wxALL, 5 );
|
{
|
||||||
mainsizer->Add( buttonsizer, 0, wxALIGN_RIGHT );
|
mainsizer->Add( bsizer, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delete bsizer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1346,10 +1355,18 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wxString filename( fn );
|
wxString filename( fn );
|
||||||
wxString dir = m_list->GetDir();
|
if (filename.empty())
|
||||||
if (filename.empty()) return;
|
{
|
||||||
|
#ifdef __WXWINCE__
|
||||||
|
wxCommandEvent event;
|
||||||
|
wxDialog::OnCancel(event);
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (filename == wxT(".")) return;
|
if (filename == wxT(".")) return;
|
||||||
|
|
||||||
|
wxString dir = m_list->GetDir();
|
||||||
|
|
||||||
// "some/place/" means they want to chdir not try to load "place"
|
// "some/place/" means they want to chdir not try to load "place"
|
||||||
bool want_dir = filename.Last() == wxFILE_SEP_PATH;
|
bool want_dir = filename.Last() == wxFILE_SEP_PATH;
|
||||||
if (want_dir)
|
if (want_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user