X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/491a2b094b1b85a47a95dacb605cb25abc59cb46..3201a1046ba71ba8e5ef2ed694fde34d12f743f3:/src/generic/tipdlg.cpp?ds=sidebyside diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index bef711e279..85a63ad860 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: tipdlg.cpp +// Name: src/generic/tipdlg.cpp // Purpose: implementation of wxTipDialog // Author: Vadim Zeitlin // Modified by: @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "tipdlg.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -41,11 +37,11 @@ #include "wx/statbmp.h" #include "wx/stattext.h" #include "wx/sizer.h" + #include "wx/settings.h" #endif // WX_PRECOMP #include "wx/statline.h" #include "wx/artprov.h" -#include "wx/settings.h" #include "wx/tipdlg.h" @@ -200,6 +196,9 @@ wxString wxFileTipProvider::GetTip() tip = tip.BeforeLast(wxT('\"')); // ...and replace escaped quotes tip.Replace(wxT("\\\""), wxT("\"")); + + // and translate it as requested + tip = wxGetTranslation(tip); } return tip; @@ -211,34 +210,21 @@ wxString wxFileTipProvider::GetTip() BEGIN_EVENT_TABLE(wxTipDialog, wxDialog) EVT_BUTTON(wxID_NEXT_TIP, wxTipDialog::OnNextTip) - EVT_BUTTON(wxID_CLOSE, wxTipDialog::OnCancel) END_EVENT_TABLE() wxTipDialog::wxTipDialog(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup) - : wxDialog(parent, wxID_ANY, _("Tip of the Day"), + : wxDialog(GetParentForModalDialog(parent), wxID_ANY, _("Tip of the Day"), wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ) { m_tipProvider = tipProvider; bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); // 1) create all controls in tab order - // smart phones does not support or do not waste space for wxButtons -#ifndef __SMARTPHONE__ - wxButton *btnClose = new wxButton(this, wxID_CLOSE); -#endif - - m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup")); - m_checkbox->SetValue(showAtStartup); - - // smart phones does not support or do not waste space for wxButtons -#ifndef __SMARTPHONE__ - wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); -#endif - wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know...")); if (!isPda) @@ -254,8 +240,9 @@ wxTipDialog::wxTipDialog(wxWindow *parent, wxTE_MULTILINE | wxTE_READONLY | wxTE_NO_VSCROLL | - wxTE_RICH | // a hack to get rid of vert scrollbar - wxSUNKEN_BORDER); + wxTE_RICH2 | // a hack to get rid of vert scrollbar + wxDEFAULT_CONTROL_BORDER + ); #if defined(__WXMSW__) m_text->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)); #endif @@ -278,6 +265,22 @@ wxTipDialog::wxTipDialog(wxWindow *parent, //#endif + m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup")); + m_checkbox->SetValue(showAtStartup); + m_checkbox->SetFocus(); + + // smart phones does not support or do not waste space for wxButtons +#ifndef __SMARTPHONE__ + wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); +#endif + + // smart phones does not support or do not waste space for wxButtons +#ifndef __SMARTPHONE__ + wxButton *btnClose = new wxButton(this, wxID_CLOSE); + SetAffirmativeId(wxID_CLOSE); +#endif + + // 2) put them in boxes wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); @@ -342,4 +345,3 @@ bool wxShowTip(wxWindow *parent, } #endif // wxUSE_STARTUP_TIPS -