From 3a035fb95fdb2e83848bb21016fa919506f14537 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 8 Jul 2000 10:29:17 +0000 Subject: [PATCH] Doc typos corrected, added wxDIALOG_UNIT_COMPATIBILITY test, made file open error result in a message box (docview.cpp) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/msw.rsp | 5 ++--- docs/latex/wx/hash.tex | 5 ++--- docs/latex/wx/stopwtch.tex | 2 +- src/common/docview.cpp | 16 +++++++++++++++- src/msw/window.cpp | 8 ++++++++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/distrib/msw/msw.rsp b/distrib/msw/msw.rsp index c03417682f..952d1e6847 100644 --- a/distrib/msw/msw.rsp +++ b/distrib/msw/msw.rsp @@ -15,9 +15,8 @@ docs/wine/COPYING.LIB distrib/msw/*.rsp distrib/msw/*.bat -tools/gettext/xgettext.exe -tools/gettext/msgfmt.exe -tools/gettext/msgunfmt.exe +tools/gettext/*.exe +tools/gettext/*.sed src/makeb32.env src/makeprog.b32 diff --git a/docs/latex/wx/hash.tex b/docs/latex/wx/hash.tex index 21dc3642cd..6e45cab36e 100644 --- a/docs/latex/wx/hash.tex +++ b/docs/latex/wx/hash.tex @@ -95,7 +95,7 @@ is destroyed. \func{wxObject *}{Get}{\param{long}{ key}} -\func{wxObject *}{Get}{\param{const wxString\& }{ key}} +\func{wxObject *}{Get}{\param{const char*}{ key}} Gets data from the hash table, using an integer or string key (depending on which has table constructor was used). @@ -121,13 +121,12 @@ description for \helpref{wxNode}{wxnode}. The user will probably only wish to us \func{void}{Put}{\param{long}{ key}, \param{wxObject *}{object}} -\func{void}{Put}{\param{const wxString\& }{ key}, \param{wxObject *}{object}} +\func{void}{Put}{\param{const char*}{ key}, \param{wxObject *}{object}} Inserts data into the hash table, using an integer or string key (depending on which has table constructor was used). The key string is copied and stored by the hash table implementation. - \membersection{wxList::GetCount} \constfunc{size\_t}{GetCount}{\void} diff --git a/docs/latex/wx/stopwtch.tex b/docs/latex/wx/stopwtch.tex index 98b60ed19f..cff119d2ca 100644 --- a/docs/latex/wx/stopwtch.tex +++ b/docs/latex/wx/stopwtch.tex @@ -1,6 +1,6 @@ \section{\class{wxStopWatch}}\label{wxstopwatch} -The wxStopWatch class allow you to measure time intervalls. +The wxStopWatch class allow you to measure time intervals. \wxheading{Include files} diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 13fa7316d8..a71312e513 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1349,8 +1349,22 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, 0, wxTheApp->GetTopWindow()); - if (!pathTmp.IsEmpty() && wxFileExists(pathTmp)) + if (!pathTmp.IsEmpty()) { + if (!wxFileExists(pathTmp)) + { + wxString msgTitle; + if (!wxTheApp->GetAppName().IsEmpty()) + msgTitle = wxTheApp->GetAppName(); + else + msgTitle = wxString(_("File error")); + + (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK | wxICON_EXCLAMATION, + wxTheApp->GetTopWindow()); + + path = wxT(""); + return (wxDocTemplate *) NULL; + } m_lastDirectory = wxPathOnly(pathTmp); path = pathTmp; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c3dd1a083b..40f3d05537 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1344,7 +1344,11 @@ int wxWindow::GetCharWidth() const { // +1 is needed because Windows apparently adds it when calculating the // dialog units size in pixels +#if wxDIALOG_UNIT_COMPATIBILITY + return wxGetTextMetrics(this).tmAveCharWidth ; +#else return wxGetTextMetrics(this).tmAveCharWidth + 1; +#endif } void wxWindow::GetTextExtent(const wxString& string, @@ -4279,21 +4283,25 @@ static TEXTMETRIC wxGetTextMetrics(const wxWindow *win) HWND hwnd = GetHwndOf(win); HDC hdc = ::GetDC(hwnd); +#if !wxDIALOG_UNIT_COMPATIBILITY // and select the current font into it HFONT hfont = GetHfontOf(win->GetFont()); if ( hfont ) { hfont = (HFONT)::SelectObject(hdc, hfont); } +#endif // finally retrieve the text metrics from it GetTextMetrics(hdc, &tm); +#if !wxDIALOG_UNIT_COMPATIBILITY // and clean up if ( hfont ) { (void)::SelectObject(hdc, hfont); } +#endif ::ReleaseDC(hwnd, hdc);