From 660296aa90ad5ecc98c585cc24567cee8130499a Mon Sep 17 00:00:00 2001
From: =?utf8?q?W=C5=82odzimierz=20Skiba?= <abx@abx.art.pl>
Date: Tue, 22 Mar 2005 19:39:54 +0000
Subject: [PATCH] Wrap <commdlgs.h> as <commctls.h>. Required makefiles
 rebuilded.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 Makefile.in               |  1 +
 build/bakefiles/files.bkl |  1 +
 build/msw/wx_base.dsp     |  4 ++++
 include/wx/msw/wrapcdlg.h | 26 ++++++++++++++++++++++++++
 src/common/cmndata.cpp    | 16 +++-------------
 src/common/paper.cpp      | 11 ++++-------
 src/common/prntbase.cpp   |  4 +---
 src/msw/colordlg.cpp      |  5 +----
 src/msw/dc.cpp            |  8 +-------
 src/msw/dcprint.cpp       |  5 +----
 src/msw/dialog.cpp        |  8 +++-----
 src/msw/fdrepdlg.cpp      |  7 +------
 src/msw/filedlg.cpp       |  6 +-----
 src/msw/fontdlg.cpp       |  6 +-----
 src/msw/printdlg.cpp      |  6 ++----
 src/msw/printwin.cpp      |  5 +----
 src/wxWindows.dsp         |  4 ++++
 wxGTK.spec                |  1 +
 wxMotif.spec              |  1 +
 wxX11.spec                |  1 +
 20 files changed, 59 insertions(+), 67 deletions(-)
 create mode 100644 include/wx/msw/wrapcdlg.h

diff --git a/Makefile.in b/Makefile.in
index 9110fb0b6b..97b98f0724 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1348,6 +1348,7 @@ COND_PLATFORM_WIN32_1_BASE_PLATFORM_HDR =  \
 	wx/msw/stackwalk.h \
 	wx/msw/winundef.h \
 	wx/msw/wrapcctl.h \
+	wx/msw/wrapcdlg.h \
 	wx/msw/wrapwin.h \
 	$(BASE_WINCE_HDR)
 @COND_PLATFORM_WIN32_1@BASE_PLATFORM_HDR = $(COND_PLATFORM_WIN32_1_BASE_PLATFORM_HDR)
diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl
index 303084e59e..9128cf3b66 100644
--- a/build/bakefiles/files.bkl
+++ b/build/bakefiles/files.bkl
@@ -116,6 +116,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/msw/stackwalk.h
     wx/msw/winundef.h
     wx/msw/wrapcctl.h
+    wx/msw/wrapcdlg.h
     wx/msw/wrapwin.h
 </set>
 <set var="BASE_WINCE_HDR" hints="files">
diff --git a/build/msw/wx_base.dsp b/build/msw/wx_base.dsp
index a8818d1dde..dc368a9c9b 100644
--- a/build/msw/wx_base.dsp
+++ b/build/msw/wx_base.dsp
@@ -1053,6 +1053,10 @@ SOURCE=..\..\include\wx\msw\wrapcctl.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\include\wx\msw\wrapcdlg.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\wx\msw\wrapwin.h
 # End Source File
 # End Group
diff --git a/include/wx/msw/wrapcdlg.h b/include/wx/msw/wrapcdlg.h
new file mode 100644
index 0000000000..5e87f2790e
--- /dev/null
+++ b/include/wx/msw/wrapcdlg.h
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/msw/wrapcdlg.h
+// Purpose:     Wrapper for the standard <commdlg.h> header
+// Author:      Wlodzimierz ABX Skiba
+// Modified by:
+// Created:     22.03.2005
+// RCS-ID:      $Id$
+// Copyright:   (c) 2005 Wlodzimierz Skiba
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_WRAPCDLG_H_
+#define _WX_MSW_WRAPCDLG_H_
+
+#include "wx/defs.h"
+
+#include "wx/msw/wrapwin.h"
+#include "wx/msw/private.h"
+#include "wx/msw/missing.h"
+
+#if wxUSE_COMMON_DIALOGS && !defined(__SMARTPHONE__) && !defined(__WXMICROWIN__)
+    #include <commdlg.h>
+#endif
+
+#endif // _WX_MSW_WRAPCDLG_H_
+
diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp
index 9c34396f4f..d2d1fee292 100644
--- a/src/common/cmndata.cpp
+++ b/src/common/cmndata.cpp
@@ -50,17 +50,7 @@
 #endif // wxUSE_PRINTING_ARCHITECTURE
 
 #if defined(__WXMSW__)
-    #include <windowsx.h>
-    #include "wx/msw/private.h"
-
-    #ifndef __SMARTPHONE__ /* of WinCE */
-        #include <commdlg.h>
-    #endif
-
-    #if defined(__WATCOMC__) || defined(__SYMANTEC__) || defined(__SALFORDC__)
-        #include <windowsx.h>
-        #include <commdlg.h>
-    #endif
+    #include "wx/msw/wrapcdlg.h"
 #endif // MSW
 
     #if wxUSE_PRINTING_ARCHITECTURE
@@ -187,7 +177,7 @@ wxPrintData::wxPrintData()
 
     m_privData = NULL;
     m_privDataLen = 0;
-    
+
     m_nativeData = wxPrintFactory::GetFactory()->CreatePrintNativeData();
 }
 
@@ -218,7 +208,7 @@ wxPrintData::~wxPrintData()
     m_nativeData->m_ref--;
     if (m_nativeData->m_ref == 0)
         delete m_nativeData;
-        
+
     if (m_privData)
         delete [] m_privData;
 
diff --git a/src/common/paper.cpp b/src/common/paper.cpp
index bad72e6dc2..126dcc282f 100644
--- a/src/common/paper.cpp
+++ b/src/common/paper.cpp
@@ -38,13 +38,10 @@
 #include <string.h>
 
 #ifdef __WXMSW__
-#include "wx/msw/wrapwin.h"
-#include <commdlg.h>
-
-#ifndef __WIN32__
-#include <print.h>
-#endif
-
+    #include "wx/msw/wrapcdlg.h"
+    #ifndef __WIN32__
+        #include <print.h>
+    #endif
 #endif
  // End __WXMSW__
 
diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp
index 6afdf78053..5a308b4950 100644
--- a/src/common/prntbase.cpp
+++ b/src/common/prntbase.cpp
@@ -59,9 +59,7 @@
 #endif
 
 #ifdef __WXMSW__
-    #include "wx/msw/private.h"
-    #include <commdlg.h>
-
+    #include "wx/msw/wrapcdlg.h"
     #ifndef __WIN32__
         #include <print.h>
     #endif
diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp
index cc836963a9..18705d6d08 100644
--- a/src/msw/colordlg.cpp
+++ b/src/msw/colordlg.cpp
@@ -48,10 +48,7 @@
 #include "wx/colordlg.h"
 #include "wx/cmndata.h"
 #include "wx/math.h"
-
-#if !defined(__WIN32__) || defined(__WXWINCE__)
-    #include <commdlg.h>
-#endif
+#include "wx/msw/wrapcdlg.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp
index a56e537832..df9046419a 100644
--- a/src/msw/dc.cpp
+++ b/src/msw/dc.cpp
@@ -41,9 +41,6 @@
     #include "wx/icon.h"
 #endif
 
-#include "wx/msw/private.h" // needs to be before #include <commdlg.h>
-#include "wx/msw/missing.h" // needs to be before #include <commdlg.h>
-
 #include "wx/sysopt.h"
 #include "wx/dcprint.h"
 #include "wx/module.h"
@@ -55,10 +52,7 @@
 
 #include <string.h>
 
-#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__)
-    #include <commdlg.h>
-#endif
-
+#include "wx/msw/wrapcdlg.h"
 #ifndef __WIN32__
     #include <print.h>
 #endif
diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp
index 8636a4447c..bbfd69e358 100644
--- a/src/msw/dcprint.cpp
+++ b/src/msw/dcprint.cpp
@@ -48,10 +48,7 @@
 #include "wx/msw/printdlg.h"
 #include "wx/math.h"
 
-#if wxUSE_COMMON_DIALOGS
-    #include <commdlg.h>
-#endif
-
+#include "wx/msw/wrapcdlg.h"
 #ifndef __WIN32__
     #include <print.h>
 #endif
diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp
index 33f2cbf86f..cda785f0b3 100644
--- a/src/msw/dialog.cpp
+++ b/src/msw/dialog.cpp
@@ -43,9 +43,7 @@
 #include "wx/evtloop.h"
 #include "wx/ptr_scpd.h"
 
-#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__)
-    #include <commdlg.h>
-#endif
+#include "wx/msw/wrapcdlg.h"
 
 #if defined(__SMARTPHONE__) && defined(__WXWINCE__)
     #include "wx/msw/wince/resources.h"
@@ -463,7 +461,7 @@ bool wxDialog::DoOK()
         event.SetEventObject(this);
 
         return GetEventHandler()->ProcessEvent(event);
-    }    
+    }
 }
 #endif
 
@@ -484,7 +482,7 @@ wxToolBar *wxDialog::OnCreateToolBar(long style,
     return new wxToolMenuBar(this, winid,
                          wxDefaultPosition, wxDefaultSize,
                          style, name);
-}                                        
+}
 #endif
 
 // ---------------------------------------------------------------------------
diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp
index 81e37f95dd..7eab0dae8d 100644
--- a/src/msw/fdrepdlg.cpp
+++ b/src/msw/fdrepdlg.cpp
@@ -35,12 +35,7 @@
     #include "wx/log.h"
 #endif
 
-#include "wx/msw/private.h"
-
-#if !defined(__WIN32__) || defined(__WXWINCE__)
-    #include <commdlg.h>
-#endif
-
+#include "wx/msw/wrapcdlg.h"
 #include "wx/fdrepdlg.h"
 
 // ----------------------------------------------------------------------------
diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp
index 0cde93995b..abf12be798 100644
--- a/src/msw/filedlg.cpp
+++ b/src/msw/filedlg.cpp
@@ -40,11 +40,7 @@
     #include "wx/app.h"
 #endif
 
-#include "wx/msw/private.h"
-
-#if !defined(__WIN32__) || defined(__WXWINCE__)
-    #include <commdlg.h>
-#endif
+#include "wx/msw/wrapcdlg.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp
index fefc22adb6..0ed3416676 100644
--- a/src/msw/fontdlg.cpp
+++ b/src/msw/fontdlg.cpp
@@ -37,11 +37,7 @@
 #endif
 
 #include "wx/fontdlg.h"
-#include "wx/msw/private.h"
-
-#if !defined(__WIN32__) || defined(__WXWINCE__)
-#include <commdlg.h>
-#endif
+#include "wx/msw/wrapcdlg.h"
 
 #include "wx/cmndata.h"
 #include "wx/log.h"
diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp
index 6a8457f3c3..02892c4510 100644
--- a/src/msw/printdlg.cpp
+++ b/src/msw/printdlg.cpp
@@ -44,9 +44,7 @@
 
 #include <stdlib.h>
 
-#include "wx/msw/private.h"
-
-#include <commdlg.h>
+#include "wx/msw/wrapcdlg.h"
 
 #ifndef __WIN32__
     #include <print.h>
@@ -302,7 +300,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
             wxString printerName = (LPTSTR)lpDevNames + lpDevNames->wDeviceOffset;
 
             // Not sure if we should check for this mismatch
-//            wxASSERT_MSG( (m_printerName == "" || (devName == m_printerName)), "Printer name obtained from DEVMODE and DEVNAMES were different!");
+//            wxASSERT_MSG( (m_printerName.empty() || (devName == m_printerName)), "Printer name obtained from DEVMODE and DEVNAMES were different!");
 
             if (!printerName.empty())
                 data.SetPrinterName( printerName );
diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp
index cd496d3291..ba0590e1d0 100644
--- a/src/msw/printwin.cpp
+++ b/src/msw/printwin.cpp
@@ -52,10 +52,7 @@
 
 #include <stdlib.h>
 
-#include "wx/msw/private.h"
-
-#include <commdlg.h>
-
+#include "wx/msw/wrapcdlg.h"
 #ifndef __WIN32__
     #include <print.h>
 #endif
diff --git a/src/wxWindows.dsp b/src/wxWindows.dsp
index 2f432a144e..3050a4741f 100644
--- a/src/wxWindows.dsp
+++ b/src/wxWindows.dsp
@@ -3651,6 +3651,10 @@ SOURCE=..\include\wx\msw\wrapcctl.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\include\wx\msw\wrapcdlg.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\include\wx\msw\wrapwin.h
 # End Source File
 # End Group
diff --git a/wxGTK.spec b/wxGTK.spec
index b2df265827..3285bc6e0a 100644
--- a/wxGTK.spec
+++ b/wxGTK.spec
@@ -276,6 +276,7 @@ wx/msw/mimetype.h
 wx/msw/stackwalk.h
 wx/msw/winundef.h
 wx/msw/wrapcctl.h
+wx/msw/wrapcdlg.h
 wx/msw/wrapwin.h
 wx/fs_inet.h
 wx/gsocket.h
diff --git a/wxMotif.spec b/wxMotif.spec
index 0356921ef9..f3992b7598 100644
--- a/wxMotif.spec
+++ b/wxMotif.spec
@@ -204,6 +204,7 @@ wx/msw/mimetype.h
 wx/msw/stackwalk.h
 wx/msw/winundef.h
 wx/msw/wrapcctl.h
+wx/msw/wrapcdlg.h
 wx/msw/wrapwin.h
 wx/fs_inet.h
 wx/gsocket.h
diff --git a/wxX11.spec b/wxX11.spec
index 7b49d8f5a6..5858533ba8 100644
--- a/wxX11.spec
+++ b/wxX11.spec
@@ -255,6 +255,7 @@ wx/msw/mimetype.h
 wx/msw/stackwalk.h
 wx/msw/winundef.h
 wx/msw/wrapcctl.h
+wx/msw/wrapcdlg.h
 wx/msw/wrapwin.h
 wx/fs_inet.h
 wx/gsocket.h
-- 
2.47.2