From 4f3b37fd0e60dcdf61c951e3c220fe267e8257f8 Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Fri, 16 Aug 2002 09:55:54 +0000
Subject: [PATCH] Applied patch [ 594416 ] MDI Previous Child From Benjamin I.
 Williams

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/html/faqgtk.htm      | 27 +++++++++++++++++++++++++--
 docs/html/faqmac.htm      |  2 +-
 docs/html/faqmsw.htm      | 23 +++++++++++++++++++++--
 docs/html/platform.htm    |  8 ++++----
 docs/latex/wx/hashmap.tex |  2 +-
 src/mac/carbon/mdi.cpp    |  1 +
 src/mac/mdi.cpp           |  1 +
 src/msw/mdi.cpp           | 11 ++++++++++-
 src/os2/mdi.cpp           |  1 +
 9 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/docs/html/faqgtk.htm b/docs/html/faqgtk.htm
index 54bbdb5c10..c93ebad47e 100644
--- a/docs/html/faqgtk.htm
+++ b/docs/html/faqgtk.htm
@@ -1,4 +1,3 @@
-
 <HTML>
 
 <HEAD>
@@ -24,19 +23,43 @@
 See also <a href="faq.htm">top-level FAQ page</a>.
 <hr>
 <h3>List of questions in this category</h3>
+
+<ul>
 <li><a href="#wxgtk">What is wxWindows 2 for GTK?</a></li>
+<li><a href="#locale">Why doesn&#39;t reading floating point numbers work when using wxWindows?</a></li>
 <li><a href="#gnome">Does wxGTK have GNOME support?</a></li>
 <li><a href="#redhat">Warning about GTK libraries supplied with RedHat</a></li>
 <li><a href="#wxgtk">What is wxWindows 2 for GTK?</a></li>
-<li><a href="#bincompat">What range of Intel Linux platforms will a given application binary be usable on?</li>
+<li><a href="#bincompat">What range of Intel Linux platforms will a given application binary be usable on?</a></li>
+</ul>
 
 <hr>
 
+<h3><a name="wxgtk">What is wxWindows 2 for GTK?</a></h3>
+
 wxWindows 2 for GTK is a port of wxWindows to the <a href="http://www.gimp.org/gtk" target=_top>GTK+ toolkit</a>,
 which is freely available for most flavours of Unix with X. wxWindows 2 for GTK is
 often abbreviated to wxGTK. wxGTK has a separate home page <a href="http://www.freiburg.linux.de/~wxxt" target=_top>here</a>.
 <P>
 
+<h3><a name="locale">Why doesn&#39;t reading floating point numbers work when using wxWindows?</a></h3>
+
+If your program reads the floating point numbers in the format <tt>123.45</tt>
+from a file, it may suddently start returning just <tt>123</tt> instead of the
+correct value on some systems -- which is all the more mysterious as the same
+code in a standalone program works just fine.
+
+<p>
+The explanation is that GTK+ changes the current locale on program startup. If
+the decimal point character in the current locale is not the period (for
+example, it is comma in the French locale), all the standard C functions won&#39;t
+recognize the numbers such as above as floating point ones any more.
+
+<p>
+The solution is to either use your own function for reading the floating point
+numbers (probably the best one) or to call <tt>setlocale(LC_NUMERIC, "C")</tt>
+before reading from file and restore the old locale back afterwards if needed.
+
 <h3><a name="gnome">Does wxGTK have GNOME support?</a></h3>
 
 Currently wxGTK does not have any features that would involve dependence on any desktop
diff --git a/docs/html/faqmac.htm b/docs/html/faqmac.htm
index 722f83ca55..3db0a016a8 100644
--- a/docs/html/faqmac.htm
+++ b/docs/html/faqmac.htm
@@ -34,7 +34,7 @@ See also <a href="faq.htm">top-level FAQ page</a>.
 <li><a href="#filetypesx">How does CVS handle file types/creators under Mac OS X? </a></li>
 <li><a href="#cwpro53">What steps are required to build wxMac using CodeWarrior P ro 5.3?</a></li>
 <li><a href="#buildx">What steps are required to build wxMac under Mac OS X?</a></li>
-<li><a href="#settings">What important settings are required in the CodeWarrior P roject Preferences?</a></li>
+<li><a href="#settings">What important settings are required in the CodeWarrior Project Preferences?</a></li>
 <li><a href="#smarterrors">What are the smart preprocessing errors with the Apple Developer Tools?</a></li>
 <li><a href="#aboutmenu">How does wxMac support the standard Apple About menu item and Help menu?</a></li>
 </ul>
diff --git a/docs/html/faqmsw.htm b/docs/html/faqmsw.htm
index 30970bb620..2c56fedb31 100644
--- a/docs/html/faqmsw.htm
+++ b/docs/html/faqmsw.htm
@@ -1,4 +1,3 @@
-
 <HTML>
 
 <HEAD>
@@ -35,6 +34,7 @@ See also <a href="faq.htm">top-level FAQ page</a>.
 <li><a href="#dll">Can you compile wxWindows 2 as a DLL?</a></li>
 <li><a href="#exesize">How can I reduce executable size?</a></li>
 <li><a href="#mfc">Is wxWindows compatible with MFC?</a></li>
+<li><a href="#asuffix">Why do I get errors about FooBarA when I only use FooBar in my program?</a></li>
 <li><a href="#newerrors">Why my code fails to compile with strange errors about new operator?</a></li>
 <li><a href="#mfcport">How do I port MFC applications to wxWindows?</a></li>
 <li><a href="#crash">Why do I sometimes get bizarre crash problems using VC++ 5/6?</a></li>
@@ -216,6 +216,25 @@ There is a sample which demonstrates MFC and wxWindows code co-existing in the s
 application. However, don&#39;t expect to be able to enable wxWindows windows with OLE-2
 functionality using MFC.<P>
 
+<H3><a name="asuffix">Why do I get errors about FooBarA when I only use FooBar in my program?</H3>
+
+If you get errors like
+<p>
+<center>
+<tt>no matching function for call to &#39;wxDC::DrawTextA(const char[5], int,
+int)&#39;</tt>
+</center>
+<p>
+or similar ones for the other functions, i.e. the compiler error messages
+mention the function with the <tt>&#39;A&#39;</tt> suffix while you didn&#39;t
+use it in your code, the explanation is that you had included
+<tt>&#60;windows.h&#062;</tt> header which redefines many symbols to have such
+suffix (or <tt>&#39;W&#39;</tt> in the Unicode builds).
+
+<p>
+The fix is to either not include <tt>&#60;windows.h&#62;</tt> at all or include
+<tt>"wx/msw/winundef.h"</tt> immediately after it.
+
 <H3><a name="newerrors">Why my code fails to compile with strange errors about new operator?</a></H3>
 
 The most common cause of this problem is the memory debugging settings in
@@ -395,7 +414,7 @@ First, you can use wxRegKey directly, for example:
     regKey.SetName(idName);
 
     {
-        wxLogNull dummy; 
+        wxLogNull dummy;  
         if (!regKey.Create())
         {
             idName = wxT("HKEY_CURRENT_USER\\SOFTWARE\\My Company\\My Product\\Stuff\\");
diff --git a/docs/html/platform.htm b/docs/html/platform.htm
index f9c96fc26b..cb2e2d6feb 100644
--- a/docs/html/platform.htm
+++ b/docs/html/platform.htm
@@ -22,8 +22,8 @@
 
 You will find below the list of all supported platforms for different ports of wxWindows 2.x (wxMSW/wxGTK/wxMotif ports
 only). The cross icon in the third column doesn&#39;t mean that the platform is not supported, but just that wxWindows hasn&#39;t
-been tested on it recently (the table is being updated for wxWindows 2.1.14
-beta currently).
+been tested on it recently (the table is being updated for wxWindows 2.3.3
+currently).
 <p>
 See also:
 
@@ -102,8 +102,8 @@ often don&#39;t work.
 
 <tr>
 <td bgcolor="#F0F0F0" align=center valign=center rowspan=3>AIX</td>
-     <td>wxGTK with AIX CC</td><td align=center><IMG SRC="images/no.gif" ALT=Unknown></td><td><br></td><td><br></td>
-<tr> <td>wxGTK 2.2.9 with gcc 3.0.4</td><td align=center><IMG SRC="images/yes.gif" ALT=Ok></td><td>Ian Brown</td><td>Shared library building doesn&#39;t work, use <tt>--disable-shared</tt></td>
+     <td>wxGTK 2.2.9 with gcc 3.0.4</td><td align=center><IMG SRC="images/yes.gif" ALT=Ok></td><td>Ian Brown</td><td>Shared library building doesn&#39;t work, use <tt>--disable-shared</tt></td>
+<tr> <td>wxGTK 2.3.3 with xlC (AIX 4.3.2)</td><td align=center><IMG SRC="images/yes.gif" ALT=Ok></td><td>Irvin Probst</td><td>Both static and shared wxGTK libraries work, but only with static GTK+ and GLib</td>
 <tr> <td>wxMotif with xlC 3.1.4.0 (AIX 4.2)</td><td align=center><IMG SRC="images/yes.gif" ALT=Ok></td>
                                  <td>Bernhard Eck</td>
                                  <td>Some problems with OpenGL and native X server</td>
diff --git a/docs/latex/wx/hashmap.tex b/docs/latex/wx/hashmap.tex
index 916b4dbe4d..fcaaab9044 100644
--- a/docs/latex/wx/hashmap.tex
+++ b/docs/latex/wx/hashmap.tex
@@ -8,7 +8,7 @@ whose interface is a subset of the interface of STL containers.
 \begin{verbatim}
     class MyClass { /* ... */ };
 
-    // declare an hash map with string keys and int values
+    // declare a hash map with string keys and int values
     WX_DECLARE_STRING_HASH_MAP( int, MyHash5 );
     // same, with int keys and MyClass* values
     WX_DECLARE_HASH_MAP( int, MyClass*, wxIntegerHash, wxIntegerEqual, MyHash1 );
diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp
index 94b0244562..1ce76a692c 100644
--- a/src/mac/carbon/mdi.cpp
+++ b/src/mac/carbon/mdi.cpp
@@ -44,6 +44,7 @@ static const int IDM_WINDOWCASCADE = 4002;
 static const int IDM_WINDOWICONS = 4003;
 static const int IDM_WINDOWNEXT = 4004;
 static const int IDM_WINDOWTILEVERT = 4005;
+static const int IDM_WINDOWPREV = 4006;
 
 // This range gives a maximum of 500 MDI children. Should be enough :-)
 static const int wxFIRST_MDI_CHILD = 4100;
diff --git a/src/mac/mdi.cpp b/src/mac/mdi.cpp
index 94b0244562..1ce76a692c 100644
--- a/src/mac/mdi.cpp
+++ b/src/mac/mdi.cpp
@@ -44,6 +44,7 @@ static const int IDM_WINDOWCASCADE = 4002;
 static const int IDM_WINDOWICONS = 4003;
 static const int IDM_WINDOWNEXT = 4004;
 static const int IDM_WINDOWTILEVERT = 4005;
+static const int IDM_WINDOWPREV = 4006;
 
 // This range gives a maximum of 500 MDI children. Should be enough :-)
 static const int wxFIRST_MDI_CHILD = 4100;
diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp
index 1d295a13dc..611dbbe4ae 100644
--- a/src/msw/mdi.cpp
+++ b/src/msw/mdi.cpp
@@ -82,6 +82,7 @@ static const int IDM_WINDOWCASCADE = 4002;
 static const int IDM_WINDOWICONS = 4003;
 static const int IDM_WINDOWNEXT = 4004;
 static const int IDM_WINDOWTILEVERT = 4005;
+static const int IDM_WINDOWPREV = 4006;
 
 // This range gives a maximum of 500 MDI children. Should be enough :-)
 static const int wxFIRST_MDI_CHILD = 4100;
@@ -188,6 +189,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
       m_windowMenu->AppendSeparator();
       m_windowMenu->Append(IDM_WINDOWICONS, _("&Arrange Icons"));
       m_windowMenu->Append(IDM_WINDOWNEXT, _("&Next"));
+      m_windowMenu->Append(IDM_WINDOWPREV, _("&Previous"));
   }
 
   m_parentFrameActive = TRUE;
@@ -500,6 +502,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
 
     // is it one of standard MDI commands?
     WXWPARAM wParam = 0;
+    WXLPARAM lParam = 0;
     int msg;
     switch ( id )
     {
@@ -525,6 +528,12 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
 
         case IDM_WINDOWNEXT:
             msg = WM_MDINEXT;
+            lParam = 0;         // next child
+            break;
+
+        case IDM_WINDOWPREV:
+            msg = WM_MDINEXT;
+            lParam = 1;         // previous child
             break;
 
         default:
@@ -533,7 +542,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
 
     if ( msg )
     {
-        ::SendMessage(GetWinHwnd(GetClientWindow()), msg, wParam, 0);
+        ::SendMessage(GetWinHwnd(GetClientWindow()), msg, wParam, lParam);
 
         return TRUE;
     }
diff --git a/src/os2/mdi.cpp b/src/os2/mdi.cpp
index 1fccebacb2..70dedddf64 100644
--- a/src/os2/mdi.cpp
+++ b/src/os2/mdi.cpp
@@ -53,6 +53,7 @@ static const int IDM_WINDOWCASCADE = 4002;
 static const int IDM_WINDOWICONS = 4003;
 static const int IDM_WINDOWNEXT = 4004;
 static const int IDM_WINDOWTILEVERT = 4005;
+static const int IDM_WINDOWPREV = 4006;
 
 // This range gives a maximum of 500 MDI children. Should be enough :-)
 static const int wxFIRST_MDI_CHILD = 4100;
-- 
2.50.0

