X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32ac755d4a48496ecea17a50c216d44078f8dc8b..57c0af52bffc66b12b7e7b49b3a2dfdcf2d2e352:/src/generic/msgdlgg.cpp diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 0c40ccf0f4..2f4aeb5425 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -21,13 +21,11 @@ #endif #ifndef WX_PRECOMP -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/button.h" -#include "wx/stattext.h" -#include "wx/layout.h" -#include "wx/intl.h" + #include "wx/utils.h" + #include "wx/dialog.h" + #include "wx/button.h" + #include "wx/stattext.h" + #include "wx/intl.h" #endif #include @@ -35,15 +33,12 @@ #include "wx/generic/msgdlgg.h" -#ifdef __WXGTK__ -#include "wx/statline.h" +#if wxUSE_STATLINE + #include "wx/statline.h" #endif -/////////////////////////////////////////////////////////////////// -// New dialog box implementations - -// Split message, using constraints to position controls -wxSize wxSplitMessage2( const wxString &message, wxWindow *parent ) +/* Split message, using constraints to position controls */ +static wxSize wxSplitMessage2( const wxString &message, wxWindow *parent ) { int y = 10; int w = 50; @@ -95,6 +90,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString { m_dialogStyle = style; + wxBeginBusyCursor(); + wxSize message_size( wxSplitMessage2( message, this ) ); wxButton *ok = (wxButton *) NULL; @@ -131,8 +128,16 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString } else if (yes) { - yes->SetDefault(); - yes->SetFocus(); + if(style & wxNO_DEFAULT) + { + no->SetDefault(); + no->SetFocus(); + } + else + { + yes->SetDefault(); + yes->SetFocus(); + } } int w = m_buttons.GetCount() * 100; @@ -150,30 +155,29 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString n++; } -#ifdef __WXGTK__ +#if wxUSE_STATLINE (void) new wxStaticLine( this, -1, wxPoint(0,y-20), wxSize(w+30, 5) ); #endif SetSize( w+30, y+40 ); Centre( wxBOTH ); + + wxEndBusyCursor(); } void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event)) { - printf( "yes.\n" ); EndModal( wxID_YES ); } void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event)) { - printf( "no.\n" ); EndModal( wxID_NO ); } void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { - printf( "cancel message.\n" ); /* Allow cancellation via ESC/Close button except if only YES and NO are specified. */ if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) )