Adapt wxFileDialog and wxMessageDialog for PDAs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1064,6 +1064,8 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
if ( m_filterExtension == ".*" ) m_filterExtension = wxEmptyString;
|
||||
|
||||
// layout
|
||||
|
||||
bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
|
||||
|
||||
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
@@ -1114,13 +1116,13 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
#endif
|
||||
buttonsizer->Add( butNewDir, 0, wxALL, 5 );
|
||||
|
||||
if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA)
|
||||
if (is_pda)
|
||||
mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 0 );
|
||||
else
|
||||
mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA)
|
||||
if (is_pda)
|
||||
staticsizer->Add( new wxStaticText( this, -1, _("Current directory:") ), 0, wxRIGHT, 10 );
|
||||
m_static = new wxStaticText( this, -1, m_dir );
|
||||
staticsizer->Add( m_static, 1 );
|
||||
@@ -1137,7 +1139,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
m_list->SetNewDirControl(butNewDir);
|
||||
m_list->SetGoToParentControl(butDirUp);
|
||||
|
||||
if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA)
|
||||
if (is_pda)
|
||||
{
|
||||
// PDAs have a different screen layout
|
||||
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
|
||||
|
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#include "wx/artprov.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
#include "wx/statline.h"
|
||||
@@ -66,6 +67,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
{
|
||||
m_dialogStyle = style;
|
||||
|
||||
bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
|
||||
|
||||
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -97,13 +100,16 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
break;
|
||||
}
|
||||
wxStaticBitmap *icon = new wxStaticBitmap(this, -1, bitmap);
|
||||
icon_text->Add( icon, 0, wxCENTER );
|
||||
if (is_pda)
|
||||
topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
|
||||
else
|
||||
icon_text->Add( icon, 0, wxCENTER );
|
||||
}
|
||||
|
||||
// 2) text
|
||||
icon_text->Add( CreateTextSizer( message ), 0, wxCENTER | wxLEFT, 10 );
|
||||
|
||||
topsizer->Add( icon_text, 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
|
||||
topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
// 3) static line
|
||||
@@ -140,8 +146,8 @@ void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
/* Allow cancellation via ESC/Close button except if
|
||||
only YES and NO are specified. */
|
||||
// Allow cancellation via ESC/Close button except if
|
||||
// only YES and NO are specified.
|
||||
if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
|
Reference in New Issue
Block a user