]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/tipdlg.cpp
Guard against comparing invalid iterators, which produces an assertion
[wxWidgets.git] / src / generic / tipdlg.cpp
index 0bb63154a9dafd83c9e2b7e2585a4339428025d1..213e7185dc69ea8e80d37d0e782f0b54a03d33b3 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        tipdlg.cpp
+// Name:        src/generic/tipdlg.cpp
 // Purpose:     implementation of wxTipDialog
 // Author:      Vadim Zeitlin
 // Modified by:
 // 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"
 
@@ -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;
@@ -219,7 +218,8 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
                          bool showAtStartup)
            : wxDialog(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);
@@ -241,9 +241,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
 
     wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."));
 
-    // Currently this causes the bottom half to be chopped off,
-    // so disable the large font
-#ifndef __WXMSW__
     if (!isPda)
     {
         wxFont font = text->GetFont();
@@ -251,15 +248,15 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
         font.SetWeight(wxFONTWEIGHT_BOLD);
         text->SetFont(font);
     }
-#endif
 
     m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
                             wxDefaultPosition, wxSize(200, 160),
                             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
@@ -346,4 +343,3 @@ bool wxShowTip(wxWindow *parent,
 }
 
 #endif // wxUSE_STARTUP_TIPS
-