From c0ab6adfedf92aa4457821422e77c19b80f10bee Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Sun, 14 Nov 1999 14:41:30 +0000
Subject: [PATCH] Watcom C++ fixup in tbar95.cpp; removed WXWIN_COMPATIBILITY
 for 'old' menu constructor and event handling; added wxString version of
 wxGetTempFileName

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 distrib/msw/patch.rsp      |  2 ++
 distrib/msw/zippatch.bat   |  2 +-
 docs/bugs.txt              | 16 ++++++++++++++++
 docs/latex/wx/function.tex |  2 ++
 include/wx/filefn.h        |  2 ++
 include/wx/gtk/menu.h      |  2 --
 include/wx/gtk1/menu.h     |  2 --
 include/wx/menu.h          |  2 +-
 include/wx/motif/menu.h    |  2 --
 include/wx/msw/menu.h      |  2 --
 src/common/filefn.cpp      | 13 ++++++++++++-
 src/gtk/menu.cpp           |  2 --
 src/gtk1/menu.cpp          |  2 --
 src/motif/menu.cpp         |  2 --
 src/msw/menu.cpp           |  2 --
 src/msw/tbar95.cpp         |  2 +-
 16 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/distrib/msw/patch.rsp b/distrib/msw/patch.rsp
index 11d59bf646..2f8d9ba886 100644
--- a/distrib/msw/patch.rsp
+++ b/distrib/msw/patch.rsp
@@ -1,3 +1,5 @@
 include/wx/wxchar.h
 include/wx/msw/setup.h
 samples/dnd/*.wxr
+src/unix/fontutil.cpp
+src/common/fontmap.cpp
diff --git a/distrib/msw/zippatch.bat b/distrib/msw/zippatch.bat
index 77ad4aeee6..a0aaa23855 100755
--- a/distrib/msw/zippatch.bat
+++ b/distrib/msw/zippatch.bat
@@ -5,7 +5,7 @@ set dest=%src\deliver
 set wise=0
 
 Rem Set this to the required patch version
-set version=01
+set version=02
 
 if "%src" == "" goto usage
 if "%dest" == "" goto usage
diff --git a/docs/bugs.txt b/docs/bugs.txt
index 61544ddc9c..8b51e314a3 100644
--- a/docs/bugs.txt
+++ b/docs/bugs.txt
@@ -102,6 +102,22 @@ wxWINDOWS VERSION: wxWindows 2.1.11
 PLATFORMS: Windows + Python 1.5
 DATE IDENTIFIED: 10/11/1999
 IDENTIFIED BY: A.T.Hofkamp
+DATE FIXED: 11/11/1999
+FIXED BY: Vaclav Slavik
+
+BUG NUMBER:             6
+SHORT DESCRIPTION: MSWindows Paths in include files
+DETAILS: I may be wrong, but it looks like all the paths in the
+include files are based on a unix system. The problem is when
+you go to compile VC++6 can't find any of the other includes it
+needs. [Note from JACS: VC++ accepts forward slashes so
+there must be a setup problem.]
+WORKAROUND: Change all the paths in the includes
+wxWINDOWS VERSION: 2.1.11
+PLATFORMS: wxMSW
+DATE IDENTIFIED: 11/11/1999
+IDENTIFIED BY: Mark A Russell <markarussell@earthlink.net>
+
 
 
 ---------------------------END OF BUGLIST-------------------------
diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 68dcaad9c2..0f6e726b22 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -148,6 +148,8 @@ if the buffer is NULL.
 
 \func{char*}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char* }{buf=NULL}}
 
+\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}
+
 Makes a temporary filename based on {\it prefix}, opens and closes the file,
 and places the name in {\it buf}. If {\it buf} is NULL, new store
 is allocated for the temporary filename using {\it new}.
diff --git a/include/wx/filefn.h b/include/wx/filefn.h
index c2e21609ad..8179b6b758 100644
--- a/include/wx/filefn.h
+++ b/include/wx/filefn.h
@@ -98,9 +98,11 @@ WXDLLEXPORT void wxStripExtension(wxString& buffer);
 
 // Get a temporary filename, opening and closing the file.
 WXDLLEXPORT wxChar* wxGetTempFileName(const wxString& prefix, wxChar *buf = (wxChar *) NULL);
+WXDLLEXPORT bool wxGetTempFileName(const wxString& prefix, wxString& buf);
 
 // Expand file name (~/ and ${OPENWINHOME}/ stuff)
 WXDLLEXPORT wxChar* wxExpandPath(wxChar *dest, const wxChar *path);
+WXDLLEXPORT bool wxExpandPath(wxString& dest, const wxChar *path);
 
 // Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
 // and make (if under the home tree) relative to home
diff --git a/include/wx/gtk/menu.h b/include/wx/gtk/menu.h
index 13d2f6b343..c9d198017e 100644
--- a/include/wx/gtk/menu.h
+++ b/include/wx/gtk/menu.h
@@ -77,13 +77,11 @@ public:
 
     // TODO: virtual void SetTitle(const wxString& title);
 
-#if WXWIN_COMPATIBILITY
     wxMenu(const wxString& title, const wxFunction func)
         : wxMenuBase(title)
     {
         Callback(func);
     }
-#endif // WXWIN_COMPATIBILITY
 
     // implementation
     int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
diff --git a/include/wx/gtk1/menu.h b/include/wx/gtk1/menu.h
index 13d2f6b343..c9d198017e 100644
--- a/include/wx/gtk1/menu.h
+++ b/include/wx/gtk1/menu.h
@@ -77,13 +77,11 @@ public:
 
     // TODO: virtual void SetTitle(const wxString& title);
 
-#if WXWIN_COMPATIBILITY
     wxMenu(const wxString& title, const wxFunction func)
         : wxMenuBase(title)
     {
         Callback(func);
     }
-#endif // WXWIN_COMPATIBILITY
 
     // implementation
     int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
diff --git a/include/wx/menu.h b/include/wx/menu.h
index 83576de1cf..8b9bccd5b8 100644
--- a/include/wx/menu.h
+++ b/include/wx/menu.h
@@ -175,12 +175,12 @@ public:
         { return FindItem(itemId, itemMenu); }
 
     wxList& GetItems() const { return (wxList &)m_items; }
+#endif // WXWIN_COMPATIBILITY
 
     // wxWin 1.6x compatible menu event handling
     wxFunction GetCallback() const { return m_callback; }
     void Callback(const wxFunction func) { m_callback = func; }
     wxFunction m_callback;
-#endif // WXWIN_COMPATIBILITY
 
     // unlike FindItem(), this function doesn't recurse but only looks through
     // our direct children and also may return the index of the found child if
diff --git a/include/wx/motif/menu.h b/include/wx/motif/menu.h
index 90fc70ed35..8360a909cd 100644
--- a/include/wx/motif/menu.h
+++ b/include/wx/motif/menu.h
@@ -47,13 +47,11 @@ public:
 
     bool ProcessCommand(wxCommandEvent& event);
 
-#if WXWIN_COMPATIBILITY
     wxMenu(const wxString& title, const wxFunction func)
         : wxMenuBase(title)
     {
         Callback(func);
     }
-#endif // WXWIN_COMPATIBILITY
 
     //// Motif-specific
     WXWidget GetButtonWidget() const { return m_buttonWidget; }
diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h
index c637dd4b4c..9ea6e9a338 100644
--- a/include/wx/msw/menu.h
+++ b/include/wx/msw/menu.h
@@ -52,13 +52,11 @@ public:
     // MSW-specific
     bool ProcessCommand(wxCommandEvent& event);
 
-#if WXWIN_COMPATIBILITY
     wxMenu(const wxString& title, const wxFunction func)
         : wxMenuBase(title)
     {
         Callback(func);
     }
-#endif // WXWIN_COMPATIBILITY
 
     // implementation only from now on
     // -------------------------------
diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
index dc4910db9a..f4a1e78bca 100644
--- a/src/common/filefn.cpp
+++ b/src/common/filefn.cpp
@@ -612,7 +612,6 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
     return wxRealPath(buf);
 }
 
-
 /* Contract Paths to be build upon an environment variable
    component:
 
@@ -1220,6 +1219,18 @@ wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
 #endif
 }
 
+bool wxGetTempFileName(const wxString& prefix, wxString& buf)
+{
+    wxChar buf2[512];
+    if (wxGetTempFileName(prefix, buf2) != (wxChar*) NULL)
+    {
+        buf = buf2;
+        return TRUE;
+    }
+    else
+        return FALSE;
+}
+
 // Get first file name matching given wild card.
 
 #ifdef __UNIX__
diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp
index 4cb9fe2243..cc8b6b0e0c 100644
--- a/src/gtk/menu.cpp
+++ b/src/gtk/menu.cpp
@@ -469,13 +469,11 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
     event.SetEventObject( menu );
     event.SetInt(id );
 
-#if WXWIN_COMPATIBILITY
     if (menu->GetCallback())
     {
         (void) (*(menu->GetCallback())) (*menu, event);
         return;
     }
-#endif // WXWIN_COMPATIBILITY
 
     if (menu->GetEventHandler()->ProcessEvent(event))
         return;
diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp
index 4cb9fe2243..cc8b6b0e0c 100644
--- a/src/gtk1/menu.cpp
+++ b/src/gtk1/menu.cpp
@@ -469,13 +469,11 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
     event.SetEventObject( menu );
     event.SetInt(id );
 
-#if WXWIN_COMPATIBILITY
     if (menu->GetCallback())
     {
         (void) (*(menu->GetCallback())) (*menu, event);
         return;
     }
-#endif // WXWIN_COMPATIBILITY
 
     if (menu->GetEventHandler()->ProcessEvent(event))
         return;
diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp
index af42da70b0..30ca32e4cd 100644
--- a/src/motif/menu.cpp
+++ b/src/motif/menu.cpp
@@ -162,14 +162,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
 {
     bool processed = FALSE;
 
-#if WXWIN_COMPATIBILITY
     // Try a callback
     if (m_callback)
     {
         (void) (*(m_callback)) (*this, event);
         processed = TRUE;
     }
-#endif // WXWIN_COMPATIBILITY
 
     // Try the menu's event handler
     if ( !processed && GetEventHandler())
diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp
index f14522a13b..845c67a0b4 100644
--- a/src/msw/menu.cpp
+++ b/src/msw/menu.cpp
@@ -432,14 +432,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
 {
     bool processed = FALSE;
 
-#if WXWIN_COMPATIBILITY
     // Try a callback
     if (m_callback)
     {
         (void)(*(m_callback))(*this, event);
         processed = TRUE;
     }
-#endif // WXWIN_COMPATIBILITY
 
     // Try the menu's event handler
     if ( !processed && GetEventHandler())
diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp
index 64ca4f176c..4fa77ae7cb 100644
--- a/src/msw/tbar95.cpp
+++ b/src/msw/tbar95.cpp
@@ -399,7 +399,7 @@ bool wxToolBar95::CreateTools()
     delete [] buttons;
 
     // TBBUTTONINFO struct declaration is missing from mingw32 headers
-#ifndef __GNUWIN32__
+#if !defined(__GNUWIN32__) && !defined(__WATCOMC__)
     // adjust the controls size to fit nicely in the toolbar
     size_t nControls = controlIds.GetCount();
     for ( size_t nCtrl = 0; nCtrl < nControls; nCtrl++ )
-- 
2.50.0

