From 3ca6a5f04692678cd2d9f3ea0843fc3f5a0b254f Mon Sep 17 00:00:00 2001
From: Bryan Petty <bryan@ibaku.net>
Date: Tue, 8 Aug 2000 06:11:51 +0000
Subject: [PATCH] second merge of the 2.2 branch (RL)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 debian/control.in                 |   17 +-
 debian/rules                      |   28 +-
 debian/wxwin-i18n.dirs            |    2 +
 debian/wxwin-i18n.docs            |    2 +
 debian/wxwin-i18n.files           |    2 +
 distrib/msw/expdwild.bat          |   15 +
 distrib/msw/filerepl.bat          |   27 +
 distrib/msw/tmake/filelist.txt    |    2 +-
 distrib/msw/tmake/vc.t            |    6 +-
 distrib/msw/tmake/vc6.t           |    8 +-
 distrib/msw/tmake/vc6bdll.t       |   16 +-
 distrib/msw/tmake/vc6dll.t        |   23 +-
 distrib/msw/tmake/vcapp.t         |   43 +-
 distrib/msw/vcupdate.bat          |    9 +
 docs/gtk/changes.txt              |   23 +-
 docs/html/news.htm                |   10 +
 docs/html/platform.htm            |    4 +-
 docs/latex/wx/cmdevent.tex        |   20 +-
 docs/latex/wx/combobox.tex        |    8 +-
 docs/latex/wx/database.tex        |    9 +-
 docs/latex/wx/db.tex              |  993 +++++++++++++++++++++++++-
 docs/latex/wx/gridwork.tex        |   59 ++
 docs/latex/wx/image.tex           |   19 +
 docs/latex/wx/locale.tex          |   60 +-
 docs/latex/wx/spinbutt.tex        |    3 +
 docs/latex/wx/tconstr.tex         |   13 +-
 docs/latex/wx/textfile.tex        |   21 +-
 docs/latex/wx/toolbar.tex         |    6 +-
 docs/latex/wx/upduievt.tex        |    3 +-
 docs/tech/tn0003.txt              |    9 +
 include/wx/db.h                   |   30 +-
 include/wx/dbtable.h              |   54 +-
 include/wx/defs.h                 |    3 +-
 include/wx/event.h                |   14 +-
 include/wx/intl.h                 |    7 +-
 include/wx/msw/minifram.h         |   60 +-
 include/wx/msw/radiobox.h         |    8 +
 include/wx/msw/setup0.h           |  250 +++++--
 include/wx/tbarbase.h             |   10 +
 lib/wx22.def                      |  198 ++++--
 locale/cs.po                      |  185 ++---
 samples/console/console.cpp       |  110 ++-
 samples/controls/controls.cpp     |    2 +-
 samples/db/dbtest.cpp             |  716 ++++++++++---------
 samples/db/dbtest.h               |   24 +-
 samples/db/listdb.cpp             |   12 +-
 samples/dialogs/dialogs.cpp       |    2 +-
 samples/drawing/drawing.cpp       |   15 +-
 samples/help/doc.chm              |  Bin 13434 -> 8845 bytes
 samples/menu/menu.cpp             |   57 +-
 src/common/base.rc                |   49 ++
 src/common/datetime.cpp           |  110 +--
 src/common/db.cpp                 | 1075 +++++++++++++++++------------
 src/common/dbtable.cpp            |  787 +++++++++++----------
 src/common/docview.cpp            |   24 +-
 src/common/dynlib.cpp             |    1 -
 src/common/fontmap.cpp            |   24 +-
 src/common/framecmn.cpp           |   10 +-
 src/common/fs_zip.cpp             |    9 +-
 src/common/gifdecod.cpp           |    2 +-
 src/common/hash.cpp               |    8 +-
 src/common/image.cpp              |   10 +-
 src/common/imagjpeg.cpp           |   15 +-
 src/common/imagpng.cpp            |   11 +-
 src/common/sizer.cpp              |  334 ++++-----
 src/common/unzip.c                |    5 +
 src/common/utilscmn.cpp           |   20 +-
 src/common/valgen.cpp             |  149 ++--
 src/generic/choicdgg.cpp          |   21 +-
 src/generic/dcpsg.cpp             |   35 +-
 src/generic/grid.cpp              |   11 +-
 src/generic/listctrl.cpp          |   10 +-
 src/gtk/combobox.cpp              |    6 +-
 src/gtk/dcclient.cpp              |  106 ++-
 src/gtk/menu.cpp                  |   22 +-
 src/gtk/statline.cpp              |   26 +-
 src/gtk/textctrl.cpp              |    2 +
 src/gtk/win_gtk.c                 |    7 +-
 src/gtk1/combobox.cpp             |    6 +-
 src/gtk1/dcclient.cpp             |  106 ++-
 src/gtk1/menu.cpp                 |   22 +-
 src/gtk1/statline.cpp             |   26 +-
 src/gtk1/textctrl.cpp             |    2 +
 src/gtk1/win_gtk.c                |    7 +-
 src/html/htmlfilt.cpp             |    2 +-
 src/html/htmprint.cpp             |   26 +-
 src/msw/filedlg.cpp               |   28 +-
 src/msw/font.cpp                  |   15 +-
 src/msw/frame.cpp                 |   23 +-
 src/msw/gsocket.c                 |    2 +-
 src/msw/imaglist.cpp              |   46 +-
 src/msw/listctrl.cpp              |    7 +-
 src/msw/makefile.vc               |    9 +-
 src/msw/mdi.cpp                   |   38 +-
 src/msw/menu.cpp                  |   12 +-
 src/msw/nativdlg.cpp              |    6 +-
 src/msw/ole/automtn.cpp           |    8 +-
 src/msw/radiobox.cpp              |  312 ++++++---
 src/msw/radiobut.cpp              |    1 +
 src/msw/settings.cpp              |    1 -
 src/msw/version.rc                |   34 +-
 src/msw/window.cpp                |    8 +-
 src/msw/xpmhand.cpp               |    3 +-
 src/xpm/RdFToI.c                  |    3 +-
 wxPython/.cvsignore               |    1 +
 wxPython/BUILD.txt                |   12 +-
 wxPython/CHANGES.txt              |    7 +
 wxPython/demo/About.py            |    2 +-
 wxPython/demo/GridSimple.py       |    3 +
 wxPython/demo/Main.py             |    1 +
 wxPython/demo/wxScrolledWindow.py |    2 +-
 wxPython/distrib/autobuild.py     |    4 +-
 wxPython/distrib/build.py         |    4 +-
 wxPython/distrib/wxPython.WSM     |  Bin 33 -> 33 bytes
 wxPython/distrib/wxPython.spec    |    4 +-
 wxPython/distrib/wxPython.wse     |   12 +-
 wxPython/src/__version__.py       |    2 +-
 wxPython/src/clip_dnd.i           |    5 +-
 wxPython/src/events.i             |    3 +-
 wxPython/src/gtk/events.cpp       |   13 +-
 wxPython/src/gtk/events.py        |    3 +
 wxPython/src/gtk/mdi.cpp          |    2 +
 wxPython/src/gtk/printfw.cpp      |   16 +-
 wxPython/src/gtk/windows.cpp      |   58 ++
 wxPython/src/gtk/windows.py       |    6 +
 wxPython/src/mdi.i                |    3 +
 wxPython/src/msw/clip_dnd.cpp     |   41 ++
 wxPython/src/msw/clip_dnd.py      |    3 +
 wxPython/src/msw/events.cpp       |   13 +-
 wxPython/src/msw/events.py        |    3 +
 wxPython/src/msw/mdi.cpp          |   72 ++
 wxPython/src/msw/mdi.py           |    7 +
 wxPython/src/msw/printfw.cpp      |   14 +-
 wxPython/src/msw/windows.cpp      |   58 ++
 wxPython/src/msw/windows.py       |    6 +
 wxPython/src/printfw.i            |    2 +-
 wxPython/src/windows.i            |    2 +
 wxPython/wxPython/lib/pyshell.py  |   10 +-
 138 files changed, 4958 insertions(+), 2295 deletions(-)
 create mode 100644 debian/wxwin-i18n.dirs
 create mode 100644 debian/wxwin-i18n.docs
 create mode 100644 debian/wxwin-i18n.files
 create mode 100755 distrib/msw/expdwild.bat
 create mode 100755 distrib/msw/filerepl.bat
 create mode 100755 distrib/msw/vcupdate.bat
 create mode 100644 docs/latex/wx/gridwork.tex
 create mode 100644 src/common/base.rc

diff --git a/debian/control.in b/debian/control.in
index 535ce2d60e..78203579a0 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -1,7 +1,7 @@
 Source: wxwindows=V
 Section: libs
 Priority: optional
-Build-Depends: debhelper, flex, bison, libgtk1.2-dev, python-dev (>=1.5), zlib1g-dev, libjpeg62-dev, libpng2-dev, libtiff3g-dev, mesag-dev
+Build-Depends: debhelper, flex, bison, libgtk1.2-dev, python-dev (>=1.5.2), zlib1g-dev, libjpeg62-dev, libpng2-dev, libtiff3g-dev, mesag-dev
 Maintainer: Ron Lee <ron@debian.org>
 Standards-Version: 3.1.1
 
@@ -107,7 +107,7 @@ Description: wxWindows Cross-platform C++ GUI toolkit (GTK+ development)
 Package: libwxgtk=V-python
 Architecture: any
 Section: interpreters
-Depends: libwxgtk=V (= ${Source-Version}), python-base (>=1.5), ${shlibs:Depends}
+Depends: libwxgtk=V (= ${Source-Version}), python-base (>=1.5.2), ${shlibs:Depends}
 Suggests: wxwin=V-doc
 Description: wxWindows Cross-platform C++ GUI toolkit (Python binding)
  wxWindows is a class library for C++ providing GUI (Graphical User
@@ -157,6 +157,19 @@ Description: wxWindows Cross-platform C++ GUI toolkit (header files)
  This package provides the common header files required to build applications
  using the wxWindows toolkit.
 
+Package: wxwin=V-i18n
+Architecture: all
+Section: libs
+Conflicts: wxwin-i18n
+Replaces: wxwin-i18n
+Provides: wxwin-i18n
+Description: wxWindows Cross-platform C++ GUI toolkit (i18n support)
+ wxWindows is a class library for C++ providing GUI (Graphical User
+ Interface) and other facilities on more than one platform.  Version =V
+ currently supports subsets of GTK+, Motif, and MS Windows.
+ .
+ This package provides the i18n message catalogs for wxWindows.
+
 Package: wxwin=V-doc
 Architecture: all
 Section: doc
diff --git a/debian/rules b/debian/rules
index df58c43300..38ed021b45 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,6 +23,7 @@ package_gtk_py=libwxgtk$(release)-python
 package_gtk_contrib=libwxgtk$(release)-contrib
 package_gtk_contrib_dev=libwxgtk$(release)-contrib-dev
 package_headers=wxwin$(release)-headers
+package_i18n=wxwin$(release)-i18n
 package_doc=wxwin$(release)-doc
 package_examples=wxwin$(release)-examples
 
@@ -36,6 +37,7 @@ objdir_gtk_debug=objs_gtk_d
 objdir_doc_cruft=objs_doc_con
 objdir_doc=docs/wxWindows-manual.html
 objdir_examples=docs/examples
+objdir_i18n=locale
 objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_wxbase_debug) \
 	$(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) \
 	$(objdir_doc) $(objdir_examples)
@@ -44,12 +46,13 @@ build_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
              build-wxbase-debug-stamp build-gtk-shared-stamp \
              build-gtk-static-stamp build-gtk-debug-stamp \
              build-contrib-shared-stamp build-contrib-static-stamp \
-             build-gtk-python-stamp build-examples-stamp build-doc-stamp
+             build-gtk-python-stamp build-examples-stamp build-doc-stamp \
+             build-i18n-stamp
 
 install_all=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
             install-gtk-lib install-gtk-dev install-gtk-dbg \
             install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
-            install-headers install-doc install-examples
+            install-headers install-i18n install-doc install-examples
 
 wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
 		--prefix=$(shell pwd) \
@@ -106,6 +109,10 @@ control-files-stamp: debian/control debian/wxwin-doc.doc-base
 		echo "generating control file $(package_headers).$$f"; \
 		cp debian/wxwin-headers.$$f debian/$(package_headers).$$f; \
 	done;
+	@for f in dirs docs files; do \
+		echo "generating control file $(package_i18n).$$f"; \
+		cp debian/wxwin-i18n.$$f debian/$(package_i18n).$$f; \
+	done;
 	@for f in dirs docs doc-base; do \
 		echo "generating control file $(package_doc).$$f"; \
 		cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
@@ -250,6 +257,12 @@ build-examples-stamp:
 	done;
 	touch $@
 
+build-i18n-stamp: build-gtk-shared-stamp
+	dh_testdir
+	cd $(objdir_i18n) \
+		&& $(MAKE) allmo
+	touch $@
+
 clean: debian/control
 	dh_testdir
 	dh_testroot
@@ -266,6 +279,7 @@ clean: debian/control
 	rm -f debian/$(package_gtk_contrib).*
 	rm -f debian/$(package_gtk_contrib_dev).*
 	rm -f debian/$(package_headers).*
+	rm -f debian/$(package_i18n).*
 	rm -f debian/$(package_doc).*
 	rm -f debian/$(package_examples).*
 
@@ -375,6 +389,14 @@ install-headers: install-gtk-lib
 		zlib.3     \
 		png.5
 
+install-i18n: DH_OPTIONS=-p$(package_i18n)
+install-i18n: build-i18n-stamp install-gtk-lib
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	dh_movefiles --sourcedir=debian/$(package_gtk_lib)
+
 install-doc: DH_OPTIONS=-p$(package_doc)
 install-doc: build-doc-stamp
 	dh_testdir
@@ -461,5 +483,5 @@ binary-doc: control-files-stamp install-doc
 	binary-wxbase-dbg binary-doc install install-wxbase-lib \
 	install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
 	install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
-	install-gtk-py install-headers install-doc install-examples
+	install-gtk-py install-headers install-i18n install-doc install-examples
 
diff --git a/debian/wxwin-i18n.dirs b/debian/wxwin-i18n.dirs
new file mode 100644
index 0000000000..d10fb40c7b
--- /dev/null
+++ b/debian/wxwin-i18n.dirs
@@ -0,0 +1,2 @@
+/usr/share/locale
+
diff --git a/debian/wxwin-i18n.docs b/debian/wxwin-i18n.docs
new file mode 100644
index 0000000000..4c4d01649e
--- /dev/null
+++ b/debian/wxwin-i18n.docs
@@ -0,0 +1,2 @@
+docs/licence.txt
+
diff --git a/debian/wxwin-i18n.files b/debian/wxwin-i18n.files
new file mode 100644
index 0000000000..39825b2213
--- /dev/null
+++ b/debian/wxwin-i18n.files
@@ -0,0 +1,2 @@
+/usr/share/locale/
+
diff --git a/distrib/msw/expdwild.bat b/distrib/msw/expdwild.bat
new file mode 100755
index 0000000000..34974a61d7
--- /dev/null
+++ b/distrib/msw/expdwild.bat
@@ -0,0 +1,15 @@
+@echo off
+rem Expands wildcards in response file (arg 1) into output file (arg 2)
+rem Note: requires ls.exe from GNU-WIN32 distribution, renamed to ls2.exe.
+rem Correction: this is too slow, so we're using the built in 'dir'.
+
+set newname=%temp\temp.tmp
+sed -e "s/\//\\/g" %1 > %newname
+
+set len=%@LINES[%newname]
+rem set len=%@DEC[%len]
+do i = 0 to %len by 1
+  set line=%@LINE[%newname,%i]
+  if NOT "%line" == "" dir /FB %line >> %2
+enddo
+
diff --git a/distrib/msw/filerepl.bat b/distrib/msw/filerepl.bat
new file mode 100755
index 0000000000..815fc0b19b
--- /dev/null
+++ b/distrib/msw/filerepl.bat
@@ -0,0 +1,27 @@
+@echo off
+Rem Replace a string with another string in the given files.
+Rem The first argument is the string to be replaced.
+Rem The second argument is the replacement string.
+Rem The third argument is a file listing the files to be processed.
+
+set keyword=%1
+set repl=%2
+set files=%3
+echo s/%keyword/%repl/g > script.tmp
+
+call %wxwin\distrib\msw\expdwild.bat %3 list.tmp
+
+set len=%@LINES[%files]
+do i = 0 to %len by 1
+  set line=%@LINE[list.tmp,%i]
+  if "%line" == "**EOF**" enddo
+rem  echo Cmd: grep %keyword %line
+  grep %keyword %line > size.tmp
+  if "%@FILESIZE[size.tmp]" == "0" enddo
+  sed -f script.tmp %line > file.tmp
+  move file.tmp %line
+enddo
+erase script.tmp
+erase list.tmp
+erase size.tmp
+:end
diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt
index 87814a64d9..d21c284737 100644
--- a/distrib/msw/tmake/filelist.txt
+++ b/distrib/msw/tmake/filelist.txt
@@ -96,7 +96,7 @@ splash.cpp	G
 splitter.cpp	G
 statline.cpp	G	U,R,P
 statusbr.cpp	G
-tabg.cpp	G	P
+tabg.cpp	G	16,P
 numdlgg.cpp	G
 tbarsmpl.cpp	G
 textdlgg.cpp	G
diff --git a/distrib/msw/tmake/vc.t b/distrib/msw/tmake/vc.t
index 4422ad0267..58026c0d84 100644
--- a/distrib/msw/tmake/vc.t
+++ b/distrib/msw/tmake/vc.t
@@ -79,9 +79,6 @@ LIBTARGET=$(WXLIB)
 DUMMYOBJ=$D\dummy.obj
 !endif
 
-# Please set these according to the settings in setup.h, so we can include
-# the appropriate libraries in wx.lib
-
 # This one overrides the others, to be consistent with the settings in setup.h
 MINIMAL_WXWINDOWS_SETUP=0
 
@@ -89,6 +86,9 @@ PERIPH_LIBS=
 PERIPH_TARGET=
 PERIPH_CLEAN_TARGET=
 
+# Set to 0 if not using GLCanvas (only affects DLL build)
+USE_GLCANVAS=1
+
 # These are absolute paths, so that the compiler
 # generates correct __FILE__ symbols for debugging.
 # Otherwise you don't be able to double-click on a memory
diff --git a/distrib/msw/tmake/vc6.t b/distrib/msw/tmake/vc6.t
index 665f35329a..9359c9e654 100644
--- a/distrib/msw/tmake/vc6.t
+++ b/distrib/msw/tmake/vc6.t
@@ -80,8 +80,8 @@ RSC=rc.exe
 # PROP Output_Dir "Release"
 # PROP Intermediate_Dir "Release"
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MT" /YX /FD /c
-# ADD CPP /nologo /MT /W4 /Zi /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /D "NDEBUG" /D wxUSE_GUI=1 /D WIN95=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN32__" /D "_MT" /Yu"wx/wxprec.h" /FD /c
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MT" /YX /FD /c
+# ADD CPP /nologo /MD /W4 /Zi /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "NDEBUG" /D wxUSE_GUI=1 /D WIN95=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN32__" /D "_MT" /Yu"wx/wxprec.h" /FD /c
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
@@ -103,8 +103,8 @@ LIB32=link.exe -lib
 # PROP Output_Dir "Debug"
 # PROP Intermediate_Dir "Debug"
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" -D "_MT" /YX /FD /c
-# ADD CPP /nologo /MTd /W4 /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D DEBUG=1 /D WXDEBUG=1 /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /Fr /D "_MT" /Yu"wx/wxprec.h" /FD /c
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" -D "_MT" /YX /FD /c
+# ADD CPP /nologo /MDd /W4 /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "_DEBUG" /D DEBUG=1 /D WXDEBUG=1 /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /Fr /D "_MT" /Yu"wx/wxprec.h" /FD /c
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
diff --git a/distrib/msw/tmake/vc6bdll.t b/distrib/msw/tmake/vc6bdll.t
index 8ed6d304af..ef85135667 100644
--- a/distrib/msw/tmake/vc6bdll.t
+++ b/distrib/msw/tmake/vc6bdll.t
@@ -85,8 +85,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /machine:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"BaseDllRelease/wxbase221.dll"
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /machine:I386 /out:"BaseDllRelease/wxbase221.dll"
 
 !ELSEIF  "$(CFG)" == "wxBaseDll - Win32 Debug"
 
@@ -101,8 +101,8 @@ LINK32=link.exe
 # PROP Intermediate_Dir "BaseDllDebug"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXBASEDLL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W4 /Gm /ZI /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D wxUSE_GUI=0 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /D "_MT" /D "WXMAKINGDLL" /D "__WXDEBUG__" /Yu"wx/wxprec.h" /FD /GZ /c
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXBASEDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W4 /Gm /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D wxUSE_GUI=0 /D "__WIN95__" /D "WIN32" /D "_WIN32" /D WINVER=0x400 /D "__WINDOWS__" /D "__WIN32__" /D "__WXMSW__" /D "_MT" /D "WXMAKINGDLL" /D "__WXDEBUG__" /Yu"wx/wxprec.h" /FD /GZ /c
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -111,8 +111,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"BaseDllDebug/wxbase221d.dll"
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib wsock32.lib /nologo /version:2.2 /dll /debug /machine:I386 /pdbtype:sept /out:"BaseDllDebug/wxbase221d.dll"
 
 !ENDIF 
 
@@ -122,6 +122,10 @@ LINK32=link.exe
 # Name "wxBaseDll - Win32 Debug"
 # Begin Source File
 
+SOURCE=.\src\common\base.rc
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\msw\dummydll.cpp
 # ADD CPP /Yc"wx/wxprec.h"
 # End Source File
diff --git a/distrib/msw/tmake/vc6dll.t b/distrib/msw/tmake/vc6dll.t
index 19bf5b936a..133cdbc56b 100644
--- a/distrib/msw/tmake/vc6dll.t
+++ b/distrib/msw/tmake/vc6dll.t
@@ -83,17 +83,17 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MD /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W4 /GX /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /D "NDEBUG" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
+# ADD CPP /nologo /MD /W4 /GX /O2 /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "NDEBUG" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /i "$(wx)\include" /d "NDEBUG"
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib winmm.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib src\jpeg\Release\jpeg.lib src\tiff\Release\tiff.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386 /out:"ReleaseDll/wxmsw221.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\jpeg\Release\jpeg.lib src\tiff\Release\tiff.lib src\png\Release\png.lib src\xpm\Release\xpm.lib src\zlib\Release\zlib.lib /nologo /dll /machine:I386 /out:"ReleaseDll/wxmsw221.dll"
 
 !ELSEIF  "$(CFG)" == "wxWinDll - Win32 Debug"
 
@@ -108,18 +108,18 @@ LINK32=link.exe
 # PROP Intermediate_Dir "DebugDLL"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W4 /Gm /ZI /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /D "_DEBUG" /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /GZ /c
+# ADD BASE CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "$(wx)\include" /I "$(wx)\src\zlib" /I "$(wx)\src\jpeg" /I "$(wx)\src\png" /I "$(wx)\src\tiff" /D "_DEBUG" /D "__WXDEBUG__" /D wxUSE_GUI=1 /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /D "__WXMSW__" /D "__WIN95__" /D "__WINDOWS__" /D "__WIN32__" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /GZ /c
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "$(wx)\include" /d "_DEBUG"
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib src\jpeg\Debug\jpeg.lib src\tiff\Debug\tiff.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /dll /debug /machine:I386 /pdbtype:sept /out:"DebugDll/wxmsw221d.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib src\jpeg\Debug\jpeg.lib src\tiff\Debug\tiff.lib src\png\Debug\png.lib src\xpm\Debug\xpm.lib src\zlib\Debug\zlib.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"DebugDll/wxmsw221d.dll"
 
 !ENDIF 
 
@@ -144,10 +144,15 @@ SOURCE=.\src\msw\dummydll.cpp
 
 # Begin Source File
 
+SOURCE=.\src\msw\version.rc
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\common\y_tab.c
 
 !IF  "$(CFG)" == "wxWinDll - Win32 Release"
 
+# ADD CPP /W1
 # SUBTRACT CPP /YX /Yc /Yu
 
 !ELSEIF  "$(CFG)" == "wxWinDll - Win32 Debug"
diff --git a/distrib/msw/tmake/vcapp.t b/distrib/msw/tmake/vcapp.t
index afc6a86cea..2a0d20746c 100644
--- a/distrib/msw/tmake/vcapp.t
+++ b/distrib/msw/tmake/vcapp.t
@@ -30,20 +30,26 @@
     if ( Config("wx") ) {
 	#! VC 6.0 supports env vars in include path
 	#! $WXDIR = $ENV{'WX'};
-	$WXDIR = "\$(WX)";
+	if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
+	else { $WXDIR = "\$(WXWIN)"; }
 	$TMAKE_INCDIR_WX = $WXDIR . "\\include";
 	AddIncludePath($TMAKE_INCDIR_WX);
     }
 
     if ( Config("dll") ) {
 	$DLL="Dll";
-	$DLL_OR_LIB="wxWinDll";
+	$DLL_SUFFIX="d";
+	$DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
 	$DLL_FLAGS="/D WXUSINGDLL ";
+	$EXTRA_LIBS="";
     }
     else {
 	$DLL="";
+	$DLL_SUFFIX="";
 	$DLL_OR_LIB="wxWindows";
 	$DLL_FLAGS=" ";
+	#! actually this depends on the contents of setup.h
+	$EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
     }
 
     #! let's be smarter: first of all, if no extension is given, add .lib
@@ -64,12 +70,21 @@
 	if ( Config("wx") ) {
 	    $vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
 
-	    $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Release\\xpm.lib ";
-	    $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Debug\\xpm.lib "; 
+	    $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib ";
+	    $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB$DLL_SUFFIX.lib ";
+	    foreach ( split(/ /, $EXTRA_LIBS) ) {
+		$vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
+		$vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
+	    }
 	}
 	$vc_link_release .= '/nologo /subsystem:windows /machine:I386';
 	$vc_link_debug   .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
 
+	foreach ( split(/ /, Project('LIBPATH')) ) {
+	    $vc_link_release .= " /libpath:$_\\Release";
+	    $vc_link_debug .= " /libpath:$_\\Debug";
+	}
+
 	$vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $DLL_FLAGS;
 	$vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
 	$vc_cpp_def_debug   = '/D "_DEBUG" ' . $vc_cpp_def_common;
@@ -79,8 +94,8 @@
 	$vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
 	if ( Config("wx") ) {
 	    $vc_base_libs .= 'wsock32.lib ';
-	    $vc_link_release = "$WXDIR\\Base${DLL}Release\\wxBase$DLL.lib ";
-	    $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\wxBase$DLL.lib "; 
+	    $vc_link_release = "$WXDIR\\Base${DLL}Release\\$DLL_OR_LIB.lib ";
+	    $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\$DLL_OR_LIB" . "d.lib ";
 	}
 	$vc_link_release .= '/nologo /subsystem:console /machine:I386';
 	$vc_link_debug   .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
@@ -205,13 +220,13 @@ RSC=rc.exe
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir "Release#$ $text = "$DLL" . '"'
+# PROP BASE Intermediate_Dir "Release#$ $text = "$DLL" . '"'
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "Release#$ $text = "$DLL" . '"'
+# PROP Intermediate_Dir "Release#$ $text = "$DLL" . '"'
 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
 # PROP Target_Dir ""
 # ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
@@ -233,13 +248,13 @@ LINK32=link.exe
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Output_Dir "Debug#$ $text = "$DLL" . '"'
+# PROP BASE Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "Debug#$ $text = "$DLL" . '"'
+# PROP Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
 # PROP Target_Dir ""
 # ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
diff --git a/distrib/msw/vcupdate.bat b/distrib/msw/vcupdate.bat
new file mode 100755
index 0000000000..399a6d73ee
--- /dev/null
+++ b/distrib/msw/vcupdate.bat
@@ -0,0 +1,9 @@
+@echo off
+Rem Replace the DLL version number in the VC++ project files
+
+input Enter the old version name (e.g. wx22_0): %%oldName
+input Enter the new version name (e.g. wx22_1): %%newName
+
+call %wxwin\distrib\msw\filerepl.bat %oldName %newName %wxwin\distrib\msw\vc.rsp
+echo Done.
+
diff --git a/docs/gtk/changes.txt b/docs/gtk/changes.txt
index ce290c2c1f..fe1eb4f1fb 100644
--- a/docs/gtk/changes.txt
+++ b/docs/gtk/changes.txt
@@ -1,4 +1,25 @@
-10th July 2000: wxWindows 2.2 released
+
+22nd July 2000: wxWindows 2.2.1 released
+
+Minor build fixes.
+
+Corrected guffow-scrolling so that no surplus expose
+events are generated.
+
+Corrected bug in wxMask creation on 16-bit displays.
+
+Minor correction to wxDC::DrawRoundedRectangle.
+
+Added support for <INSERT> and <DELETE> menu accelerators.
+
+Use the wxCommmandEvent::IsChecked() function for checkable
+menu items.
+
+Made wxComboBox case-sensitive.
+
+Minor correction to doc-view architecture.
+
+10th July 2000: wxWindows 2.2.0 released
 
 Added code for writing BMP images.
 
diff --git a/docs/html/news.htm b/docs/html/news.htm
index 0ac1d66ea8..538e5b4e37 100644
--- a/docs/html/news.htm
+++ b/docs/html/news.htm
@@ -18,6 +18,16 @@ News
 </tr>
 </table>
 
+<H3>July 28th, 2000</H3><P>
+
+<ul>
+<li>Vaclav Slavik has recently written an
+<a href="http://www.root.cz/clanek.phtml?id=425" target=_top>article about wxWindows</a> for a Czech ezine.
+<li>Hurray! There is a lot of traffic on the wxStudio mailing list, and
+Gerd Mueller has offered to make the <a href="http://www.softwarebuero.de" target=_top>WipeOut</a> IDE
+open source and merge it with wxStudio.
+</ul>
+
 <H3><a name="release2_2_0">July 9th, 2000</H3><P>
 
 <ul>
diff --git a/docs/html/platform.htm b/docs/html/platform.htm
index 0fa514f1d6..72442a67b5 100644
--- a/docs/html/platform.htm
+++ b/docs/html/platform.htm
@@ -93,7 +93,9 @@ often don't work.
 <tr>
 <td bgcolor="#F0F0F0" align=center valign=center rowspan=2>AIX</td>
      <td>wxGTK with AIX CC</td><td align=center><IMG SRC="icons/no.gif" ALT=Unknown></td><td><br></td><td><br></td>
-<tr> <td>wxMotif with AIX CC</td><td align=center><IMG SRC="icons/no.gif" ALT=Unknown></td><td><br></td><td><br></td>
+<tr> <td>wxMotif with xlC (AIX 4.2)</td><td align=center><IMG SRC="icons/yes.gif" ALT=Ok></td>
+                                 <td>Bernhard Eck</td>
+                                 <td>Some problems with OpenGL and native X server</td>
 </tr>
 
 <tr>
diff --git a/docs/latex/wx/cmdevent.tex b/docs/latex/wx/cmdevent.tex
index 13c342c370..973f3956de 100644
--- a/docs/latex/wx/cmdevent.tex
+++ b/docs/latex/wx/cmdevent.tex
@@ -36,7 +36,9 @@ which is generated by a wxListBox control.}
 \twocolitem{{\bf EVT\_TEXT(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_UPDATED command,
 which is generated by a wxTextCtrl control.}
 \twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER command,
-which is generated by a wxTextCtrl control.}
+which is generated by a wxTextCtrl control. Note that you must use
+wxTE\_PROCESS\_ENTER flag when creating the control if you want it to generate
+such events.}
 \twocolitem{{\bf EVT\_MENU(id, func)}}{Process a wxEVT\_COMMAND\_MENU\_SELECTED command,
 which is generated by a menu item.}
 \twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_MENU\_RANGE command,
@@ -117,16 +119,16 @@ Constructor.
 
 \membersection{wxCommandEvent::Checked}
 
-\func{bool}{Checked}{\void}
+\constfunc{bool}{Checked}{\void}
 
-Returns TRUE or FALSE for a checkbox selection event.
+Deprecated, use \helpref{IsChecked}{wxcommandeventischecked} instead.
 
 \membersection{wxCommandEvent::GetClientData}
 
 \func{void*}{GetClientData}{\void}
 
 Returns client data pointer for a listbox or choice selection event
-(not valid for a deselection). Beware, this is not implmented anywhere...
+(not valid for a deselection).
 
 \membersection{wxCommandEvent::GetExtraLong}
 
@@ -154,6 +156,16 @@ a deselection).
 Returns item string for a listbox or choice selection event (not valid for
 a deselection).
 
+\membersection{wxCommandEvent::IsChecked}\label{wxcommandeventischecked}
+
+\constfunc{bool}{IsChecked}{\void}
+
+This method can be used with checkbox and menu events: for the checkboxes, the
+method returns {\tt TRUE} for a selection event and {\tt FALSE} for a
+deselection one. For the menu events, this method indicates if the menu item
+just has become checked or unchecked (and thus only makes sense for checkable
+menu items).
+
 \membersection{wxCommandEvent::IsSelection}
 
 \func{bool}{IsSelection}{\void}
diff --git a/docs/latex/wx/combobox.tex b/docs/latex/wx/combobox.tex
index 1615069a70..218f17e93c 100644
--- a/docs/latex/wx/combobox.tex
+++ b/docs/latex/wx/combobox.tex
@@ -23,8 +23,9 @@ A combobox permits a single selection only. Combobox items are numbered from zer
 \begin{twocollist}\itemsep=0pt
 \twocolitem{\windowstyle{wxCB\_SIMPLE}}{Creates a combobox with a permanently displayed list. Windows only. }
 \twocolitem{\windowstyle{wxCB\_DROPDOWN}}{Creates a combobox with a drop-down list.}
-\twocolitem{\windowstyle{wxCB\_READONLY}}{Creates a combo box consisting of a drop-down list and static text item
-displaying the current selection.}
+\twocolitem{\windowstyle{wxCB\_READONLY}}{Same as wxCB\_DROPDOWN but only the
+strings specified as the combobox choices can be selected, it is impossible to
+select (even from a program) a string which is not in the choices list.}
 \twocolitem{\windowstyle{wxCB\_SORT}}{Sorts the entries in the list alphabetically.}
 \end{twocollist}
 
@@ -319,6 +320,9 @@ wxPython.}
 
 Sets the text for the combobox text field.
 
+{\bf NB:} For a combobox with {\tt wxCB\_READONLY} style the string must be in
+the combobox choices list, otherwise the call to SetValue() is ignored.
+
 \wxheading{Parameters}
 
 \docparam{text}{The text to set.}
diff --git a/docs/latex/wx/database.tex b/docs/latex/wx/database.tex
index 92c5c24936..6d093cb1c0 100644
--- a/docs/latex/wx/database.tex
+++ b/docs/latex/wx/database.tex
@@ -3,9 +3,6 @@
 Every database object represents an ODBC connection.
 The connection may be closed and reopened.
 
-Note: this class is considered obsolete, replaced by the Remstar wxDB/wxTable classes
-(documented separately in Word and PDF format, as odbc.doc and odbc.pdf).
-
 \wxheading{Derived from}
 
 \helpref{wxObject}{wxobject}
@@ -80,9 +77,9 @@ and disconnects from the current data source.
 
 Commits previous transactions. Not implemented.
 
-\membersection{wxDatabase::ErrorOccurred}
+\membersection{wxDatabase::ErrorOccured}
 
-\func{bool}{ErrorOccurred}{\void}
+\func{bool}{ErrorOccured}{\void}
 
 Returns TRUE if the last action caused an error.
 
@@ -90,7 +87,7 @@ Returns TRUE if the last action caused an error.
 
 \func{void}{ErrorSnapshot}{\param{HSTMT}{ statement = SQL\_NULL\_HSTMT}}
 
-This function will be called whenever an ODBC error occurred. It stores the
+This function will be called whenever an ODBC error occured. It stores the
 error related information returned by ODBC. If a statement handle of the
 concerning ODBC action is available it should be passed to the function.
 
diff --git a/docs/latex/wx/db.tex b/docs/latex/wx/db.tex
index 4ef79bd0c6..7e4e357ad6 100644
--- a/docs/latex/wx/db.tex
+++ b/docs/latex/wx/db.tex
@@ -1,6 +1,6 @@
-\section{\class{wxDB}}\label{wxdb}
+\section{\class{wxDb}}\label{wxdb}
 
-A wxDB instance is a connection to an ODBC data source which may
+A wxDb instance is a connection to an ODBC data source which may
 be opened, closed, and re-opened an unlimited number of times.  A
 database connection allows function to be performed directly on the
 data source, as well as allowing access to any tables/views defined in
@@ -13,25 +13,217 @@ the data source to which the user has sufficient privileges.
 <wx/isqlext.h>
 <wx/db.h>
 
+\latexignore{\rtfignore{\wxheading{Members}}}
+\wxheading{Enumerated types}
+
+\label{wxdbenumsqllogstate}\docparam{enum {\bf wxDbSqlLogState}}{sqlLogOFF, sqlLogON}
+
+{\it enum {\bf wxDBMS}}
+
+These are the databases currently tested and working with these ODBC classes.  
+A call to \helpref{wxDb::Dbms}{wxdbdbms} will return one of these enumerated values listed below.
+
+\begin{verbatim}
+      dbmsUNIDENTIFIED,
+      dbmsORACLE,
+      dbmsSYBASE_ASA,     // Adaptive Server Anywhere
+      dbmsSYBASE_ASE,     // Adaptive Server Enterprise
+      dbmsMS_SQL_SERVER,
+      dbmsMY_SQL,
+      dbmsPOSTGRES,
+      dbmsACCESS,
+      dbmsDBASE,
+      dbmsINFORMIX
+\end{verbatim}
+
+See the remarks in \helpref{wxDb::Dbms}{wxdbdbms} for exceptions/issues with
+each of these database engines.
+
+
+\wxheading{Public member variables}
+
+\docparam{SWORD {\bf wxDb::cbErrorMsg}}{This member variable is populated as a result of
+calling \helpref{wxDb::GetNextError}{wxdbgetnexterror}.  Contains the count of bytes in the wxDb::errorMsg string.}
+
+\label{wxdbdbstatus}\docparam{int {\bf wxDb::DB_STATUS}}{The last ODBC error that occured on this data connection.  Possible codes are:}
+
+\begin{verbatim}
+   DB_ERR_GENERAL_WARNING                     // SqlState = '01000'
+   DB_ERR_DISCONNECT_ERROR                    // SqlState = '01002'
+   DB_ERR_DATA_TRUNCATED                      // SqlState = '01004'
+   DB_ERR_PRIV_NOT_REVOKED                    // SqlState = '01006'
+   DB_ERR_INVALID_CONN_STR_ATTR               // SqlState = '01S00'
+   DB_ERR_ERROR_IN_ROW                        // SqlState = '01S01'
+   DB_ERR_OPTION_VALUE_CHANGED                // SqlState = '01S02'
+   DB_ERR_NO_ROWS_UPD_OR_DEL                  // SqlState = '01S03'
+   DB_ERR_MULTI_ROWS_UPD_OR_DEL               // SqlState = '01S04'
+   DB_ERR_WRONG_NO_OF_PARAMS                  // SqlState = '07001'
+   DB_ERR_DATA_TYPE_ATTR_VIOL                 // SqlState = '07006'
+   DB_ERR_UNABLE_TO_CONNECT                   // SqlState = '08001'
+   DB_ERR_CONNECTION_IN_USE                   // SqlState = '08002'
+   DB_ERR_CONNECTION_NOT_OPEN                 // SqlState = '08003'
+   DB_ERR_REJECTED_CONNECTION                 // SqlState = '08004'
+   DB_ERR_CONN_FAIL_IN_TRANS                  // SqlState = '08007'
+   DB_ERR_COMM_LINK_FAILURE                   // SqlState = '08S01'
+   DB_ERR_INSERT_VALUE_LIST_MISMATCH          // SqlState = '21S01'
+   DB_ERR_DERIVED_TABLE_MISMATCH              // SqlState = '21S02'
+   DB_ERR_STRING_RIGHT_TRUNC                  // SqlState = '22001'
+   DB_ERR_NUMERIC_VALUE_OUT_OF_RNG            // SqlState = '22003'
+   DB_ERR_ERROR_IN_ASSIGNMENT                 // SqlState = '22005'
+   DB_ERR_DATETIME_FLD_OVERFLOW               // SqlState = '22008'
+   DB_ERR_DIVIDE_BY_ZERO                      // SqlState = '22012'
+   DB_ERR_STR_DATA_LENGTH_MISMATCH            // SqlState = '22026'
+   DB_ERR_INTEGRITY_CONSTRAINT_VIOL           // SqlState = '23000'
+   DB_ERR_INVALID_CURSOR_STATE                // SqlState = '24000'
+   DB_ERR_INVALID_TRANS_STATE                 // SqlState = '25000'
+   DB_ERR_INVALID_AUTH_SPEC                   // SqlState = '28000'
+   DB_ERR_INVALID_CURSOR_NAME                 // SqlState = '34000'
+   DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL         // SqlState = '37000'
+   DB_ERR_DUPLICATE_CURSOR_NAME               // SqlState = '3C000'
+   DB_ERR_SERIALIZATION_FAILURE               // SqlState = '40001'
+   DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL2        // SqlState = '42000'
+   DB_ERR_OPERATION_ABORTED                   // SqlState = '70100'
+   DB_ERR_UNSUPPORTED_FUNCTION                // SqlState = 'IM001'
+   DB_ERR_NO_DATA_SOURCE                      // SqlState = 'IM002'
+   DB_ERR_DRIVER_LOAD_ERROR                   // SqlState = 'IM003'
+   DB_ERR_SQLALLOCENV_FAILED                  // SqlState = 'IM004'
+   DB_ERR_SQLALLOCCONNECT_FAILED              // SqlState = 'IM005'
+   DB_ERR_SQLSETCONNECTOPTION_FAILED          // SqlState = 'IM006'
+   DB_ERR_NO_DATA_SOURCE_DLG_PROHIB           // SqlState = 'IM007'
+   DB_ERR_DIALOG_FAILED                       // SqlState = 'IM008'
+   DB_ERR_UNABLE_TO_LOAD_TRANSLATION_DLL      // SqlState = 'IM009'
+   DB_ERR_DATA_SOURCE_NAME_TOO_LONG           // SqlState = 'IM010'
+   DB_ERR_DRIVER_NAME_TOO_LONG                // SqlState = 'IM011'
+   DB_ERR_DRIVER_KEYWORD_SYNTAX_ERROR         // SqlState = 'IM012'
+   DB_ERR_TRACE_FILE_ERROR                    // SqlState = 'IM013'
+   DB_ERR_TABLE_OR_VIEW_ALREADY_EXISTS        // SqlState = 'S0001'
+   DB_ERR_TABLE_NOT_FOUND                     // SqlState = 'S0002'
+   DB_ERR_INDEX_ALREADY_EXISTS                // SqlState = 'S0011'
+   DB_ERR_INDEX_NOT_FOUND                     // SqlState = 'S0012'
+   DB_ERR_COLUMN_ALREADY_EXISTS               // SqlState = 'S0021'
+   DB_ERR_COLUMN_NOT_FOUND                    // SqlState = 'S0022'
+   DB_ERR_NO_DEFAULT_FOR_COLUMN               // SqlState = 'S0023'
+   DB_ERR_GENERAL_ERROR                       // SqlState = 'S1000'
+   DB_ERR_MEMORY_ALLOCATION_FAILURE           // SqlState = 'S1001'
+   DB_ERR_INVALID_COLUMN_NUMBER               // SqlState = 'S1002'
+   DB_ERR_PROGRAM_TYPE_OUT_OF_RANGE           // SqlState = 'S1003'
+   DB_ERR_SQL_DATA_TYPE_OUT_OF_RANGE          // SqlState = 'S1004'
+   DB_ERR_OPERATION_CANCELLED                 // SqlState = 'S1008'
+   DB_ERR_INVALID_ARGUMENT_VALUE              // SqlState = 'S1009'
+   DB_ERR_FUNCTION_SEQUENCE_ERROR             // SqlState = 'S1010'
+   DB_ERR_OPERATION_INVALID_AT_THIS_TIME      // SqlState = 'S1011'
+   DB_ERR_INVALID_TRANS_OPERATION_CODE        // SqlState = 'S1012'
+   DB_ERR_NO_CURSOR_NAME_AVAIL                // SqlState = 'S1015'
+   DB_ERR_INVALID_STR_OR_BUF_LEN              // SqlState = 'S1090'
+   DB_ERR_DESCRIPTOR_TYPE_OUT_OF_RANGE        // SqlState = 'S1091'
+   DB_ERR_OPTION_TYPE_OUT_OF_RANGE            // SqlState = 'S1092'
+   DB_ERR_INVALID_PARAM_NO                    // SqlState = 'S1093'
+   DB_ERR_INVALID_SCALE_VALUE                 // SqlState = 'S1094'
+   DB_ERR_FUNCTION_TYPE_OUT_OF_RANGE          // SqlState = 'S1095'
+   DB_ERR_INF_TYPE_OUT_OF_RANGE               // SqlState = 'S1096'
+   DB_ERR_COLUMN_TYPE_OUT_OF_RANGE            // SqlState = 'S1097'
+   DB_ERR_SCOPE_TYPE_OUT_OF_RANGE             // SqlState = 'S1098'
+   DB_ERR_NULLABLE_TYPE_OUT_OF_RANGE          // SqlState = 'S1099'
+   DB_ERR_UNIQUENESS_OPTION_TYPE_OUT_OF_RANGE // SqlState = 'S1100'
+   DB_ERR_ACCURACY_OPTION_TYPE_OUT_OF_RANGE   // SqlState = 'S1101'
+   DB_ERR_DIRECTION_OPTION_OUT_OF_RANGE       // SqlState = 'S1103'
+   DB_ERR_INVALID_PRECISION_VALUE             // SqlState = 'S1104'
+   DB_ERR_INVALID_PARAM_TYPE                  // SqlState = 'S1105'
+   DB_ERR_FETCH_TYPE_OUT_OF_RANGE             // SqlState = 'S1106'
+   DB_ERR_ROW_VALUE_OUT_OF_RANGE              // SqlState = 'S1107'
+   DB_ERR_CONCURRENCY_OPTION_OUT_OF_RANGE     // SqlState = 'S1108'
+   DB_ERR_INVALID_CURSOR_POSITION             // SqlState = 'S1109'
+   DB_ERR_INVALID_DRIVER_COMPLETION           // SqlState = 'S1110'
+   DB_ERR_INVALID_BOOKMARK_VALUE              // SqlState = 'S1111'
+   DB_ERR_DRIVER_NOT_CAPABLE                  // SqlState = 'S1C00'
+   DB_ERR_TIMEOUT_EXPIRED                     // SqlState = 'S1T00'
+\end{verbatim}
+
+
+\docparam{struct {\bf wxDb::dbInf}}{This structure is internal to the wxDb class and contains
+details of the ODBC datasource that the current instance of the wxDb is connected to
+in its members.  When the data source is opened, all of the information contained in 
+the dbInf structure is queried from the data source.  This information is used almost
+exclusively within the ODBC class library.  Where there is a need for this information
+outside of the class library a member function such as wxTable::IsCursorClosedOnCommit()
+has been added for ease of use.}
+
+\begin{verbatim}
+   char   dbmsName[40]        - Name of the dbms product
+   char   dbmsVer[64]         - Version # of the dbms product
+   char   driverName[40]      - Driver name
+   char   odbcVer[60]         - ODBC version of the driver
+   char   drvMgrOdbcVer[60]   - ODBC version of the driver manager
+   char   driverVer[60]       - Driver version
+   char   serverName[80]      - Server Name, typically a connect string
+   char   databaseName[128]   - Database filename
+   char   outerJoins[2]       - Does datasource support outer joins
+   char   procedureSupport[2] - Does datasource support stored procedures
+   UWORD  maxConnections      - Maximum # of connections datasource supports
+   UWORD  maxStmts            - Maximum # of HSTMTs per HDBC
+   UWORD  apiConfLvl          - ODBC API conformance level
+   UWORD  cliConfLvl          - Is datasource SAG compliant
+   UWORD  sqlConfLvl          - SQL conformance level
+   UWORD  cursorCommitBehavior   - How cursors are affected on db commit
+   UWORD  cursorRollbackBehavior - How cursors are affected on db rollback
+   UWORD  supportNotNullClause   - Does datasource support NOT NULL clause
+   char   supportIEF[2]       - Integrity Enhancement Facility (Ref. Integrity)
+   UDWORD txnIsolation        - Transaction isolation level supported by driver
+   UDWORD txnIsolationOptions - Transaction isolation level options available
+   UDWORD fetchDirections     - Fetch directions supported
+   UDWORD lockTypes           - Lock types supported in SQLSetPos
+   UDWORD posOperations       - Position operations supported in SQLSetPos
+   UDWORD posStmts            - Position statements supported
+   UDWORD scrollConcurrency   - Scrollable cursor concurrency options supported
+   UDWORD scrollOptions       - Scrollable cursor options supported
+   UDWORD staticSensitivity   - Can additions/deletions/updates be detected
+   UWORD  txnCapable          - Indicates if datasource supports transactions
+   UDWORD loginTimeout        - Number seconds to wait for a login request
+\end{verbatim}
+
+\docparam{char {\bf wxDb::errorList}[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN]}{The last n ODBC errors that have occured on this database connection.}
+
+\docparam{char {\bf wxDb::errorMsg}[SQL_MAX_MESSAGE_LENGTH]}{This member variable is populated as a result of calling \helpref{wxDb::GetNextError}{wxdbgetnexterror}.  It contains the ODBC error message text.}
+
+\docparam{SDWORD {\bf wxDb::nativeError}}{Set by wxDb::DispAllErrors, wxDb::GetNextError, and wxDb::DispNextError.  It contains the datasource-specific error code returned by the datasource to the ODBC driver.  Used for reporting ODBC errors.}
+
+\docparam{wxChar {\bf wxDb::sqlState}[20]}{Set by wxDb::TranslateSqlState().  Indicates the error state after a failed ODBC operation.  Used for reporting ODBC errors.}
+
+\docparam{unsigned int {\bf nTables}}{Number of wxDbTable objects connected to this wxDb instance.  {\bf FOR INTERNAL USE ONLY} by wxDbTable!!!}
+
+{\it wxDbSqlTypeInfo {\bf typeInfVarchar}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfInteger}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfFloat}}
+
+{\it wxDbSqlTypeInfo {\bf typeInfDate}}
+
+\begin{indented}{1cm}
+The four wxDbSqlTypeInfo member variables listed above contain information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
+
+This information is obtained from the ODBC driver by use of the ::SQLGetTypeInfo() function.  The key piece of information is the type name the datasource uses for each logical data type. e.g. VARCHAR; Oracle calls it VARCHAR2.
+\end{indented}
+
 \wxheading{Remarks}
 
-By default, cursor directional scrolling is defined by wxODBC_FWD_ONLY_CURSORS
+Default cursor scrolling is defined by wxODBC_FWD_ONLY_CURSORS in setup.h
 when the wxWindows library is built.  This behavior can be overridden when 
-an instance of a wxDB is created (see \helpref{wxDB constructor}{wxdbconstr}
+an instance of a wxDb is created (see \helpref{wxDb constructor}{wxdbconstr}
 
 \wxheading{See also}
 
-\helpref{wxTable}{wxtable}
+\helpref{wxDbColFor}{wxdbcolfor}, \helpref{wxDbColInf}{wxdbcolinf}, \helpref{wxDbTable}{wxdbtable}, \helpref{wxDbTableInf}{wxdbtableinf}, \helpref{wxDbInf}{wxdbinf}
 
-\latexignore{\rtfignore{\wxheading{Members}}}
 
-\membersection{wxDB::wxDB}\label{wxdbconstr}
 
-\func{}{wxDB}{\void}
+\membersection{wxDb::wxDb}\label{wxdbconstr}
+
+\func{}{wxDb}{\void}
 
 Default constructor.
 
-\func{}{wxDB}{\param{HENV\& }{aHenv}}
+\func{}{wxDb}{\param{HENV\& }{aHenv}}
 
 Constructor, used to create an ODBC connection to a data source.
 
@@ -41,35 +233,37 @@ Constructor, used to create an ODBC connection to a data source.
 
 \wxheading{Remarks}
 
-This is the constructor for the wxDB class.  The wxDB object must
+This is the constructor for the wxDb class.  The wxDb object must
 be created and opened before any database activity can occur.
 
 \wxheading{Example}
 \begin{verbatim}
-   HENV Db;
-   ....Set values for member variables here
+   wxDbConnectInf ConnectInf;
+   ....Set values for member variables of ConnectInf here
 
-   wxDB sampleDB(Db.Henv);
-   if (!sampleDB.Open(Db.Dsn, Db.Uid, Db.AuthStr))
+   wxDb sampleDB(ConnectInf.Henv);
+   if (!sampleDB.Open(ConnectInf.Dsn, ConnectInf.Uid, ConnectInf.AuthStr))
    {
       // Error opening data source
    }
 \end{verbatim}
 
 
-\membersection{wxDB::Catalog}
+\membersection{wxDb::Catalog}\label{wxdbcatalog}
 
 \func{bool}{Catalog}{\param{char *}{ userID}, \param{char *}{fileName = SQL_CATALOG_FILENAME}}
 
+Allows a data "dictionary" of the data source to be created, dumping pertinent information about all data tables to which the user specified in userID has access. 
+
 \wxheading{Parameters}
 
 \docparam{userID}{Database user name to use in accessing the database.  All tables to which this user has rights will be evaluated in the catalog.}
 
 \docparam{fileName}{OPTIONAL argument.  Name of the text file to create and write the DB catalog to.}
 
-\wxheading{Remarks}
+\wxheading{Return value}
 
-Allows a data "dictionary" of the data source to be created, dumping pertinent information about all data tables to which the user specified in userID has access. 
+Returns TRUE if the catalog request was successful, of FALSE if there was some reason the catalog could not be generated
 
 \wxheading{Example}
 \begin{verbatim}
@@ -84,13 +278,17 @@ EMPLOYEE       START_DATE     (0011)DATE              19      16
 \end{verbatim}
 
 
-\membersection{wxDB::Close}
+\membersection{wxDb::Close}\label{wxdbclose}
 
 \func{void}{Close}{\void}
 
+Closes the database connection.
+
 \wxheading{Remarks}
 
-At the end of your program, when you have finished all of your database work, you must close the ODBC connection to the data source.  There are actually four steps involved in doing this as illustrated in the example.
+At the end of your program, when you have finished all of your database work, you must close the ODBC connection to the data source.  There are actually four steps involved in doing this as illustrated in the example.  
+
+Any wxTable instances which use this connection must be deleted before closing the database connection.
 
 \wxheading{Example}
 \begin{verbatim}
@@ -100,7 +298,7 @@ At the end of your program, when you have finished all of your database work, yo
    // Delete any remaining wxTable objects allocated with new
    delete parts;
 
-   // Close the wxDB connection when finished with it
+   // Close the wxDb connection when finished with it
    sampleDB.Close();
 
    // Free Environment Handle that ODBC uses
@@ -110,3 +308,758 @@ At the end of your program, when you have finished all of your database work, yo
    }
 \end{verbatim}
 
+
+\membersection{wxDb::CommitTrans}\label{wxdbcommittrans}
+
+\func{bool}{CommitTrans}{\void}
+
+Permanently "commits" changes (insertions/deletions/updates) to the database.  
+
+\wxheading{Return value}
+
+Returns TRUE if the commit was successful, or FALSE if the commit failed.
+
+\wxheading{Remarks}
+
+Transactions begin implicitly as soon as you make a change to the database.  At any time thereafter, you can save your work to the database ("Commit") or roll back all of your changes  ("Rollback").  Calling this member function commits all open transactions on this ODBC connection.
+
+\wxheading{Special Note : {\it Cursors} }
+
+\normalbox{It is important to understand that different database/ODBC driver combinations handle
+transactions differently.  One thing in particular that you must pay attention to is
+cursors, in regard to transactions.  Cursors are what allow you to scroll through
+records forward and backward and to manipulate records as you scroll through them.
+When you issue a query, a cursor is created behind the scenes.  The cursor keeps track
+of the query and keeps track of the current record pointer.  After you commit or
+rollback a transaction, the cursor may be closed automatically.  This means you must
+requery the data source before you can perform any additional work against the wxTable
+object.  This is only necessary however if the data source closes the cursor after a
+commit or rollback.  Use the wxTable::IsCursorClosedOnCommit() member function to
+determine the data source's transaction behavior.  Note, it would be very inefficient
+to just assume the data source closes the cursor and always requery.  This could put
+a significant, unnecessary load on data sources that leave the cursors open after a
+transaction.}
+
+
+\membersection{wxDb::CreateView}\label{wxdbcreateviews}
+
+\func{bool}{CreateView}{\param{char *}{ viewName}, \param{char *}{ colList}, \param{char *}{pSqlStmt}}
+
+Creates a SQL VIEW.  
+
+\wxheading{Parameters}
+
+\docparam{viewName}{The name of the view.  e.g. PARTS_V}
+\docparam{colList}{{\it OPTIONAL} Pass in a comma delimited list of column names if you
+wish to explicitly name each column in the result set.  If not desired, pass in an
+empty string.}
+\docparam{pSqlStmt}{Pointer to the select statement portion of the CREATE VIEW statement.
+Must be a complete, valid SQL SELECT statement.}
+
+\wxheading{Remarks}
+
+A 'view' is a logical table that derives columns from one or more other tables or views.  Once the view is created, it can be queried exactly like any other table in the database.
+
+NOTE: Views are not available with all datasources.  Oracle is one example of a datasouce which does support views.
+
+\wxheading{Example}
+\begin{verbatim}
+   // Incomplete code sample
+   db.CreateView("PARTS_SD1", "PN, PD, QTY",  
+                 "SELECT PART_NO, PART_DESC, QTY_ON_HAND * 1.1 FROM PARTS WHERE STORAGE_DEVICE = 1");
+
+   // PARTS_SD1 can now be queried just as if it were a data table.
+   // e.g. SELECT PN, PD, QTY FROM PARTS_SD1
+\end{verbatim}
+
+
+\membersection{wxDb::DispAllErrors}\label{wxdbdispallerrors}
+
+\func{bool}{DispAllErrors}{\param{HENV}{ aHenv}, {\param}{HDBC}{ aHdbc = SQL_NULL_HDBC}, {\param}{HSTMT}{ aHstmt = SQL_NULL_HSTMT}}
+
+Logs all database errors that occurred as a result of the last executed database command.  This logging also includes debug logging when compiled in debug mode via \helpref{wxLogDebug}{wxlogdebug}.  If logging is turned on via \helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}, then an entry is also logged to the defined log file.
+
+\wxheading{Parameters}
+
+\docparam{aHenv}{A handle to the ODBC environment.}
+\docparam{aHdbc}{A handle to the ODBC connection.  Pass this in if the ODBC function call that
+erred out required a hdbc or hstmt argument.}
+\docparam{AHstmt}{A handle to the ODBC statement being executed against.  Pass this in if the
+ODBC function call  that erred out required a hstmt argument.}
+
+\wxheading{Remarks}
+
+This member function will display all of the ODBC error messages for the last ODBC function call that was made.  Normally used internally within the ODBC class library.  Would be used externally if calling ODBC functions directly (i.e. SQLFreeEnv()).
+
+\wxheading{See also}
+
+\helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}, \helpref{wxDbSqlLog}{wxdbsqllog}
+
+\wxheading{Example}
+\begin{verbatim}
+   if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) != SQL_SUCCESS)
+      // Display all ODBC errors for this stmt
+      return(db.DispAllErrors(db.henv, db.hdbc, hstmt));
+\end{verbatim}
+
+
+\membersection{wxDb::DispNextError}\label{wxdbdispnexterror}
+
+\func{void}{DispNextError}{\void}
+
+\wxheading{Remarks}
+
+This function is normally used internally within the ODBC class library.
+It could be used externally if calling ODBC functions directly.  This
+function works in conjunction with \helpref{wxDb::GetNextError}{wxdbgetnexterror} when errors (or
+sometimes informational messages)  returned from ODBC need to be analyzed
+rather than simply displaying them as an error.  GetNextError() retrieves
+the next ODBC error from the ODBC error queue.  The wxDb member variables
+"sqlState", "nativeError" and "errorMsg" could then be evaluated.  To
+display the error retrieved, DispNextError() could then be called.
+The combination of GetNextError() and DispNextError() can be used to
+iteratively step through the errors returned from ODBC evaluating each
+one in context and displaying the ones you choose.
+
+\wxheading{Example}
+\begin{verbatim}
+   // Drop the table before attempting to create it
+   sprintf(sqlStmt, "DROP TABLE %s", tableName);
+   // Execute the drop table statement
+   if (SQLExecDirect(hstmt,(UCHAR FAR *)sqlStmt,SQL_NTS) != SQL_SUCCESS)
+   {
+      // Check for sqlState = S0002, "Table or view not found".
+      // Ignore this error, bomb out on any other error.
+      pDb->GetNextError(henv, hdbc, hstmt);
+      if (strcmp(pDb->sqlState, "S0002"))
+      {
+         pDb->DispNextError();   // Displayed error retrieved
+         pDb->DispAllErrors(henv, hdbc, hstmt); // Display all other errors, if any
+         pDb->RollbackTrans();   // Rollback the transaction
+         CloseCursor();          // Close the cursor
+         return(FALSE);          // Return Failure
+      }
+   }
+\end{verbatim}
+
+
+\membersection{wxDb::DropView}\label{wxdbdropview}
+
+\func{bool}{DropView}{\param{const char *}{viewName}}
+
+Drops the data table view named in 'viewName'.
+
+\wxheading{Parameters}
+
+\docparam{viewName}{Name of the view to be dropped.}
+
+\wxheading{Remarks}
+
+If the view does not exist, this function will return TRUE.  Note that views are not supported with all data soruces.
+
+
+\membersection{wxDb::ExecSql}\label{wxdbexecsql}
+
+\func{bool}{ExecSql}{\param{char *}{pSqlStmt}}
+
+Allows a native SQL command to be executed directly against the datasource.  In addition to being able to run any standard SQL command, use of this function allows a user to (potentially) utilize features specific to the datasource they are connected to that may not be available through ODBC.  The ODBC driver will pass the specified command directly to the datasource.
+
+\wxheading{Parameters}
+
+\docparam{pSqlStmt}{Pointer to the SQL statement to be executed.}
+
+\wxheading{Remarks}
+
+This member extends the wxDb class and allows you to build and execute ANY VALID
+SQL statement against the data source.  This allows you to extend the class 
+library by being able to issue any SQL statement that the data source is capable
+of processing.
+
+\wxheading{See also}
+
+\helpref{wxDb::GetData}{wxdbgetdata}, \helpref{wxDb::GetNext}{wxdbgetnext}
+
+
+\membersection{wxDb::FwdOnlyCursors}\label{wxdbfwdonlycursors}
+
+\func{bool}{FwdOnlyCursors}{\void}
+
+Indicates whether this connection to the datasource only allows forward scrolling cursors or not.  This state is set at connection creation time.
+
+\wxheading{See also}
+
+\helpref{wxDb::wxDb}{wxdbconstruct}, \helpref{wxDbGetConnection}{wxdbgetconnection}
+
+
+\membersection{wxDb::GetCatalog}\label{wxdbgetcatalog}
+
+\func{wxDbInf *}{GetCatalog}{\param{char *}{userID}}
+
+Returns a wxDbInf pointer that points to the catalog(data source) name, schema, number of tables accessible to the current user, and a wxDbTableInf pointer to all data pertaining to all tables in the users catalog.
+
+\wxheading{Parameters}
+
+\docparam{userID}{Owner of the table.  Specify a userID when the datasource you are connected
+to allows multiple unique tables with the same name to be owned by different users.  {\it userID}
+is evaluated as follows:}
+
+\begin{verbatim}
+         userID == NULL  ... UserID is ignored (DEFAULT)
+         userID == ""    ... UserID set equal to 'this->uid'
+         userID != ""    ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Remarks}
+
+The returned catalog will only contain catalog entries for tables to which the user specified in 'userID' has sufficient privileges.  If no user is specified (NULL passed in), a catalog pertaining to all tables in the datasource accessible via this connection will be returned.
+
+
+\membersection{wxDb::GetColumnCount}\label{wxdbgetcolumncount}
+
+\func{int}{GetColumnCount}{\param{char *}{tableName}, \param{const char *}{userID}}
+
+\wxheading{Parameters}
+
+\docparam{tableName}{A table name you wish to obtain column information about.}
+\docparam{userID}{Name of the user that owns the table(s).  Required for some datasources for
+situations where there may be multiple tables with the same name in the datasource, but owned
+by different users. {\it userID} is evaluated in the following manner:}
+
+\begin{verbatim}
+         userID == NULL  ... UserID is ignored (DEFAULT)
+         userID == ""    ... UserID set equal to 'this->uid'
+         userID != ""    ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Return value}
+
+Returns a count of how many columns are in the specified table.  If an error occurs retrieving the number of columns the function will return a -1.
+
+
+\membersection{wxDb::GetColumns}\label{wxdbgetcolumns}
+
+\func{wxDbColInf *}{GetColumns}{\param{char *}{tableName}, \param{int *}{numCols}, \param{const char *}{userID=NULL}}
+
+\func{wxDbColInf *}{GetColumns}{\param{char *}{tableName[]}, \param{const char *}{userID}}
+
+\wxheading{Parameters}
+
+\docparam{tableName}{A table name you wish to obtain column information about.}
+\docparam{tableName[]}{An array of pointers to table names you wish to obtain column information about.
+The last element of this array must be a NULL string.}
+\docparam{numCols}{A pointer to a integer which will hold a count of the number
+of columns returned by this function}
+\docparam{userID}{Name of the user that owns the table(s).  Required for some datasources for
+situations where there may be multiple tables with the same name in the datasource, but owned
+by different users. {\it userID} is evaluated in the following manner:}
+
+\begin{verbatim}
+         userID == NULL  ... UserID is ignored (DEFAULT)
+         userID == ""    ... UserID set equal to 'this->uid'
+         userID != ""    ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Return value}
+
+This function returns an array of wxDbColInf structures.  This allows you to obtain
+information regarding the columns of your table(s).  If no columns were found, or
+an error occured, this pointer will be zero (null).
+
+THE CALLING FUNCTION IS RESPONSIBLE FOR DELETING THE {\it wxDbColInf} MEMORY WHEN IT IS
+FINISHED WITH IT.
+
+\normalbox{ALL column bindings associated with this wxDb instance are unbound
+by this function.  This function should use its own wxDb instance
+to avoid undesired unbinding of columns.}
+
+\wxheading{See also}
+
+\helpref{wxDbColInf}{wxdbcolinf}
+
+\wxheading{Example}
+\begin{verbatim}
+   char *tableList[] = {"PARTS", 0};
+   wxDbColInf *colInf = pDb->GetColumns(tableList);
+   if (colInf)
+   {
+      // Use the column inf
+      .......
+      // Destroy the memory
+      delete [] colInf;
+   }
+\end{verbatim}
+
+
+\membersection{wxDb::GetData}\label{wxdbgetdata}
+
+\func{bool}{GetData}{\param{UWORD}{ colNo}, \param{SWORD}{ cType}, \param{PTR}{ pData}, \param{SDWORD}{ maxLen}, \param{SDWORD FAR *}{ cbReturned} }
+
+Used to retrieve result set data without binding column values to memory variables (i.e. not using a wxDbTable instance to access table data).
+
+\wxheading{Parameters}
+
+\docparam{colNo}{Ordinal number of column in the result set to be returned.}
+\docparam{cType}{The C data type that is to be returned.}
+\docparam{pData}{Memory buffer which will hold the data returned by the call to this function.}
+\docparam{maxLen}{Maximum size of the buffer that will hold the returned value.}
+\docparam{cbReturned}{Pointer to the buffer containing the length of the actual data returned.  If this value comes back as SQL_NULL_DATA, then the GetData() call has failed.}
+
+\wxheading{See also}
+
+\helpref{wxDb::GetNext}{wxdbgetnext}, \helpref{wxDb::ExecSql}{wxdbexecsql}
+
+\wxheading{Example} 
+\begin{verbatim}
+	SDWORD cb;
+	ULONG reqQty;
+	wxString sqlStmt;
+	sqlStmt = "SELECT SUM(REQUIRED_QTY - PICKED_QTY) FROM ORDER_TABLE WHERE PART_RECID = 1450 AND REQUIRED_QTY > PICKED_QTY";
+
+	// Perform the query
+	if (!pDb->ExecSql(sqlStmt.c_str()))
+	{
+		// ERROR
+		return(0);
+	}
+
+	// Request the first row of the result set
+	if (!pDb->GetNext())
+	{
+		// ERROR
+		return(0);
+	}
+
+	Read column #1 of this row of the result set and store the value in 'reqQty'
+	if (!pDb->GetData(1, SQL_C_ULONG, &reqQty, 0, &cb))
+	{
+		// ERROR
+		return(0);
+	}
+
+	// Check for a NULL result
+	if (cb == SQL_NULL_DATA)
+		return(0);
+\end{verbatim}
+
+\wxheading{Remarks}
+
+When requesting multiple columns to be returned from the result set (for example, the SQL query
+requested 3 columns be returned), the calls to GetData must request the columns in ordinal
+sequence (1,2,3 or 1,3 or 2,3).  
+
+
+\membersection{wxDb::GetDatabaseName}\label{wxdbgetdatabasename}
+
+\func{char *}{GetDatabaseName}{\void}
+
+Returns the name of the database engine.
+
+
+\membersection{wxDb::GetDataSource}\label{wxdbgetdatasource}
+
+\func{char *}{GetDataSource}{\void}
+
+Returns the ODBC datasource name.
+
+
+\membersection{wxDb::GetHDBC}\label{wxdbgethdbc}
+
+\func{HDBC}{GetHDBC}{\void}
+
+Returns the ODBC handle to the database connection.
+
+
+\membersection{wxDb::GetHENV}\label{wxdbgethenv}
+
+\func{HENV}{GetHENV}{\void}
+
+Returns the ODBC environment handle.
+
+
+\membersection{wxDb::GetHSTMT}\label{wxdbgethstmt}
+
+\func{HSTMT}{GetHSTMT}{\void}
+
+Returns the ODBC statement handle associated with this database connection.
+
+
+\membersection{wxDb::GetKeyFields}\label{wxdbgetkeyfields}
+
+\func{int}{GetKeyFields}{\param{char *}{tableName}, \param{wxDbColInf *}{colInf}, \param{int}{nocols}}
+
+Used to determine which columns are members of primary or non-primary indexes on the specified table.  If a column is a member of a foreign key for some other table, that information is detected also.
+
+This function is primarily for use by the wxDb::GetColumns() function, but may be called if desired from the client application.
+
+\wxheading{Parameters}
+
+\docparam{tableName}{Name of the table for which the columns will be evaluated as to their inclusion in any indexes.}
+\docparam{colInf}{Data structure containing the column definitions (obtained with wxDb::GetColumns()).  This function populates the PkCol, PkTableName, and FkTableName members of the colInf structure.}
+\docparam{nocols}{Number of columns defined in the instance of colInf.}
+
+\wxheading{Return value}
+
+Currently always returns TRUE.
+
+\wxheading{See also}
+
+\helpref{wxDbColInf}{wxdbcolinf}, \helpref{wxDb::GetColumns}{wxdbgetcolumns}
+
+
+\membersection{wxDb::GetNext}\label{wxdbgetnext}
+
+\func{HSTMT}{GetNext}{\void}
+
+Requests the next row in the result set obtained by issueing a query through a direct request using wxDb::ExecSql().
+
+\wxheading{See also}
+
+\helpref{wxDb::ExecSql}{wxdbexecsql}, \helpref{wxDb::GetData}{wxdbgetdata}
+
+
+\membersection{wxDb::GetNextError}\label{wxdbgetnexterror}
+
+\func{bool}{GetNextError}{\param{HENV}{ aHenv}, \param{HDBC}{ aHdbc = SQL_NULL_HDBC}, \param{HSTMT}{ aHstmt = SQL_NULL_HSTMT}}
+
+\wxheading{Parameters}
+
+\docparam{aHenv}{A handle to the ODBC environment.}
+\docparam{aHdbc}{A handle to the ODBC connection.  Pass this in if the ODBC function call that
+erred out required a hdbc or hstmt argument.}
+\docparam{AHstmt}{A handle to the ODBC statement being executed against.  Pass this in if the
+ODBC function call that erred out requires a hstmt argument.}
+
+\wxheading{See also}
+
+\helpref{wxDb::DispNextError}{wxdbdispnexterror}, \helpref{wxDb::DispAllErrors}{wxdbdispallerrors}
+
+\wxheading{Example} 
+\begin{verbatim}
+   if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) != SQL_SUCCESS)
+   {
+      // Display all ODBC errors for this stmt
+      return(db.DispAllErrors(db.henv, db.hdbc, hstmt));
+   }
+\end{verbatim}
+
+
+\membersection{wxDb::GetPassword}\label{wxdbgetpassword}
+
+\func{char *}{GetPassword}{\void}
+
+Returns the password used to connect to the datasource.
+
+
+\membersection{wxDb::GetTableCount}\label{wxdbgettablecount}
+
+\func{int}{GetTableCount}{\void}
+
+Returns the number of wxDbTable() instances currently using this data source connection.
+
+
+\membersection{wxDb::GetUsername}\label{wxdbgetusername}
+
+\func{char *}{GetUsername}{\void}
+
+Returns the user name used to access the datasource.
+
+
+\membersection{wxDb::Grant}\label{wxdbgrant}
+
+\func{bool}{Grant}{\param{int}{ privileges}, \param{char *}{tableName}, \param{char *}{userList = "PUBLIC"}}
+
+Use this member function to GRANT privileges to users for accessing tables in the datasource.
+
+\wxheading{Parameters}
+
+\docparam{privileges}{Use this argument to select which privileges you want to grant.  Pass
+       DB_GRANT_ALL to grant all privileges.  To grant individual privileges pass
+       one or more of the following OR'd together:}
+\begin{verbatim}
+         DB_GRANT_SELECT  = 1
+         DB_GRANT_INSERT  = 2
+         DB_GRANT_UPDATE  = 4
+         DB_GRANT_DELETE  = 8
+         DB_GRANT_ALL     = DB_GRANT_SELECT | DB_GRANT_INSERT |
+                            DB_GRANT_UPDATE | DB_GRANT_DELETE
+\end{verbatim}
+\docparam{tableName}{The name of the table you wish to grant privileges on.}
+\docparam{userList}{A comma delimited list of users to grant the privileges to.  If this argument is not
+passed in, the privileges will be given to the general PUBLIC.}
+
+\wxheading{Remarks}
+
+Some databases require user names to be specified in all capital letters (i.e. Oracle).  This function does not automatically capitalize the user names passed in the comma-separated list.  This is the responsibility of the calling routine.
+
+\wxheading{Example} 
+\begin{verbatim}
+   db.Grant(DB_GRANT_SELECT | DB_GRANT_INSERT, "PARTS", "mary, sue");
+\end{verbatim}
+
+
+\membersection{wxDb::IsOpen}\label{wxdbisopen}
+
+\func{bool}{IsOpen}{\void}
+
+Indicates whether the database connection to the datasource is currently opened.
+
+
+\membersection{wxDb::Open}\label{wxdbopen}
+
+\func{bool}{Open}{\param{char *}{Dsn}, \param{char *}{Uid}, \param{char *}{AuthStr}}
+
+\wxheading{Parameters}
+
+\docparam{Dsn}{Data source name.  The name of the ODBC data source as 
+assigned when the data source is initially set up through the ODBC data 
+source manager.}
+\docparam{Uid}{User ID.  The name (ID) of the user you wish to connect as
+to the data source.  The user name (ID) determines what objects you
+have access to in the datasource and what datasource privileges you have.
+Privileges include being able to create new objects, update objects, delete
+objects and so on.  Users and privileges are normally administered by the
+database administrator.}
+\docparam{AuthStr}{The password associated witht the Uid.}
+
+\wxheading{Remarks}
+
+After a wxDb instance is created, it must then be opened.  When opening a data source, there must be hree pieces of information passed.  The data source name, user name (ID) and the password for the user.  No database activity on the data source can be performed until it is opened.  This would normally be done at program startup and the data source would remain open for the duration of the program run.  Note: It is possible to have multiple data sources open at the same time to support distributed database connections. 
+
+\wxheading{Example}
+\begin{verbatim}
+   wxDb sampleDB(Db.Henv);
+   if (!sampleDB.Open("Oracle 7.1 HP/UX", "gtasker", "myPassword"))
+   {
+      // Error opening data source
+   }
+\end{verbatim}
+
+
+\membersection{wxDb::RollbackTrans}\label{wxdbrollbacktrans}
+
+\func{bool}{RollbackTrans}{\void}
+
+Function to "rollback" changes made to the database.  After an insert/update/delete, the operation may be "undone" by issuing this command any time before a \helpref{wxDb::CommitTrans}{wxdbcommittrans} is called on the database connection.
+
+\wxheading{Remarks}
+
+Transactions begin implicitly as soon as you make a change to the database.  At any time thereafter, you can save your work to the database (using \helpref{wxDb::CommitTrans}{wxdbcommittrans}) or undo all of your changes using this function.
+
+\normalbox{Calling this member function rolls back ALL open (uncommitted) transactions on this ODBC connection.}
+
+\wxheading{See also}
+
+\helpref{wxDb::CommitTrans}{wxdbcommittrans} for a special note on cursors
+
+
+\membersection{wxDb::SetSqlLogging}\label{wxdbsetsqllogging}
+
+\func{bool}{SetSqlLogging}{\param{wxDbSqlLogState}{ state}, \param{const wxChar *}{filename = SQL_LOG_FILENAME}, \param{bool}{ append = FALSE}}
+
+\wxheading{Parameters}
+
+\docparam{state}{Either sqlLogOFF or sqlLogON (see \helpref{enum wxDbSqlLogState}{wxdbenumsqllogstate}).  Turns logging of SQL commands sent to the data
+source OFF or ON.}
+\docparam{filename}{{\it OPTIONAL}.  Name of the file to which the log text is to be written.}
+\docparam{append}{{\it OPTIONAL}. Whether the file is appended to or overwritten.}
+
+\wxheading{Remarks}
+
+When called with {\it sqlLogON}, all commands sent to the data source engine are logged to the file specified by {\it filename}.  Logging is done by embedded WriteSqlLog() calls in the database member functions, or may be manually logged by adding calls to WriteSqlLog() in your own source code.
+
+When called with {\it sqlLogOFF}, the logging file is closed, and any calls to WriteSqlLog() are ignored.
+
+
+\membersection{wxDb::TableExists}\label{wxdbtablexists}
+
+\func{bool}{TableExists}{\param{const char *}{tableName}, \param{const char *}{userID=NULL}, \param{const char *}{path=NULL}}
+
+Checks the ODBC data source for the existence of a table.  If a {\it userID} is specified, then the table must be accessible by that user (user must have at least minimal privileges to the table).
+
+\wxheading{Parameters}
+
+\docparam{tableName}{Name of the table to check for the existence of}
+\docparam{userID}{Owner of the table.  Specify a userID when the datasource you are connected
+to allows multiple unique tables with the same name to be owned by different users.  {\it userID}
+is evaluated as follows:}
+
+\begin{verbatim}
+         userID == NULL  ... UserID is ignored (DEFAULT)
+         userID == ""    ... UserID set equal to 'this->uid'
+         userID != ""    ... UserID set equal to 'userID'
+\end{verbatim}
+
+\wxheading{Remarks}
+
+{\it tableName} may refer to a table, view, alias or synonym.
+
+This function does not indicate whether or not the user has privleges to query or perform other functions on the table.
+
+
+\membersection{wxDb::TranslateSqlState}\label{wxdbtranslatesqlstate}
+
+\func{int}{TranslateSqlState}{\param{const wxChar *}{SQLState}}
+
+\wxheading{Parameters}
+
+\docparam{SQLState}{Converts an ODBC sqlstate to an internal error code.}
+
+\wxheading{Return value}
+
+Returns the internal class DB_ERR code.  See \helpref{wxDb::DB_STATUS}{wxdbdbstatus} definition.
+
+
+\membersection{wxDb::WriteSqlLog}\label{wxdbwritesqllog}
+
+\func{bool}{WriteSqlLog}{\param{const wxChar *}{logMsg}}
+
+\wxheading{Parameters}
+
+\docparam{logMsg}{Free form string to be written to the log file.}
+
+\wxheading{Remarks}
+
+Very useful debugging tool that may be turned on/off during run time.  The
+passed in string {\it logMsg} will be written to a log file if SQL logging
+is turned on (see \helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging} for details on turning logging on/off).
+
+\wxheading{Return value}
+
+If SQL logging is off when a call to WriteSqlLog() is made, or there is a
+failure to write the log message to the log file, the function returns
+FALSE without performing the requested log, otherwise TRUE is returned.
+
+\wxheading{See also}
+
+\helpref{wxDb::SetSqlLogging}{wxdbsetsqllogging}
+
+==============
+\membersection{wxDb::IsFwdOnlyCursors}\label{wxdbisfwdonlycursors}
+
+\func{bool}{IsFwdOnlyCursors}{\void}
+
+\wxheading{Remarks}
+
+This setting indicates whether this database connection was created
+as being capable of using only forward scrolling cursors.  This function
+does NOT indicate if the ODBC driver or datasource supports backward
+scrolling cursors.  There is no standard way of detecting if the driver
+or datasource can support backward scrolling cursors.
+
+If a wxDb instance was created as being forward only cursors, then even if
+the datasource and ODBC driver support backward scrolling cursors, then
+tables using this database connection can only use forward scrolling
+cursors.
+
+The default setting of whether a wxDb connection to a database allows
+forward-only or also backward scrolling cursors is defined in setup.h by 
+the wxODBC_FWD_ONLY_CURSORS value.  This default setting can be overridden
+when the wxDb connection is initially created (see \helpref{wxDb constructor}{wxdbconstr}).
+
+\wxheading{Return value}
+
+Returns TRUE if this datasource connection is defined as using only forward
+scrolling cursors, or FALSE if the connection is defined as being capable
+of supporting backward scrolling cursors (see note above).
+
+\wxheading{See also}
+
+\helpref{wxDb constructor}{wxdbconstr}
+
+=======
+\membersection{wxDb::Dbms}\label{wxdbdbms}
+
+\func{wxDBMS }{Dbms}{\void}
+
+\wxheading{Remarks}
+
+The return value will be of the enumerated type wxDBMS.  This enumerated
+type contains a list of all the currently tested and supported databases.
+
+Additional databases may be work with these classes, but these databases
+returned by this function have been tested and confirmed to work with 
+these ODBC classes.
+
+enum wxDBMS includes:
+\begin{verbatim}
+      dbmsUNIDENTIFIED
+      dbmsORACLE
+      dbmsSYBASE_ASA
+      dbmsSYBASE_ASE
+      dbmsMY_SQL_SERVER
+      dbmsMY_SQL
+      dbmsPOSTGRES
+      dbmsACCESS
+      dbmsDBASE
+      dbmsINFORMIX	
+\end{verbatim}
+
+There are known issues with conformance to the ODBC standards with several
+datasources listed above.  Please see the overview for specific details on
+on which datasource have which issues.
+
+\wxheading{Return value}
+
+The return value will indicate which of the supported datasources is 
+currently connected to by this connection.  In the event that the
+datasource is not recognized, a value of 'dbmsUNIDENTIFIED' is returned.
+
+==========
+\membersection{wxDb::SetDebugErrorMessages}\label{wxdbsetdebugerrormessages}
+
+\func{void}{SetDebugErrorMessages}{\param{bool}{state}}
+
+\docparam{state}{Either TRUE (debug messages are displayed) or FALSE (debug
+messages are not displayed.}
+
+\wxheading{Remarks}
+
+Turns on/off debug error messages from the ODBC class library.  When
+this function is passed TRUE, errors are reported to the user automatically
+in a text or pop-up dialog when an ODBC error occurs.  When passed FALSE,
+errors are silently handled.
+
+When compiled in release mode (FINAL=1), this setting has no affect.
+
+\wxheading{See also}
+
+\helpref{wxDb constructor}{wxdbconstr}
+
+
+
+==========
+\membersection{wxDb::LogError}\label{wxdblogerror}
+
+\func{void}{LogError}{\param{const char *}{errMsg} \param{const char *}{SQLState=0}}
+
+\docparam{errMsg}{Free-form text to display describing the error to be logged.}
+\docparam{SQLState}{Native SQL state error}
+
+\wxheading{Remarks}
+Calling this function will enter a log message in the error list maintained
+for the database connection.  This log message is free form and can be
+anything the programmer wants to enter in the error list.
+
+If SQL logging is turned on, the call to this function will also log the
+text into the SQL log file.
+
+\wxheading{See also}
+
+\helpref{wxDb::WriteSqlLog}{wxdbwritesqllog}
+
+
+
+==========
+\membersection{wxDb::GetTypeInfXxxxx}\label{wxdbgettypeinf}
+
+\func{wxDbSqlTypeInfo }{GetTypeInfDate}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfFloat}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfInteger}{\void}
+\func{wxDbSqlTypeInfo }{GetTypeInfVarchar}{\void}
+
+
+\wxheading{Remarks}
+
+
+\wxheading{Return value}
+
diff --git a/docs/latex/wx/gridwork.tex b/docs/latex/wx/gridwork.tex
new file mode 100644
index 0000000000..c8dcc258a3
--- /dev/null
+++ b/docs/latex/wx/gridwork.tex
@@ -0,0 +1,59 @@
+%
+% automatically generated by HelpGen from
+% grid.h at 11/May/00 18:30:18
+%
+
+
+\section{\class{wxGridCellWorker}}\label{wxgridcellworker}
+
+
+
+wxGridCellWorker: common base class for wxGridCellRenderer and
+wxGridCellEditor
+NB: this is more an implementation convenience than a design issue, so this
+class is not documented and is not public at all
+
+
+\wxheading{Derived from}
+
+No base class
+
+\wxheading{Data structures}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+
+\membersection{wxGridCellWorker::wxGridCellWorker}\label{wxgridcellworkerwxgridcellworker}
+
+\func{}{wxGridCellWorker}{\void}
+
+
+\membersection{wxGridCellWorker::IncRef}\label{wxgridcellworkerincref}
+
+\func{void}{IncRef}{\void}
+
+this class is ref counted: it is created with ref count of 1, so
+calling DecRef() once will delete it. Calling IncRef() allows to lock
+it until the matching DecRef() is called
+
+
+\membersection{wxGridCellWorker::DecRef}\label{wxgridcellworkerdecref}
+
+\func{void}{DecRef}{\void}
+
+
+\membersection{wxGridCellWorker::SetParameters}\label{wxgridcellworkersetparameters}
+
+\func{void}{SetParameters}{\param{const wxString\& }{params}}
+
+interpret renderer parameters: arbitrary string whose interpretatin is
+left to the derived classes
+
+
+\membersection{wxGridCellWorker::\destruct{wxGridCellWorker}}\label{wxgridcellworkerdtor}
+
+\func{}{\destruct{wxGridCellWorker}}{\void}
+
+virtual dtor for any base class - private because only DecRef() can
+delete us
+
diff --git a/docs/latex/wx/image.tex b/docs/latex/wx/image.tex
index f8efd1e724..10408ecb18 100644
--- a/docs/latex/wx/image.tex
+++ b/docs/latex/wx/image.tex
@@ -187,6 +187,10 @@ on program start-up to look up colors. This ensures a very fast conversion, but
 the image quality won't be perfect (and could be better for photo images using more
 sophisticated dithering algorithms).
 
+On Windows, if there is a palette present (set with SetPalette), it will be used when
+creating the wxBitmap (most useful in 8-bit display mode). On other platforms,
+the palette is currently ignored.
+
 \membersection{wxImage::Copy}\label{wximagecopy}
 
 \constfunc{wxImage}{Copy}{\void}
@@ -309,6 +313,15 @@ Gets the green value of the mask colour.
 
 Gets the red value of the mask colour.
 
+\membersection{wxImage::GetPalette}\label{wximagegetpalette}
+
+\constfunc{const wxPalette\&}{GetPalette}{\void}
+
+Returns the palette associated with the image. Currently the palette is only
+used in ConvertToBitmap under Windows.
+
+Eventually wxImage handlers will set the palette if one exists in the image file.
+
 \membersection{wxImage::GetSubImage}\label{wximagegetsubimage}
 
 \constfunc{wxImage}{GetSubImage}{\param{const wxRect\&}{ rect}}
@@ -653,6 +666,12 @@ used, which is a number between 0 and 100 (0 is terrible, 100 is very good).
 \helpref{wxImage::GetOptionInt}{wximagegetoptionint},\rtfsp
 \helpref{wxImage::HasOption}{wximagehasoption}
 
+\membersection{wxImage::SetPalette}\label{wximagesetpalette}
+
+\func{void}{SetPalette}{\param{const wxPalette\&}{ palette}}
+
+Associates a palette with the image. Currently, the palette is not used.
+
 \membersection{wxImage::SetRGB}\label{wximagesetrgb}
 
 \func{void}{SetRGB}{\param{int }{x}, \param{int }{y}, \param{unsigned char }{red}, \param{unsigned char }{green}, \param{unsigned char }{blue}}
diff --git a/docs/latex/wx/locale.tex b/docs/latex/wx/locale.tex
index a5f1915c97..a22041f817 100644
--- a/docs/latex/wx/locale.tex
+++ b/docs/latex/wx/locale.tex
@@ -61,13 +61,6 @@ The destructor, like the constructor, also has global side effects: the previous
 set locale is restored and so the changes described in 
 \helpref{Init}{wxlocaleinit} documentation are rolled back.
 
-\membersection{wxLocale::GetLocale}\label{wxlocalegetlocale}
-
-\constfunc{const char*}{GetLocale}{\void}
-
-Returns the locale name as passed to the constructor or 
-\helpref{Init()}{wxlocaleinit}.
-
 \membersection{wxLocale::AddCatalog}\label{wxlocaleaddcatalog}
 
 \func{bool}{AddCatalog}{\param{const char }{*szDomain}}
@@ -93,6 +86,36 @@ looked up under prefix/<lang>/LC\_MESSAGES, prefix/LC\_MESSAGES and prefix
 
 This only applies to subsequent invocations of AddCatalog()!
 
+\membersection{wxLocale::GetLocale}\label{wxlocalegetlocale}
+
+\constfunc{const char*}{GetLocale}{\void}
+
+Returns the locale name as passed to the constructor or 
+\helpref{Init()}{wxlocaleinit}.
+
+\membersection{wxLocale::GetName}\label{wxlocalegetname}
+
+\constfunc{const wxString\&}{GetName}{\void}
+
+Returns the current short name for the locale (as given to the constructor or
+the Init() function).
+
+\membersection{wxLocale::GetString}\label{wxlocalegetstring}
+
+\constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}}
+
+Retrieves the translation for a string in all loaded domains unless the szDomain
+parameter is specified (and then only this catalog/domain is searched).
+
+Returns original string if translation is not available
+(in this case an error message is generated the first time
+a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it).
+
+\wxheading{Remarks}
+
+Domains are searched in the last to first order, i.e. catalogs
+added later override those added before.
+
 \membersection{wxLocale::Init}\label{wxlocaleinit}
 
 \func{bool}{Init}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = TRUE}}
@@ -129,26 +152,9 @@ normally corresponds to 'domain' which is more or less the application name.
 
 See also: \helpref{AddCatalog}{wxlocaleaddcatalog}
 
-\membersection{wxLocale::GetName}\label{wxlocalegetname}
-
-\constfunc{const wxString\&}{GetName}{\void}
-
-Returns the current short name for the locale (as given to the constructor or
-the Init() function).
-
-\membersection{wxLocale::GetString}\label{wxlocalegetstring}
-
-\constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}}
-
-Retrieves the translation for a string in all loaded domains unless the szDomain
-parameter is specified (and then only this catalog/domain is searched).
-
-Returns original string if translation is not available
-(in this case an error message is generated the first time
-a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it).
+\membersection{wxLocale::IsOk}\label{wxlocaleisok}
 
-\wxheading{Remarks}
+\constfunc{bool}{IsOk}{\void}
 
-Domains are searched in the last to first order, i.e. catalogs
-added later override those added before.
+Returns TRUE if the locale could be set successfully.
 
diff --git a/docs/latex/wx/spinbutt.tex b/docs/latex/wx/spinbutt.tex
index a3b885708d..623d20c8d2 100644
--- a/docs/latex/wx/spinbutt.tex
+++ b/docs/latex/wx/spinbutt.tex
@@ -6,6 +6,9 @@ Portable programs should try to use \helpref{wxSpinCtrl}{wxspinctrl} instead
 as wxSpinButton is not implemented for all platforms (Win32 and GTK only
 currently).
 
+{\bf NB:} the range supported by this control (and wxSpinCtrl) depends on the
+platform but is at least {\tt SHRT\_MIN} to {\tt SHRT\_MAX}.
+
 \wxheading{Derived from}
 
 \helpref{wxControl}{wxcontrol}\\
diff --git a/docs/latex/wx/tconstr.tex b/docs/latex/wx/tconstr.tex
index 35cf9baeb4..386eb27e1d 100644
--- a/docs/latex/wx/tconstr.tex
+++ b/docs/latex/wx/tconstr.tex
@@ -2,8 +2,8 @@
 
 Classes: \helpref{wxLayoutConstraints}{wxlayoutconstraints}, \helpref{wxIndividualLayoutConstraint}{wxindividuallayoutconstraint}.
 
-Objects of class wxLayoutConstraint can be associated with a window to define the
-way its subwindows are laid out, with respect to their siblings or parent.
+Objects of class wxLayoutConstraint can be associated with a window to define
+the way it is laid out, with respect to its siblings or the parent.
 
 The class consists of the following eight constraints of class wxIndividualLayoutConstraint,
 some or all of which should be accessed directly to set the appropriate
@@ -34,9 +34,12 @@ label).
 
 The constrains calculation is done in \helpref{wxWindow::Layout}{wxwindowlayout} 
 function which evaluates constraints. To call it you can either call
-wxWindow::SetAutoLayout to tell default OnSize handlers to call Layout
-automatically whenever the window size changes, or override OnSize and call Layout
-yourself.
+\helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} if the parent window
+is a frame, panel or a dialog to tell default OnSize handlers to call Layout
+automatically whenever the window size changes, or override OnSize and call
+Layout yourself (note that you do have to call 
+\helpref{Layout}{wxwindowlayout} yourself if the parent window is not a
+frame, panel or dialog).
 
 \subsection{Constraint layout: more detail}
 
diff --git a/docs/latex/wx/textfile.tex b/docs/latex/wx/textfile.tex
index ff7ecc856f..7cd79b94a0 100644
--- a/docs/latex/wx/textfile.tex
+++ b/docs/latex/wx/textfile.tex
@@ -189,10 +189,13 @@ allows more "iterator-like" traversal of the list of lines, i.e. you may
 write something like:
 
 \begin{verbatim}
-for ( str = GetFirstLine(); !Eof(); str = GetNextLine() )
+wxTextFile file;
+...
+for ( str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine() )
 {
     // do something with the current line in str
 }
+// do something with the last line in str
 \end{verbatim}
 
 \membersection{wxTextFile::GetNextLine}\label{wxtextfilegetnextline}
@@ -212,7 +215,21 @@ Gets the previous line in the file.
 
 \func{wxString\&}{GetLastLine}{\void}
 
-Gets the last line of the file.
+Gets the last line of the file. Together with 
+\helpref{GetPrevLine}{wxtextfilegetprevline} it allows to enumerate the lines
+in the file from the end to the beginning like this:
+
+\begin{verbatim}
+wxTextFile file;
+...
+for ( str = file.GetLastLine();
+      file.GetCurrentLine() > 0;
+      str = file.GetPrevLine() )
+{
+    // do something with the current line in str
+}
+// do something with the first line in str
+\end{verbatim}
 
 \membersection{wxTextFile::GetLineType}\label{wxtextfilegetlinetype}
 
diff --git a/docs/latex/wx/toolbar.tex b/docs/latex/wx/toolbar.tex
index 20d988a8f8..486ae32798 100644
--- a/docs/latex/wx/toolbar.tex
+++ b/docs/latex/wx/toolbar.tex
@@ -168,12 +168,16 @@ Adds a separator for spacing groups of tools.
 
 \membersection{wxToolBar::AddTool}\label{wxtoolbaraddtool}
 
+\func{wxToolBarTool*}{AddTool}{\param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
+\param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
+
 \func{wxToolBarTool*}{AddTool}{\param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
 \param{const wxBitmap\&}{ bitmap2 = wxNullBitmap}, \param{bool}{ isToggle = FALSE},\rtfsp
 \param{long}{ xPos = -1}, \param{long}{ yPos = -1},\rtfsp
 \param{wxObject* }{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
 
-Adds a tool to the toolbar.
+Adds a tool to the toolbar. The first (short and most commonly used) version
+adds a normal (and not a togglable) button without any associated client data.
 
 \wxheading{Parameters}
 
diff --git a/docs/latex/wx/upduievt.tex b/docs/latex/wx/upduievt.tex
index e602979bd5..925f4b6ef0 100644
--- a/docs/latex/wx/upduievt.tex
+++ b/docs/latex/wx/upduievt.tex
@@ -19,7 +19,8 @@ functions that take a wxUpdateUIEvent argument.
 
 \twocolwidtha{7cm}
 \begin{twocollist}\itemsep=0pt
-\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event.}
+\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event for the command with the given id.}
+\twocolitem{{\bf EVT\_UPDATE\_UI\_RANGE(id1, id2, func)}}{Process a wxEVT\_UPDATE\_UI event for any command with id included in the given range.}
 \end{twocollist}%
 
 \wxheading{Remarks}
diff --git a/docs/tech/tn0003.txt b/docs/tech/tn0003.txt
index 57cab689b1..13d9367301 100644
--- a/docs/tech/tn0003.txt
+++ b/docs/tech/tn0003.txt
@@ -45,6 +45,15 @@ For Word RTF:
 
   tex2rtf manual.tex manual.rtf -rtf -twice
 
+If you wish to have a GUI display show the status of what is happening
+as the conversion is happening, use the '-interactive' command line
+parameter, and then choose FILE|GO from the menu.  For example:
+
+   tex2rtf manual.tex manual.rtf -rtf -twice -interactive
+
+NOTE: You must be using the latest tex2rtf which was released with
+v2.2.0 of wxWindowsto use the -interactive switch
+
 If you wish to generate documentation for wxHTML Help Viewer
 (or Windows HTML Help), set htmlWorkshopFiles to true in your
 tex2rtf.ini file. See also the wxHTML Notes section in the
diff --git a/include/wx/db.h b/include/wx/db.h
index c0763f6fd5..ad1b1ce5c9 100644
--- a/include/wx/db.h
+++ b/include/wx/db.h
@@ -5,6 +5,8 @@
 //              source such as opening and closing the data source.
 // Author:      Doug Card
 // Modified by: George Tasker
+//              Bart Jourquin
+//              Mark Johnson
 // Mods:        Dec, 1998:
 //                -Added support for SQL statement logging and database cataloging
 //                     April, 1999
@@ -42,7 +44,7 @@
 // BJO 20000503: introduce new GetColumns members which are more database independant and 
 //               return columns in the order they were created
 #define OLD_GETCOLUMNS 1
-
+#define EXPERIMENTAL_WXDB_FUNCTIONS 0
 
 // Use this line for wxWindows v1.x
 //#include "wx_ver.h"
@@ -51,7 +53,7 @@
 
 #if wxMAJOR_VERSION == 2
     #ifdef __GNUG__
-    #pragma interface "db.h"
+        #pragma interface "db.h"
     #endif
 #endif
 
@@ -268,8 +270,8 @@ class WXDLLEXPORT wxDbColFor
 public:
     wxString       s_Field;             // Formated String for Output
     wxString       s_Format[7];         // Formated Objects - TIMESTAMP has the biggest (7)
-    wxString       s_Menge[7];          // Formated Objects - amount of things that can be formatted
-    int            i_Menge[7];          // Formated Objects - TT MM YYYY HH MM SS m
+    wxString       s_Amount[7];          // Formated Objects - amount of things that can be formatted
+    int            i_Amount[7];          // Formated Objects - TT MM YYYY HH MM SS m
     int            i_Nation;            // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
     int            i_dbDataType;        // conversion of the 'sqlDataType' to the generic data type used by these classes
     SWORD          i_sqlDataType;
@@ -303,6 +305,9 @@ public:
     int          FkCol;       // Foreign key column       0=No; 1= First Key, 2 = Second Key etc.
     char         FkTableName[DB_MAX_TABLE_NAME_LEN+1]; // Foreign key table name
     wxDbColFor  *pColFor;                              // How should this columns be formatted
+
+    wxDbColInf();
+    ~wxDbColInf();
 };
 
 
@@ -316,6 +321,8 @@ public:
     char        tableRemarks[254+1];
     int         numCols;                    // How many Columns does this Table have: GetColumnCount(..);
     wxDbColInf *pColInf;                    // pColInf = NULL ; User can later call GetColumns(..);
+    wxDbTableInf();
+    ~wxDbTableInf();
 };
 
 
@@ -326,6 +333,9 @@ public:
     char          schema[128+1];
     int           numTables;           // How many tables does this database have
     wxDbTableInf *pTableInf;           // pTableInf = new wxDbTableInf[numTables];
+
+    wxDbInf();
+    ~wxDbInf();
 };
 
 
@@ -393,7 +403,7 @@ private:
     unsigned int nTables;
 
     // Information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
-	 //
+     //
     // This information is obtained from the ODBC driver by use of the
     // SQLGetTypeInfo() function.  The key piece of information is the
     // type name the data source uses for each logical data type.
@@ -432,6 +442,9 @@ public:
         char   databaseName[128];                        // Database filename
         char   outerJoins[2];                            // Indicates whether the data source supports outer joins
         char   procedureSupport[2];                      // Indicates whether the data source supports stored procedures
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+        char   accessibleTables[2];                      // Indicates whether the data source only reports accessible tables in SQLTables.
+#endif
         UWORD  maxConnections;                           // Maximum # of connections the data source supports
         UWORD  maxStmts;                                 // Maximum # of HSTMTs per HDBC
         UWORD  apiConfLvl;                               // ODBC API conformance level
@@ -464,7 +477,7 @@ public:
 
 #if wxODBC_BACKWARD_COMPATABILITY
     // Information about logical data types VARCHAR, INTEGER, FLOAT and DATE.
-	 //
+     //
     // This information is obtained from the ODBC driver by use of the
     // SQLGetTypeInfo() function.  The key piece of information is the
     // type name the data source uses for each logical data type.
@@ -476,7 +489,7 @@ public:
 #endif
 
     // Public member functions
-    wxDb(HENV &aHenv, bool FwdOnlyCursors=(bool)TRUE);
+    wxDb(HENV &aHenv, bool FwdOnlyCursors=(bool)wxODBC_FWD_ONLY_CURSORS);
     bool         Open(char *Dsn, char *Uid, char *AuthStr);  // Data Source Name, User ID, Password
     void         Close(void);
     bool         CommitTrans(void);
@@ -514,6 +527,9 @@ public:
     wxDbSqlTypeInfo GetTypeInfDate()   {return typeInfDate;}
 
     bool         TableExists(const char *tableName, const char *userID=NULL, const char *path=NULL);  // Table name can refer to a table, view, alias or synonym
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+    bool         TablePrivileges(const char *tableName, const char* priv, const char *userID=NULL, const char *path=NULL);  // Table name can refer to a table, view, alias or synonym
+#endif
     void         LogError(const char *errMsg, const char *SQLState = 0) {logError(errMsg, SQLState);}
     void         SetDebugErrorMessages(bool state) { silent = !state; }
     bool         SetSqlLogging(wxDbSqlLogState state, const wxChar *filename = SQL_LOG_FILENAME, bool append = FALSE);
diff --git a/include/wx/dbtable.h b/include/wx/dbtable.h
index 6f7e6866d5..203f453ad4 100644
--- a/include/wx/dbtable.h
+++ b/include/wx/dbtable.h
@@ -3,6 +3,8 @@
 // Purpose:     Declaration of the wxDbTable class.
 // Author:      Doug Card
 // Modified by: George Tasker
+//              Bart Jourquin
+//              Mark Johnson
 // Created:     9.96
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 Remstar International, Inc.
@@ -33,7 +35,7 @@
 
 #if wxMAJOR_VERSION == 2
     #ifdef __GNUG__
-    #pragma interface "dbtable.h"
+        #pragma interface "dbtable.h"
     #endif
 #endif
 
@@ -94,20 +96,20 @@ public:
 class WXDLLEXPORT wxDbTable
 {
 private:
-    ULONG    tableID;  // Used for debugging.  This can help to match up mismatched constructors/destructors
+    ULONG       tableID;  // Used for debugging.  This can help to match up mismatched constructors/destructors
 
     // Private member variables
-    UDWORD cursorType;
-    bool   insertable;
+    UDWORD      cursorType;
+    bool        insertable;
 
     // Private member functions
-    bool bindInsertParams(void);
-    bool bindUpdateParams(void);
-    bool bindCols(HSTMT cursor);
-    bool getRec(UWORD fetchType);
-    bool execDelete(const char *pSqlStmt);
-    bool execUpdate(const char *pSqlStmt);
-    bool query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt = 0);
+    bool        bindInsertParams(void);
+    bool        bindUpdateParams(void);
+    bool        bindCols(HSTMT cursor);
+    bool        getRec(UWORD fetchType);
+    bool        execDelete(const char *pSqlStmt);
+    bool        execUpdate(const char *pSqlStmt);
+    bool        query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt = 0);
 
 #if !wxODBC_BACKWARD_COMPATABILITY
 // these were public
@@ -188,32 +190,32 @@ public:
     bool            CreateIndex(const char * idxName, bool unique, int noIdxCols, wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE);
     bool            DropIndex(const char * idxName);
 
-// Accessors
+    // Accessors
 
     // The member variables returned by these accessors are all
     // set when the wxDbTable instance is createand cannot be 
     // changed, hence there is no corresponding SetXxxx function
-	 wxDb           *GetDb()              { return pDb; }
-	 const char     *GetTableName()       { return tableName; }
-	 const char     *GetQueryTableName()  { return queryTableName; }
-	 const char     *GetTablePath()       { return tablePath; }
+    wxDb           *GetDb()              { return pDb; }
+    const char     *GetTableName()       { return tableName; }
+    const char     *GetQueryTableName()  { return queryTableName; }
+    const char     *GetTablePath()       { return tablePath; }
 
-         int GetNumberOfColumns() { return noCols; }  // number of "defined" columns for this wxDbTable instance
+    int             GetNumberOfColumns() { return noCols; }  // number of "defined" columns for this wxDbTable instance
        
 
-	 const char     *GetFromClause()      { return from; }
-	 const char     *GetOrderByClause()   { return orderBy; }
-	 const char     *GetWhereClause()     { return where; }
+    const char     *GetFromClause()      { return from; }
+    const char     *GetOrderByClause()   { return orderBy; }
+    const char     *GetWhereClause()     { return where; }
 
-	 bool            IsQueryOnly()        { return queryOnly; }
+    bool            IsQueryOnly()        { return queryOnly; }
 #if wxODBC_BACKWARD_COMPATABILITY
     void            SetFromClause(const char *From) { from = (char *)From; }
-	 void            SetOrderByClause(const char *OrderBy) { orderBy = (char *)OrderBy; }
-	 void            SetWhereClause(const char *Where) { where = (char *)Where; }
+    void            SetOrderByClause(const char *OrderBy) { orderBy = (char *)OrderBy; }
+    void            SetWhereClause(const char *Where) { where = (char *)Where; }
 #else
-	 void            SetFromClause(const wxString& From) { from = From; }
-	 void            SetOrderByClause(const wxString& OrderBy) { orderBy = OrderBy; }
-	 void            SetWhereClause(const wxString& Where) { where = Where; }
+    void            SetFromClause(const wxString& From) { from = From; }
+    void            SetOrderByClause(const wxString& OrderBy) { orderBy = OrderBy; }
+    void            SetWhereClause(const wxString& Where) { where = Where; }
 #endif
     int             Insert(void);
     bool            Update(void);
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 4629929b53..cf69eb5312 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -100,8 +100,9 @@
 #   pragma warning(disable:4100)    // unreferenced formal parameter
 #   pragma warning(disable:4511)    // copy ctor couldn't be generated
 #   pragma warning(disable:4512)    // operator=() couldn't be generated
-#   pragma warning(disable:4699)    // Using precompiled header
+#   pragma warning(disable:4699)    // using precompiled header
 #   pragma warning(disable:4134)    // conversion between pointers to members of same class
+#   pragma warning(disable:4710)    // function not inlined
 #ifndef WIN32
 #   pragma warning(disable:4135)    // conversion between different integral types
 #   pragma warning(disable:4769)    // assignment of near pointer to long integer
diff --git a/include/wx/event.h b/include/wx/event.h
index 1a594944db..aaa172a39c 100644
--- a/include/wx/event.h
+++ b/include/wx/event.h
@@ -443,7 +443,7 @@ public:
     wxString GetString() const { return m_commandString; }
 
     // Get checkbox value
-    bool Checked() const { return (m_commandInt != 0); }
+    bool IsChecked() const { return m_commandInt != 0; }
 
     // TRUE if the listbox event was a selection.
     bool IsSelection() const { return (m_extraLong != 0); }
@@ -456,6 +456,10 @@ public:
 
     void CopyObject(wxObject& obj) const;
 
+#ifdef WXWIN_COMPATIBILITY_2
+    bool Checked() const { return IsChecked(); }
+#endif // WXWIN_COMPATIBILITY_2
+
 public:
     wxString          m_commandString; // String event argument
     int               m_commandInt;
@@ -1802,15 +1806,17 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
  { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
  { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
  { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
- { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
 
 // Idle event
 #define EVT_IDLE(func) \
- { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },
 
 // Update UI event
 #define EVT_UPDATE_UI(id, func) \
- { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
+ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },
+#define EVT_UPDATE_UI_RANGE(id1, id2, func) \
+ { wxEVT_UPDATE_UI, id1, id2, (wxObjectEventFunction)(wxEventFunction)(wxUpdateUIEventFunction)&func, (wxObject *) NULL },
 
 // ----------------------------------------------------------------------------
 // Global data
diff --git a/include/wx/intl.h b/include/wx/intl.h
index fd8960ae45..f9e8f15a2a 100644
--- a/include/wx/intl.h
+++ b/include/wx/intl.h
@@ -77,6 +77,9 @@ public:
         // restores old locale
     ~wxLocale();
 
+    // return TRUE if the locale was set successfully
+    bool IsOk() const { return m_pszOldLocale != NULL; }
+
     // returns locale name
     const wxChar *GetLocale() const { return m_strLocale; }
 
@@ -110,7 +113,7 @@ public:
     // domains are searched in the last to first order, i.e. catalogs
     // added later override those added before.
     const wxMB2WXbuf GetString(const wxChar *szOrigString,
-			       const wxChar *szDomain = (const wxChar *) NULL) const;
+                               const wxChar *szDomain = (const wxChar *) NULL) const;
 
     // Returns the current short name for the locale
     const wxString& GetName() const { return m_strShort; }
@@ -126,7 +129,7 @@ private:
     wxLocale      *m_pOldLocale;      // previous wxLocale
 
     wxMsgCatalog  *m_pMsgCat;         // pointer to linked list of catalogs
-    
+
     bool           m_bConvertEncoding;
 };
 
diff --git a/include/wx/msw/minifram.h b/include/wx/msw/minifram.h
index 9d1b228aac..116371e281 100644
--- a/include/wx/msw/minifram.h
+++ b/include/wx/msw/minifram.h
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        minifram.h
+// Name:        wx/msw/minifram.h
 // Purpose:     wxMiniFrame class
 // Author:      Julian Smart
 // Modified by:
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:   	wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_MINIFRAM_H_
@@ -20,55 +20,51 @@
 
 #ifdef __WIN32__
 
-class WXDLLEXPORT wxMiniFrame: public wxFrame {
-
-  DECLARE_DYNAMIC_CLASS(wxMiniFrame)
-
+class WXDLLEXPORT wxMiniFrame : public wxFrame
+{
 public:
-  inline wxMiniFrame(void) {}
-  inline wxMiniFrame(wxWindow *parent,
-           wxWindowID id,
-           const wxString& title,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize,
-           long style = wxDEFAULT_FRAME_STYLE,
-           const wxString& name = wxFrameNameStr)
+  wxMiniFrame() { }
+  wxMiniFrame(wxWindow *parent,
+              wxWindowID id,
+              const wxString& title,
+              const wxPoint& pos = wxDefaultPosition,
+              const wxSize& size = wxDefaultSize,
+              long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER,
+              const wxString& name = wxFrameNameStr)
   {
       Create(parent, id, title, pos, size, style | wxFRAME_TOOL_WINDOW | wxFRAME_FLOAT_ON_PARENT, name);
   }
 
 protected:
+  DECLARE_DYNAMIC_CLASS(wxMiniFrame)
 };
 
 
-#else
-
-class WXDLLEXPORT wxMiniFrame: public wxFrame {
-
-  DECLARE_DYNAMIC_CLASS(wxMiniFrame)
+#else // !Win32
 
+class WXDLLEXPORT wxMiniFrame : public wxFrame
+{
 public:
-  inline wxMiniFrame(void) {}
-  inline wxMiniFrame(wxWindow *parent,
-           wxWindowID id,
-           const wxString& title,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize,
-           long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
-           const wxString& name = wxFrameNameStr)
+  wxMiniFrame() { }
+  wxMiniFrame(wxWindow *parent,
+              wxWindowID id,
+              const wxString& title,
+              const wxPoint& pos = wxDefaultPosition,
+              const wxSize& size = wxDefaultSize,
+              long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
+              const wxString& name = wxFrameNameStr)
   {
       Create(parent, id, title, pos, size, style, name);
   }
 
-  ~wxMiniFrame(void);
+  virtual ~wxMiniFrame();
 
-  long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+  virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
 
-protected:
+  DECLARE_DYNAMIC_CLASS(wxMiniFrame)
 };
 
-#endif
-
+#endif // Win32/!Win32
 
 #endif
     // _WX_MINIFRAM_H_
diff --git a/include/wx/msw/radiobox.h b/include/wx/msw/radiobox.h
index 8a98bb0a88..471ca12608 100644
--- a/include/wx/msw/radiobox.h
+++ b/include/wx/msw/radiobox.h
@@ -100,8 +100,15 @@ public:
 #endif // WXWIN_COMPATIBILITY
 
 protected:
+    // subclass one radio button
     void SubclassRadioButton(WXHWND hWndBtn);
 
+    // get the max size of radio buttons
+    wxSize GetMaxButtonSize() const;
+
+    // get the total size occupied by the radio box buttons
+    wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
+
     WXHWND *          m_radioButtons;
     int               m_majorDim;
     int *             m_radioWidth;  // for bitmaps
@@ -114,6 +121,7 @@ protected:
     virtual void DoSetSize(int x, int y,
                            int width, int height,
                            int sizeFlags = wxSIZE_AUTO);
+    virtual wxSize DoGetBestSize() const;
 };
 
 #endif
diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h
index 06343cbb48..cd0e2bdde1 100644
--- a/include/wx/msw/setup0.h
+++ b/include/wx/msw/setup0.h
@@ -6,7 +6,7 @@
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:     wxWindows licence
+// Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_SETUP_H_
@@ -49,6 +49,22 @@
 // Recommended setting: 0
 #define wxICON_IS_BITMAP    0
 
+// Define as 1 for font size to be backward compatible to 1.63 and earlier.
+// 1.64 and later define point sizes to be compatible with Windows.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxFONT_SIZE_COMPATIBILITY    0
+
+// Set to 0 for accurate dialog units, else 1 to be as per 2.1.16 and before.
+// If migrating between versions, your dialogs may seem to shrink.
+//
+// Default is 1
+//
+// Recommended setting: 0 (the new calculations are more correct!)
+#define wxDIALOG_UNIT_COMPATIBILITY   1
+
 // ----------------------------------------------------------------------------
 // debugging settings
 // ----------------------------------------------------------------------------
@@ -240,14 +256,15 @@
 
 // If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
 // to connect/disconnect from the network and be notified whenever the dial-up
-// network connection is established/terminated.
+// network connection is established/terminated. Requires wxUSE_DYNLIB_CLASS.
 //
 // Default is 1.
 //
 // Recommended setting: 1
 #define wxUSE_DIALUP_MANAGER   1
 
-// Compile in wxLibrary class for run-time DLL loading and function calling
+// Compile in wxLibrary class for run-time DLL loading and function calling.
+// Required by wxUSE_DIALUP_MANAGER.
 //
 // This setting is for Win32 only
 //
@@ -259,33 +276,58 @@
 // Set to 1 to use socket classes
 #define wxUSE_SOCKETS       1
 
-// Set to 1 to enable virtual file systems
-// (needed by wxHTML)
+#if wxUSE_GUI
+
+// Set to 1 to enable virtual file systems (required by wxHTML)
 #define wxUSE_FILESYSTEM    1
+
+// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM)
 #define wxUSE_FS_ZIP        1
+
+// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM)
 #define wxUSE_FS_INET       1
 
-// input stream for reading from zip archives
+// Set to 1 to compile wxZipInput/OutputStream classes.
 #define wxUSE_ZIPSTREAM     1
 
+// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by
+// wxUSE_LIBPNG.
+#define wxUSE_ZLIB          1
+
+#else // !wxUSE_GUI
+
+// although it is possible to compile all of those in wxBase, this is not done
+// by default
+#define wxUSE_FILESYSTEM    0
+#define wxUSE_FS_ZIP        0
+#define wxUSE_FS_INET       0
+#define wxUSE_ZIPSTREAM     0
+#define wxUSE_ZLIB          0
+
+#endif // wxUSE_GUI/!wxUSE_GUI
+
+// If enabled, the code written by Apple will be used to write, in a portable
+// way, float on the disk. See extended.c for the license which is different
+// from wxWindows one.
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you don't like the license terms (unlikely)
 #define wxUSE_APPLE_IEEE          1
-                                // if enabled, the float codec written by Apple
-                                // will be used to write, in a portable way,
-                                // float on the disk
 
-// use wxFile class - required by i18n code, wxConfig and others - recommended
+// Use wxFile class.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (highly recommended, required i18n code, wxConfig...)
 #define wxUSE_FILE                1
 
-// use wxTextFile class: requires wxFile, required by wxConfig
+// use wxTextFile class: requires wxFile, required by wxFileConfig
 #define wxUSE_TEXTFILE            1
 
-// i18n support: _() macro, wxLocale class. Requires wxFile
+// i18n support: _() macro, wxLocale class. Requires wxTextFile.
 #define wxUSE_INTL                1
 
-#define wxUSE_DYNAMIC_CLASSES     1
-                                // If 1, enables provision of run-time type information.
-                                // NOW MANDATORY: don't change.
-
 // ----------------------------------------------------------------------------
 // Optional controls
 // ----------------------------------------------------------------------------
@@ -323,7 +365,7 @@
 // of disabled controls)
 #define wxUSE_CARET        1
 #define wxUSE_CHECKBOX     1
-#define wxUSE_CHECKLISTBOX 1
+#define wxUSE_CHECKLISTBOX 1        // requires wxUSE_OWNER_DRAWN
 #define wxUSE_CHOICE       1
 #define wxUSE_COMBOBOX     1
 #define wxUSE_GAUGE        1
@@ -359,7 +401,7 @@
 // Default is 1 for both options.
 //
 // Recommended setting: 1 for wxUSE_NEW_GRID, 0 if you have an old code using
-// wxGrid and 100% backwards compatible (with all old wxGrid quirks) is
+// wxGrid and 100% backwards compatibality (with all old wxGrid quirks) is
 // essential.
 //
 // WIN16/BC++ resets wxUSE_NEW_GRID to 0 because it exceeds the data limit.
@@ -504,42 +546,41 @@
                                 // Use .wxr resource mechanism (requires PrologIO library)
 
 // ----------------------------------------------------------------------------
-// Postscript support settings
+// postscript support settings
 // ----------------------------------------------------------------------------
 
+// Set to 1 for PostScript device context.
 #define wxUSE_POSTSCRIPT  0
-                                // 0 for no PostScript device context
+
+// Set to 1 to use font metric files in GetTextExtent
 #define wxUSE_AFM_FOR_POSTSCRIPT 0
-                                // 1 to use font metric files in GetTextExtent
 
+// Set to 0 to disable PostScript print/preview architecture code under Windows
+// (just use Windows printing).
 #define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
-                                // Set to 0 to disable PostScript print/preview architecture code
-                                // under Windows (just use Windows printing).
 
 // ----------------------------------------------------------------------------
 // database classes
 // ----------------------------------------------------------------------------
 
+// Define 1 to use ODBC classes
 #define wxUSE_ODBC          0
-                                // Define 1 to use ODBC classes
 
+// For backward compatibility reasons, this parameter now only controls the
+// default scrolling method used by cursors.  This default behavior can be
+// overriden by setting the second param of wxDB::wxDbGetConnection() or 
+// wxDb() constructor to indicate whether the connection (and any wxDbTable()s
+// that use the connection) should support forward only scrolling of cursors, 
+// or both forward and backward support for backward scrolling cursors is 
+// dependent on the data source as well as the ODBC driver being used.
 #define wxODBC_FWD_ONLY_CURSORS	 1
-                                // For backward compatibility reasons, this parameter now only
-                                // controls the default scrolling method used by cursors.  This
-                                // default behavior can be overriden by setting the second param
-                                // of wxDB::GetDbConnection() to indicate whether the connection
-                                // (and any wxTable()s that use the connection) should support
-                                // forward only scrolling of cursors, or both forward and backward
-                                // Support for backward scrolling cursors is dependent on the
-                                // data source as well as the ODBC driver being used.
 
+// Default is 0.  Set to 1 to use the deprecated classes, enum types, function,
+// member variables.  With a setting of 1, full backward compatability with the
+// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0,
+// as future development will be done only on the non-deprecated
+// functions/classes/member variables/etc.
 #define wxODBC_BACKWARD_COMPATABILITY 0
-                                // Default is 0.  Set to 1 to use the deprecated classes, enum
-                                // types, function, member variables.  With a setting of 1, full
-                                // backward compatability with the 2.0.x release is possible.
-                                // It is STRONGLY recommended that this be set to 0, as 
-                                // future development will be done only on the non-deprecated
-                                // functions/classes/member variables/etc.
 
 // ----------------------------------------------------------------------------
 // other compiler (mis)features
@@ -565,66 +606,120 @@
 // image format support
 // ----------------------------------------------------------------------------
 
-#define wxUSE_ZLIB          1
-                                // Use zlib for compression in streams and PNG code
+// wxImage supports many different image formats which can be configured at
+// compile-time. BMP is always supported, others are optional and can be safely
+// disabled if you don't plan to use images in such format sometimes saving
+// substantial amount of code in the final library.
+//
+// Some formats require an extra library which is included in wxWin sources
+// which is mentioned if it is the case.
+
+// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB.
 #define wxUSE_LIBPNG        1
-                                // Use PNG bitmap/image code
+
+// Set to 1 for JPEG format support (requires libjpeg)
 #define wxUSE_LIBJPEG       1
-                                // Use JPEG bitmap/image code
+
+// Set to 1 for TIFF format support (requires libtiff)
 #define wxUSE_LIBTIFF       1
-                                // Use TIFF bitmap/image code
+
+// Set to 1 for GIF format support
 #define wxUSE_GIF           1
-                                // Use GIF bitmap/image code
+
+// Set to 1 for PNM format support
 #define wxUSE_PNM           1
-                                // Use PNM bitmap/image code
+
+// Set to 1 for PCX format support
 #define wxUSE_PCX           1
-                                // Use PCX bitmap/image code
 
 // ----------------------------------------------------------------------------
 // Windows-only settings
 // ----------------------------------------------------------------------------
 
-// Make settings compatible with MFC
+// Set this to 1 if you want to use wxWindows and MFC in the same program. This
+// will override some other settings (see below)
+//
+// Default is 0.
+//
+// Recommended setting: 0 unless you really have to use MFC
 #define wxUSE_MFC           0
 
-// required for drag-and-drop, clipboard, OLE Automation
+// Set this to 1 for generic OLE support: this is required for drag-and-drop,
+// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and
+// can't compile/doesn't have the OLE headers.
+//
+// Default is 1.
+//
+// Recommended setting: 1
 #define wxUSE_OLE           1
 
+// Set this to 1 to use Microsoft CTL3D library for "3D-look" under Win16 or NT
+// 3.x. This setting is ignored under Win9x and NT 4.0+.
+//
+// Default is 0 for (most) Win32 (systems), 1 for Win16
+//
+// Recommended setting: same as default
 #if defined(__WIN95__)
 #define wxUSE_CTL3D                      0
 #else
-// Define 1 to use Microsoft CTL3D library.
 #define wxUSE_CTL3D                      1
 #endif
 
-// can we use RICHEDIT control?
+// Define as 1 to use Microsoft's ItsyBitsy small title bar library, for
+// wxMiniFrame. This setting is only used for Win3.1; Win9x and NT use native
+// miniframes support instead.
+//
+// Default is 0 for (most) Win32 (systems), 1 for Win16
+//
+// Recommended setting: same as default
+#if defined(__WIN95__)
+#define wxUSE_ITSY_BITSY             0
+#else
+#define wxUSE_ITSY_BITSY             1
+#endif
+
+// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH
+// which allows to put more than ~32Kb of text in it even under Win9x (NT
+// doesn't have such limitation).
+//
+// Default is 1 for compilers which support it
+//
+// Recommended setting: 1, only set it to 0 if your compiler doesn't have
+//                      or can't compile <richedit.h>
 #if defined(__WIN95__) && !defined(__TWIN32__) && !defined(__GNUWIN32_OLD__)
 #define wxUSE_RICHEDIT 1
 #else
 #define wxUSE_RICHEDIT 0
 #endif
 
-#define wxUSE_ITSY_BITSY             1
-                                // Define 1 to use Microsoft's ItsyBitsy
-                                // small title bar library, for wxMiniFrame.
-                                // This setting is only used for Win3.1;
-                                // Win9x and NT use native miniframes
-                                // support instead.
-#define wxUSE_BITMAP_MESSAGE         1
-                                // Define 1 to use bitmap messages.
-#define wxFONT_SIZE_COMPATIBILITY    0
-                                // Define 1 for font size to be backward compatible
-                                // to 1.63 and earlier. 1.64 and later define point
-                                // sizes to be compatible with Windows.
-#define wxDIALOG_UNIT_COMPATIBILITY   0
-                                // Set to 0 for accurate dialog units, else
-                                // 1 to be as per 2.1.16 and before. If migrating
-                                // between versions, your dialogs may seem to shrink.
+// Set this to 1 to enable support for the owner-drawn menu and listboxes. This
+// is required by wxUSE_CHECKLISTBOX.
+//
+// Default is 1.
+//
+// Recommended setting: 1, set to 0 for a small library size reduction
+#define wxUSE_OWNER_DRAWN 1
+
+// ----------------------------------------------------------------------------
+// obsolete settings
+// ----------------------------------------------------------------------------
+
+// NB: all settings in this section are obsolete and should not be used/changed
+//     at all, they will disappear
+
+// Set to 1 to use PenWindows
 #define wxUSE_PENWINDOWS             0
-                                // Set to 1 to use PenWindows
 
-#define wxUSE_OWNER_DRAWN             1
-                                // Owner-drawn menus and listboxes
+// Define 1 to use bitmap messages.
+#define wxUSE_BITMAP_MESSAGE         1
+
+// If 1, enables provision of run-time type information.
+// NOW MANDATORY: don't change.
+#define wxUSE_DYNAMIC_CLASSES     1
+
+// ----------------------------------------------------------------------------
+// disable the settings which don't work for some compilers
+// ----------------------------------------------------------------------------
 
 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
 #ifndef wxUSE_NORLANDER_HEADERS
@@ -632,10 +727,6 @@
 #endif
 #endif
 
-// ----------------------------------------------------------------------------
-// disable the settings which don't work for some compilers
-// ----------------------------------------------------------------------------
-
 #if defined(__GNUWIN32__)
 // These don't work as expected for mingw32 and cygwin32
 #undef  wxUSE_MEMORY_TRACING
@@ -746,7 +837,7 @@
 #define wxUSE_MS_HTML_HELP 0
 #endif
 
-// wxUSE_DBEUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode
+// wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode
 #if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL))
 #undef wxUSE_DEBUG_NEW_ALWAYS
 #define wxUSE_DEBUG_NEW_ALWAYS 0
@@ -811,6 +902,17 @@
 
 #endif // Win16
 
+// ----------------------------------------------------------------------------
+// undef the things which don't make sense for wxBase build
+// ----------------------------------------------------------------------------
+
+#if !wxUSE_GUI
+
+#undef wxUSE_HTML
+#define wxUSE_HTML 0
+
+#endif // !wxUSE_GUI
+
 // ----------------------------------------------------------------------------
 // check the settings consistency: do it here to abort compilation immediately
 // and not almost in the very end when the relevant file fails to compile and
diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h
index 863264c290..aa19f52861 100644
--- a/include/wx/tbarbase.h
+++ b/include/wx/tbarbase.h
@@ -221,6 +221,16 @@ public:
     // toolbar construction
     // --------------------
 
+    // the most commonly used version of AddTool()
+    wxToolBarToolBase *AddTool(int id,
+                               const wxBitmap& bitmap,
+                               const wxString& shortHelpString = wxEmptyString,
+                               const wxString& longHelpString = wxEmptyString)
+    {
+        return AddTool(id, bitmap, wxNullBitmap, FALSE, NULL,
+                       shortHelpString, longHelpString);
+    }
+
     // If pushedBitmap is NULL, a reversed version of bitmap is created and
     // used as the pushed/toggled image. If toggle is TRUE, the button toggles
     // between the two states.
diff --git a/lib/wx22.def b/lib/wx22.def
index 5c8a3b35c0..37001d56e1 100644
--- a/lib/wx22.def
+++ b/lib/wx22.def
@@ -68,8 +68,6 @@ EXPORTS
       RemoveAt__14wxArrayOptionsFUi
       ;wxArrayParams::Insert(const wxCmdLineParam&,unsigned int)
       Insert__13wxArrayParamsFRC14wxCmdLineParamUi
-      ;wxArrayOptions::Empty()
-      Empty__14wxArrayOptionsFv
       ;wxCmdLineParserData::wxCmdLineParserData()
       __ct__19wxCmdLineParserDataFv
       ;wxCmdLineParser::SetCmdLine(const wxString&)
@@ -84,6 +82,8 @@ EXPORTS
       Insert__14wxArrayOptionsFRC15wxCmdLineOptionUi
       ;wxArrayParams::Add(const wxCmdLineParam&)
       Add__13wxArrayParamsFRC14wxCmdLineParam
+      ;wxArrayParams::DoEmpty()
+      DoEmpty__13wxArrayParamsFv
       ;wxArrayOptions::~wxArrayOptions()
       __dt__14wxArrayOptionsFv
       ;wxCmdLineParser::Usage()
@@ -106,12 +106,12 @@ EXPORTS
       __dt__15wxCmdLineParserFv
       ;wxArrayParams::~wxArrayParams()
       __dt__13wxArrayParamsFv
-      ;wxArrayParams::Empty()
-      Empty__13wxArrayParamsFv
       ;wxArrayParams::operator=(const wxArrayParams&)
       __as__13wxArrayParamsFRC13wxArrayParams
       ;wxCmdLineParser::AddOption(const wxString&,const wxString&,const wxString&,wxCmdLineParamType,int)
       AddOption__15wxCmdLineParserFRC8wxStringN2118wxCmdLineParamTypei
+      ;wxArrayOptions::DoEmpty()
+      DoEmpty__14wxArrayOptionsFv
       ;wxCmdLineParser::GetParamCount() const
       GetParamCount__15wxCmdLineParserCFv
       ;wxArrayOptions::DoCopy(const wxArrayOptions&)
@@ -339,6 +339,8 @@ EXPORTS
       GetDays__10wxTimeSpanCFv
       ;wxDateTime::GetCurrentMonth(wxDateTime::Calendar)
       GetCurrentMonth__10wxDateTimeFQ2_10wxDateTime8Calendar
+      ;wxDateTimeArray::DoEmpty()
+      DoEmpty__15wxDateTimeArrayFv
       ;wxDateTime::Add(const wxTimeSpan&) const
       Add__10wxDateTimeCFRC10wxTimeSpan
       ;wxDateTime::SetMinute(unsigned short)
@@ -379,6 +381,8 @@ EXPORTS
       GetHours__10wxTimeSpanCFv
       ;wxDateTime::GetCurrentYear(wxDateTime::Calendar)
       GetCurrentYear__10wxDateTimeFQ2_10wxDateTime8Calendar
+      ;wxDateSpan::Add(const wxDateSpan&)
+      Add__10wxDateSpanFRC10wxDateSpan
       ;wxDateTime::SetDay(unsigned short)
       SetDay__10wxDateTimeFUs
       ;wxDateTime::SetHour(unsigned short)
@@ -447,8 +451,8 @@ EXPORTS
       GetNumberOfDays__10wxDateTimeFiQ2_10wxDateTime8Calendar
       ;wxDateTime::GetCountry()
       GetCountry__10wxDateTimeFv
-      ;wxDateTimeArray::Empty()
-      Empty__15wxDateTimeArrayFv
+      ;wxDateSpan::Add(const wxDateSpan&) const
+      Add__10wxDateSpanCFRC10wxDateSpan
       ;wxDateTime::ParseRfc822Date(const char*)
       ParseRfc822Date__10wxDateTimeFPCc
       ;wxDateTime::ParseTime(const char*)
@@ -486,8 +490,12 @@ EXPORTS
       __apl__10wxDateTimeFRC10wxTimeSpan
       ;wxDateTime::operator-=(const wxDateSpan&)
       __ami__10wxDateTimeFRC10wxDateSpan
+      ;wxDateSpan::operator-=(const wxDateSpan&)
+      __ami__10wxDateSpanFRC10wxDateSpan
       ;wxTimeSpan::Subtract(const wxTimeSpan&) const
       Subtract__10wxTimeSpanCFRC10wxTimeSpan
+      ;wxDateSpan::Subtract(const wxDateSpan&) const
+      Subtract__10wxDateSpanCFRC10wxDateSpan
       ;wxDateTime::SetToCurrent()
       SetToCurrent__10wxDateTimeFv
       ;wxDateSpan::Negate() const
@@ -547,10 +555,14 @@ EXPORTS
       __apl__10wxDateSpanFRC10wxDateSpan
       ;wxDateTime::operator-=(const wxTimeSpan&)
       __ami__10wxDateTimeFRC10wxTimeSpan
+      ;wxDateTime::UNow()
+      UNow__10wxDateTimeFv
       ;wxDateTime::Today()
       Today__10wxDateTimeFv
       ;wxDateTime::Subtract(const wxTimeSpan&) const
       Subtract__10wxDateTimeCFRC10wxTimeSpan
+      ;wxDateSpan::Subtract(const wxDateSpan&)
+      Subtract__10wxDateSpanFRC10wxDateSpan
       ;wxDateTime::IsEqualUpTo(const wxDateTime&,const wxTimeSpan&) const
       IsEqualUpTo__10wxDateTimeCFRC10wxDateTimeRC10wxTimeSpan
       ;wxDateTime::GetWeekDay(wxDateTime::WeekDay,int,wxDateTime::Month,int) const
@@ -565,12 +577,12 @@ EXPORTS
       Add__10wxDateTimeFRC10wxDateSpan
       ;wxTimeSpan::Abs() const
       Abs__10wxTimeSpanCFv
-      ;wxTimeSpan::Format(const char*) const
-      Format__10wxTimeSpanCFPCc
-      ;wxDateTime::SetToYearDay(unsigned short)
-      SetToYearDay__10wxDateTimeFUs
       ;wxDateTime::GetYearDay(unsigned short) const
       GetYearDay__10wxDateTimeCFUs
+      ;wxDateTime::SetToYearDay(unsigned short)
+      SetToYearDay__10wxDateTimeFUs
+      ;wxTimeSpan::Format(const char*) const
+      Format__10wxTimeSpanCFPCc
   ;From object file:  ..\common\datstrm.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxDataOutputStream::operator<<(unsigned int)
@@ -2228,6 +2240,8 @@ EXPORTS
     ;PUBDEFs (Symbols available from object file):
       ;wxBMPHandler::sm_classwxBMPHandler
       sm_classwxBMPHandler__12wxBMPHandler
+      ;wxBMPHandler::SaveFile(wxImage*,wxOutputStream&,unsigned long)
+      SaveFile__12wxBMPHandlerFP7wxImageR14wxOutputStreamUl
       ;wxConstructorForwxBMPHandler()
       wxConstructorForwxBMPHandler__Fv
       ;wxBMPHandler::LoadFile(wxImage*,wxInputStream&,unsigned long,int)
@@ -3026,9 +3040,11 @@ EXPORTS
       ExpandCommand__10wxFileTypeFRC8wxStringRCQ2_10wxFileType17MessageParameters
       ;wxMimeTypesManager::IsOfType(const wxString&,const wxString&)
       IsOfType__18wxMimeTypesManagerFRC8wxStringT1
+      ;wxArrayFileTypeInfo::DoEmpty()
+      DoEmpty__19wxArrayFileTypeInfoFv
+      wxTheMimeTypesManager
       ;wxArrayFileTypeInfo::~wxArrayFileTypeInfo()
       __dt__19wxArrayFileTypeInfoFv
-      wxTheMimeTypesManager
       ;wxFileType::wxFileType()
       __ct__10wxFileTypeFv
       ;wxFileType::GetIcon(wxIcon*) const
@@ -3057,14 +3073,12 @@ EXPORTS
       RemoveAt__19wxArrayFileTypeInfoFUi
       ;wxMimeTypeCmnModule::sm_classwxMimeTypeCmnModule
       sm_classwxMimeTypeCmnModule__19wxMimeTypeCmnModule
-      ;wxArrayFileTypeInfo::Empty()
-      Empty__19wxArrayFileTypeInfoFv
+      ;wxMimeTypesManager::wxMimeTypesManager()
+      __ct__18wxMimeTypesManagerFv
       ;wxConstructorForwxMimeTypeCmnModule()
       wxConstructorForwxMimeTypeCmnModule__Fv
       ;wxMimeTypesManager::~wxMimeTypesManager()
       __dt__18wxMimeTypesManagerFv
-      ;wxMimeTypesManager::wxMimeTypesManager()
-      __ct__18wxMimeTypesManagerFv
       ;wxArrayFileTypeInfo::operator=(const wxArrayFileTypeInfo&)
       __as__19wxArrayFileTypeInfoFRC19wxArrayFileTypeInfo
       ;wxFileType::GetOpenCommand(wxString*,const wxFileType::MessageParameters&) const
@@ -3294,6 +3308,8 @@ EXPORTS
       __vft10wxPrintout8wxObject
       ;wxPrintout::HasPage(int)
       HasPage__10wxPrintoutFi
+      ;wxPrinterBase::sm_lastError
+      sm_lastError__13wxPrinterBase
       ;wxPrinterBase::sm_abortWindow
       sm_abortWindow__13wxPrinterBase
       ;wxPrintPreviewBase::wxPrintPreviewBase(wxPrintout*,wxPrintout*,wxPrintDialogData*)
@@ -3402,13 +3418,13 @@ EXPORTS
       PaintPage__18wxPrintPreviewBaseFP8wxWindowR4wxDC
   ;From object file:  ..\common\process.cpp
     ;PUBDEFs (Symbols available from object file):
+      ;wxProcess::SetPipeStreams(wxInputStream*,wxOutputStream*,wxInputStream*)
+      SetPipeStreams__9wxProcessFP13wxInputStreamP14wxOutputStreamT1
       ;wxConstructorForwxProcess()
       wxConstructorForwxProcess__Fv
       ;wxProcess::Init(wxEvtHandler*,int,unsigned long)
       Init__9wxProcessFP12wxEvtHandleriUl
       __vft9wxProcess8wxObject
-      ;wxProcess::SetPipeStreams(wxInputStream*,wxOutputStream*)
-      SetPipeStreams__9wxProcessFP13wxInputStreamP14wxOutputStream
       ;wxProcess::~wxProcess()
       __dt__9wxProcessFv
       ;wxConstructorForwxProcessEvent()
@@ -4318,6 +4334,8 @@ EXPORTS
       insert__8wxStringFUiRC8wxString
       ;operator+(const wxString&,const char*)
       __pl__FRC8wxStringPCc
+      ;wxArrayString::operator==(const wxArrayString&) const
+      __eq__13wxArrayStringCFRC13wxArrayString
       ;wxString::operator=(const wchar_t*)
       __as__8wxStringFPCw
       ;wxString::StartsWith(const char*,wxString*) const
@@ -4591,12 +4609,14 @@ EXPORTS
       ;wxTextInputStream::operator>>(unsigned int&)
       __rs__17wxTextInputStreamFRUi
       __vft18wxTextOutputStream
-      ;wxTextInputStream::operator>>(wxString&)
-      __rs__17wxTextInputStreamFR8wxString
+      ;wxTextInputStream::EatEOL(const char&)
+      EatEOL__17wxTextInputStreamFRCc
       ;wxTextInputStream::operator>>(short&)
       __rs__17wxTextInputStreamFRs
       ;wxTextInputStream::operator>>(unsigned short&)
       __rs__17wxTextInputStreamFRUs
+      ;wxTextInputStream::operator>>(wxString&)
+      __rs__17wxTextInputStreamFR8wxString
       ;wxTextOutputStream::operator<<(const wxString&)
       __ls__18wxTextOutputStreamFRC8wxString
       ;wxTextOutputStream::Write8(unsigned char)
@@ -4749,6 +4769,8 @@ EXPORTS
       wxMessageBox__FRC8wxStringT1lP8wxWindowiT5
       ;wxNewId()
       wxNewId__Fv
+      ;wxExecute(const wxString&,wxArrayString&,wxArrayString&)
+      wxExecute__FRC8wxStringR13wxArrayStringT2
       ;wxHexToDec(const wxString&)
       wxHexToDec__FRC8wxString
       ;wxExecute(const wxString&,wxArrayString&)
@@ -5665,6 +5687,8 @@ EXPORTS
       ;wxZipInputStream::OnSysRead(void*,unsigned int)
       OnSysRead__16wxZipInputStreamFPvUi
       __vft16wxZipInputStream12wxStreamBase
+      ;wxZipInputStream::Eof() const
+      Eof__16wxZipInputStreamCFv
   ;From object file:  ..\common\zstream.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxZlibInputStream::wxZlibInputStream(wxInputStream&)
@@ -5717,6 +5741,8 @@ EXPORTS
       Create__14wxCalendarCtrlFP8wxWindowiRC10wxDateTimeRC7wxPointRC6wxSizelRC8wxString
       ;wxCalendarCtrl::Show(unsigned long)
       Show__14wxCalendarCtrlFUl
+      ;wxCalendarEvent::sm_classwxCalendarEvent
+      sm_classwxCalendarEvent__15wxCalendarEvent
       ;wxCalendarCtrl::OnDClick(wxMouseEvent&)
       OnDClick__14wxCalendarCtrlFR12wxMouseEvent
       ;wxCalendarCtrl::RefreshDate(const wxDateTime&)
@@ -5727,6 +5753,8 @@ EXPORTS
       DoSetSize__14wxCalendarCtrlFiN41
       ;wxMonthComboBox::GetEventTable() const
       GetEventTable__15wxMonthComboBoxCFv
+      ;wxConstructorForwxCalendarEvent()
+      wxConstructorForwxCalendarEvent__Fv
       ;wxCalendarCtrl::~wxCalendarCtrl()
       __dt__14wxCalendarCtrlFv
       ;wxCalendarCtrl::SetHolidayAttrs()
@@ -5815,6 +5843,14 @@ EXPORTS
       __dt__7wxCaretFv
       ;wxCaretTimer::wxCaretTimer(wxCaret*)
       __ct__12wxCaretTimerFP7wxCaret
+      ;wxCaret::OnTimer()
+      OnTimer__7wxCaretFv
+      ;wxCaret::Refresh()
+      Refresh__7wxCaretFv
+      ;wxCaret::OnSetFocus()
+      OnSetFocus__7wxCaretFv
+      ;wxCaret::OnKillFocus()
+      OnKillFocus__7wxCaretFv
       ;wxCaret::DoShow()
       DoShow__7wxCaretFv
       ;wxCaret::DoHide()
@@ -6090,14 +6126,12 @@ EXPORTS
       __dt__18wxGenericDragImageFv
       ;wxGenericDragImage::Create(const wxIcon&,const wxCursor&,const wxPoint&)
       Create__18wxGenericDragImageFRC6wxIconRC8wxCursorRC7wxPoint
-      ;wxGenericDragImage::wxGenericDragImage()
-      __ct__18wxGenericDragImageFv
+      ;wxGenericDragImage::BeginDrag(const wxPoint&,wxWindow*,wxWindow*)
+      BeginDrag__18wxGenericDragImageFRC7wxPointP8wxWindowT2
       ;wxGenericDragImage::Show()
       Show__18wxGenericDragImageFv
       ;wxGenericDragImage::Hide()
       Hide__18wxGenericDragImageFv
-      ;wxGenericDragImage::BeginDrag(const wxPoint&,wxWindow*,wxWindow*)
-      BeginDrag__18wxGenericDragImageFRC7wxPointP8wxWindowT2
       ;wxGenericDragImage::Create(const wxTreeCtrl&,wxTreeItemId&)
       Create__18wxGenericDragImageFRC10wxTreeCtrlR12wxTreeItemId
       __vft18wxGenericDragImage8wxObject
@@ -6113,6 +6147,12 @@ EXPORTS
       Init__18wxGenericDragImageFv
       ;wxGenericDragImage::EndDrag()
       EndDrag__18wxGenericDragImageFv
+      ;wxGenericDragImage::UpdateBackingFromWindow(wxDC&,wxMemoryDC&,const wxRect&,const wxRect&) const
+      UpdateBackingFromWindow__18wxGenericDragImageCFR4wxDCR10wxMemoryDCRC6wxRectT3
+      ;wxGenericDragImage::Create(const wxCursor&,const wxPoint&)
+      Create__18wxGenericDragImageFRC8wxCursorRC7wxPoint
+      ;wxGenericDragImage::DoDrawImage(wxDC&,const wxPoint&) const
+      DoDrawImage__18wxGenericDragImageCFR4wxDCRC7wxPoint
       ;wxGenericDragImage::Create(const wxListCtrl&,long)
       Create__18wxGenericDragImageFRC10wxListCtrll
       ;wxGenericDragImage::sm_classwxGenericDragImage
@@ -6504,6 +6544,8 @@ EXPORTS
       Replace__11wxImageListFiRC8wxBitmap
       ;wxImageList::wxImageList(int,int,unsigned long,int)
       __ct__11wxImageListFiT1UlT1
+      ;wxImageList::Create(int,int,unsigned long,int)
+      Create__11wxImageListFiT1UlT1
       ;wxImageList::~wxImageList()
       __dt__11wxImageListFv
       ;wxImageList::GetSize(int,int&,int&) const
@@ -6571,10 +6613,12 @@ EXPORTS
       OnIdle__10wxListCtrlFR11wxIdleEvent
       ;wxListMainWindow::DeleteItem(long)
       DeleteItem__16wxListMainWindowFl
-      ;wxListItemData::SetSize(int,int)
-      SetSize__14wxListItemDataFiT1
+      ;wxListLineDataArray::wxListLineDataArray(const wxListLineDataArray&)
+      __ct__19wxListLineDataArrayFRC19wxListLineDataArray
       ;wxListEvent::wxListEvent(int,int)
       __ct__11wxListEventFiT1
+      ;wxListItemData::SetSize(int,int)
+      SetSize__14wxListItemDataFiT1
       ;wxListLineData::SetItem(int,const wxListItem&)
       SetItem__14wxListLineDataFiRC10wxListItem
       ;wxListMainWindow::SendNotify(wxListLineData*,int)
@@ -6640,8 +6684,8 @@ EXPORTS
       GetItemRect__16wxListMainWindowFlR6wxRect
       ;wxListEvent::CopyObject(wxObject&) const
       CopyObject__11wxListEventCFR8wxObject
-      ;wxListItemData::IsHit(int,int) const
-      IsHit__14wxListItemDataCFiT1
+      ;wxListLineDataArray::operator=(const wxListLineDataArray&)
+      __as__19wxListLineDataArrayFRC19wxListLineDataArray
       ;wxListLineData::sm_classwxListLineData
       sm_classwxListLineData__14wxListLineData
       ;wxListItem::sm_classwxListItem
@@ -6662,6 +6706,8 @@ EXPORTS
       SelectLine__16wxListMainWindowFP14wxListLineData
       ;wxListHeaderData::IsHit(int,int) const
       IsHit__16wxListHeaderDataCFiT1
+      ;wxListItemData::IsHit(int,int) const
+      IsHit__14wxListItemDataCFiT1
       ;wxListCtrl::InsertItem(wxListItem&)
       InsertItem__10wxListCtrlFR10wxListItem
       ;wxListMainWindow::HitTest(int,int,int&)
@@ -6734,20 +6780,24 @@ EXPORTS
       OnChar__14wxListTextCtrlFR10wxKeyEvent
       ;wxListLineData::IsInRect(int,int,const wxRect&)
       IsInRect__14wxListLineDataFiT1RC6wxRect
+      ;wxListLineDataArray::Index(const wxListLineData&,unsigned long) const
+      Index__19wxListLineDataArrayCFRC14wxListLineDataUl
       ;wxListLineData::Hilight(unsigned long)
       Hilight__14wxListLineDataFUl
       ;wxListCtrl::FindItem(long,const wxString&,unsigned long)
       FindItem__10wxListCtrlFlRC8wxStringUl
       ;wxListLineData::DrawRubberBand(wxDC*,unsigned long)
       DrawRubberBand__14wxListLineDataFP4wxDCUl
-      ;wxListItemData::SetPosition(int,int)
-      SetPosition__14wxListItemDataFiT1
+      ;wxListLineDataArray::RemoveAt(unsigned int)
+      RemoveAt__19wxListLineDataArrayFUi
       ;wxListHeaderData::wxListHeaderData(const wxListItem&)
       __ct__16wxListHeaderDataFRC10wxListItem
       ;wxListHeaderData::SetWidth(int)
       SetWidth__16wxListHeaderDataFi
       ;wxListHeaderData::SetPosition(int,int)
       SetPosition__16wxListHeaderDataFiT1
+      ;wxListItemData::SetPosition(int,int)
+      SetPosition__14wxListItemDataFiT1
       ;wxListCtrl::SetItemState(long,long,long)
       SetItemState__10wxListCtrlFlN21
       ;wxListHeaderData::SetHeight(int)
@@ -6851,10 +6901,12 @@ EXPORTS
       DeleteItem__10wxListCtrlFl
       ;wxListLineData::AssignRect(wxRect&,const wxRect&)
       AssignRect__14wxListLineDataFR6wxRectRC6wxRect
-      ;wxListItemData::SetImage(int)
-      SetImage__14wxListItemDataFi
+      ;wxListLineDataArray::DoCopy(const wxListLineDataArray&)
+      DoCopy__19wxListLineDataArrayFRC19wxListLineDataArray
       ;wxListMainWindow::UnfocusLine(wxListLineData*)
       UnfocusLine__16wxListMainWindowFP14wxListLineData
+      ;wxListItemData::SetImage(int)
+      SetImage__14wxListItemDataFi
       ;wxListCtrl::SetColumn(int,wxListItem&)
       SetColumn__10wxListCtrlFiR10wxListItem
       ;wxListLineData::InitItems(int)
@@ -6875,8 +6927,8 @@ EXPORTS
       DeleteColumn__16wxListMainWindowFi
       ;wxListLineData::CalculateSize(wxDC*,int)
       CalculateSize__14wxListLineDataFP4wxDCi
-      ;wxListMainWindow::GetImageSize(int,int&,int&)
-      GetImageSize__16wxListMainWindowFiRiT2
+      ;wxListLineDataArray::~wxListLineDataArray()
+      __dt__19wxListLineDataArrayFv
       ;wxConstructorForwxListItem()
       wxConstructorForwxListItem__Fv
       ;wxListCtrl::~wxListCtrl()
@@ -6893,6 +6945,8 @@ EXPORTS
       GetSelectedItemCount__10wxListCtrlCFv
       ;wxListMainWindow::GetMode() const
       GetMode__16wxListMainWindowCFv
+      ;wxListMainWindow::GetImageSize(int,int&,int&)
+      GetImageSize__16wxListMainWindowFiRiT2
       ;wxListHeaderWindow::GetEventTable() const
       GetEventTable__18wxListHeaderWindowCFv
       ;wxListCtrl::GetDropTarget() const
@@ -6942,12 +6996,14 @@ EXPORTS
       EnsureVisible__16wxListMainWindowFl
       ;wxListCtrl::EnsureVisible(long)
       EnsureVisible__10wxListCtrlFl
-      ;wxListItemData::wxListItemData(const wxListItem&)
-      __ct__14wxListItemDataFRC10wxListItem
+      ;wxListLineDataArray::Add(const wxListLineData&)
+      Add__19wxListLineDataArrayFRC14wxListLineData
       ;wxListItemData::sm_classwxListItemData
       sm_classwxListItemData__14wxListItemData
       ;wxListHeaderData::sm_classwxListHeaderData
       sm_classwxListHeaderData__16wxListHeaderData
+      ;wxListItemData::wxListItemData(const wxListItem&)
+      __ct__14wxListItemDataFRC10wxListItem
       ;wxListMainWindow::SetItem(wxListItem&)
       SetItem__16wxListMainWindowFR10wxListItem
       ;wxListItemData::SetItem(const wxListItem&)
@@ -6964,6 +7020,8 @@ EXPORTS
       ScrollList__10wxListCtrlFiT1
       ;wxListLineData::IsHit(int,int)
       IsHit__14wxListLineDataFiT1
+      ;wxListLineDataArray::Insert(const wxListLineData&,unsigned int)
+      Insert__19wxListLineDataArrayFRC14wxListLineDataUi
       ;wxListMainWindow::InsertItem(wxListItem&)
       InsertItem__16wxListMainWindowFR10wxListItem
       ;wxListCtrl::InsertItem(long,const wxString&,int)
@@ -6982,6 +7040,8 @@ EXPORTS
       FindItem__10wxListCtrlFlRC7wxPointi
       ;wxListMainWindow::DeleteLine(wxListLineData*)
       DeleteLine__16wxListMainWindowFP14wxListLineData
+      ;wxListLineDataArray::DoEmpty()
+      DoEmpty__19wxListLineDataArrayFv
       ;wxConstructorForwxListItemData()
       wxConstructorForwxListItemData__Fv
       ;wxConstructorForwxListHeaderWindow()
@@ -7026,6 +7086,8 @@ EXPORTS
       __ct__18wxListHeaderWindowFP8wxWindowiP16wxListMainWindowRC7wxPointRC6wxSizelRC8wxString
       ;wxListMainWindow::wxListMainWindow(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&)
       __ct__16wxListMainWindowFP8wxWindowiRC7wxPointRC6wxSizelRC8wxString
+      ;wxListHeaderWindow::AdjustDC(wxDC&)
+      AdjustDC__18wxListHeaderWindowFR4wxDC
   ;From object file:  ..\generic\logg.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxLogDialog::wxLogDialog(wxWindow*,const wxArrayString&,const wxArrayInt&,const wxArrayLong&,const wxString&,long)
@@ -7058,6 +7120,8 @@ EXPORTS
       Flush__8wxLogGuiFv
       ;wxLogFrame::DoClose()
       DoClose__10wxLogFrameFv
+      ;wxLogDialog::CreateDetailsControls()
+      CreateDetailsControls__11wxLogDialogFv
       ;wxLogGui::DoLog(unsigned long,const char*,long)
       DoLog__8wxLogGuiFUlPCcl
       ;wxLogDialog::OnListSelect(wxListEvent&)
@@ -7070,6 +7134,8 @@ EXPORTS
       __vft11wxLogWindow5wxLog
       ;wxLogTextCtrl::DoLogString(const char*,long)
       DoLogString__13wxLogTextCtrlFPCcl
+      ;wxLogDialog::OnSave(wxCommandEvent&)
+      OnSave__11wxLogDialogFR14wxCommandEvent
       ;wxLogFrame::OnCloseWindow(wxCloseEvent&)
       OnCloseWindow__10wxLogFrameFR12wxCloseEvent
       ;wxLogWindow::DoLogString(const char*,long)
@@ -7153,6 +7219,8 @@ EXPORTS
       SetFocus__7wxPanelFv
       ;wxPanel::SetFocusToChild()
       SetFocusToChild__7wxPanelFv
+      ;wxSetFocusToChild(wxWindow*,wxWindow**)
+      wxSetFocusToChild__FP8wxWindowPP8wxWindow
   ;From object file:  ..\generic\plot.cpp
     ;PUBDEFs (Symbols available from object file):
       ;wxPlotXAxisArea::OnMouse(wxMouseEvent&)
@@ -7231,12 +7299,10 @@ EXPORTS
       GetAt__12wxPlotWindowFUi
       ;wxPlotWindow::Delete(wxPlotOnOffCurve*)
       Delete__12wxPlotWindowFP16wxPlotOnOffCurve
-      ;wxArrayPlotOnOff::Empty()
-      Empty__16wxArrayPlotOnOffFv
-      ;wxConstructorForwxPlotYAxisArea()
-      wxConstructorForwxPlotYAxisArea__Fv
       ;wxArrayPlotOnOff::wxArrayPlotOnOff(const wxArrayPlotOnOff&)
       __ct__16wxArrayPlotOnOffFRC16wxArrayPlotOnOff
+      ;wxConstructorForwxPlotYAxisArea()
+      wxConstructorForwxPlotYAxisArea__Fv
       ;wxPlotWindow::RedrawXAxis()
       RedrawXAxis__12wxPlotWindowFv
       ;wxPlotWindow::GetOnOffCurveCount()
@@ -7267,12 +7333,14 @@ EXPORTS
       sm_classwxPlotXAxisArea__15wxPlotXAxisArea
       ;wxPlotWindow::Add(wxPlotOnOffCurve*)
       Add__12wxPlotWindowFP16wxPlotOnOffCurve
-      ;wxPlotCurve::wxPlotCurve(int,double,double)
-      __ct__11wxPlotCurveFidT2
+      ;wxArrayPlotOnOff::DoEmpty()
+      DoEmpty__16wxArrayPlotOnOffFv
       ;wxConstructorForwxPlotXAxisArea()
       wxConstructorForwxPlotXAxisArea__Fv
       ;wxPlotWindow::~wxPlotWindow()
       __dt__12wxPlotWindowFv
+      ;wxPlotCurve::wxPlotCurve(int,double,double)
+      __ct__11wxPlotCurveFidT2
       ;wxPlotXAxisArea::GetEventTable() const
       GetEventTable__15wxPlotXAxisAreaCFv
       ;wxPlotArea::GetEventTable() const
@@ -8545,8 +8613,8 @@ EXPORTS
       OnCompareItems__10wxTreeCtrlFRC12wxTreeItemIdT1
       ;wxTreeCtrl::CalculateLevel(wxGenericTreeItem*,wxDC&,int,int&)
       CalculateLevel__10wxTreeCtrlFP17wxGenericTreeItemR4wxDCiRi
-      ;wxArrayTreeItemIds::Empty()
-      Empty__18wxArrayTreeItemIdsFv
+      ;wxTreeCtrl::OnRenameAccept()
+      OnRenameAccept__10wxTreeCtrlFv
       ;wxConstructorForwxTreeEvent()
       wxConstructorForwxTreeEvent__Fv
       ;wxConstructorForwxTreeCtrl()
@@ -8557,8 +8625,6 @@ EXPORTS
       SetItemTextColour__10wxTreeCtrlFRC12wxTreeItemIdRC8wxColour
       ;wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId&,const wxColour&)
       SetItemBackgroundColour__10wxTreeCtrlFRC12wxTreeItemIdRC8wxColour
-      ;wxTreeCtrl::OnRenameAccept()
-      OnRenameAccept__10wxTreeCtrlFv
       ;wxTreeCtrl::GetStateImageList() const
       GetStateImageList__10wxTreeCtrlCFv
       ;wxTreeCtrl::GetCount() const
@@ -8715,10 +8781,12 @@ EXPORTS
       PaintLevel__10wxTreeCtrlFP17wxGenericTreeItemR4wxDCiRi
       ;wxTreeCtrl::AddRoot(const wxString&,int,int,wxTreeItemData*)
       AddRoot__10wxTreeCtrlFRC8wxStringiT2P14wxTreeItemData
-      ;wxTreeCtrl::SetItemImage(const wxTreeItemId&,int,wxTreeItemIcon)
-      SetItemImage__10wxTreeCtrlFRC12wxTreeItemIdi14wxTreeItemIcon
+      ;wxArrayTreeItemIds::DoEmpty()
+      DoEmpty__18wxArrayTreeItemIdsFv
       ;wxArrayTreeItemIds::~wxArrayTreeItemIds()
       __dt__18wxArrayTreeItemIdsFv
+      ;wxTreeCtrl::SetItemImage(const wxTreeItemId&,int,wxTreeItemIcon)
+      SetItemImage__10wxTreeCtrlFRC12wxTreeItemIdi14wxTreeItemIcon
       ;wxTreeCtrl::SelectItem(const wxTreeItemId&,unsigned long,unsigned long)
       SelectItem__10wxTreeCtrlFRC12wxTreeItemIdUlT2
       ;wxGenericTreeItem::Reset()
@@ -8849,8 +8917,8 @@ EXPORTS
       __as__18wxHtmlBookRecArrayFRC18wxHtmlBookRecArray
       ;HP_TagHandler::WriteOut(wxHtmlContentsItem*&,int&)
       WriteOut__13HP_TagHandlerFRP18wxHtmlContentsItemRi
-      ;wxHtmlBookRecArray::Empty()
-      Empty__18wxHtmlBookRecArrayFv
+      ;wxHtmlBookRecArray::DoEmpty()
+      DoEmpty__18wxHtmlBookRecArrayFv
       ;wxHtmlBookRecArray::Add(const wxHtmlBookRecord&)
       Add__18wxHtmlBookRecArrayFRC16wxHtmlBookRecord
       ;wxHtmlHelpData::SaveCachedBook(wxHtmlBookRecord*,wxOutputStream*)
@@ -9146,8 +9214,8 @@ EXPORTS
       DoCopy__16HtmlHistoryArrayFRC16HtmlHistoryArray
       ;HtmlHistoryArray::Add(const HtmlHistoryItem&)
       Add__16HtmlHistoryArrayFRC15HtmlHistoryItem
-      ;HtmlHistoryArray::Empty()
-      Empty__16HtmlHistoryArrayFv
+      ;HtmlHistoryArray::DoEmpty()
+      DoEmpty__16HtmlHistoryArrayFv
       ;wxConstructorForwxHtmlWinModule()
       wxConstructorForwxHtmlWinModule__Fv
       ;wxHtmlWindow::HistoryClear()
@@ -9325,14 +9393,14 @@ EXPORTS
       __ct__22wxHtmlImageMapAreaCellFQ2_22wxHtmlImageMapAreaCell8celltypeR8wxStringd
       ;wxHtmlImageMapAreaCell::GetLink(int,int) const
       GetLink__22wxHtmlImageMapAreaCellCFiT1
-      ;CoordArray::Empty()
-      Empty__10CoordArrayFv
       ;wxHtmlImageMapCell::Find(int,const void*) const
       Find__18wxHtmlImageMapCellCFiPCv
       ;HTML_ModuleImage::sm_classHTML_ModuleImage
       sm_classHTML_ModuleImage__16HTML_ModuleImage
       ;_link_dummy_func_m_image()
       _link_dummy_func_m_image__Fv
+      ;CoordArray::DoEmpty()
+      DoEmpty__10CoordArrayFv
       ;wxHtmlImageCell::wxHtmlImageCell(wxFSFile*,int,int,double,int,wxString)
       __ct__15wxHtmlImageCellFP8wxFSFileiT2dT28wxString
       __vft18wxHtmlImageMapCell8wxObject
@@ -9529,13 +9597,11 @@ EXPORTS
       wxTheApp
       ;wxApp::sm_classwxApp
       sm_classwxApp__5wxApp
-      ;wxMsgArray::Empty()
-      Empty__10wxMsgArrayFv
+      ;wxConstructorForwxApp()
+      wxConstructorForwxApp__Fv
       ;wxWakeUpIdle()
       wxWakeUpIdle__Fv
       wxSTD_MDICHILDFRAME_ICON
-      ;wxConstructorForwxApp()
-      wxConstructorForwxApp__Fv
       vHabmain
       ;wxApp::~wxApp()
       __dt__5wxAppFv
@@ -9573,8 +9639,6 @@ EXPORTS
       DoCopy__10wxMsgArrayFRC10wxMsgArray
       ;wxMsgArray::operator=(const wxMsgArray&)
       __as__10wxMsgArrayFRC10wxMsgArray
-      ;wxApp::GetEventTable() const
-      GetEventTable__5wxAppCFv
       ;wxYield()
       wxYield__Fv
       wxSTD_FRAME_ICON
@@ -9585,6 +9649,10 @@ EXPORTS
       MainLoop__5wxAppFv
       ;wxApp::Initialized()
       Initialized__5wxAppFv
+      ;wxApp::GetEventTable() const
+      GetEventTable__5wxAppCFv
+      ;wxMsgArray::DoEmpty()
+      DoEmpty__10wxMsgArrayFv
       wxFrameClassNameNoRedraw
       ;wxSetInstance(unsigned long)
       wxSetInstance__FUl
@@ -10068,10 +10136,10 @@ EXPORTS
       sm_classwxCursor__8wxCursor
       ;wxCursor::FreeResource(unsigned long)
       FreeResource__8wxCursorFUl
-      ;wxCursor::~wxCursor()
-      __dt__8wxCursorFv
       ;wxSetCursor(const wxCursor&)
       wxSetCursor__FRC8wxCursor
+      ;wxCursor::~wxCursor()
+      __dt__8wxCursorFv
       ;wxCursor::wxCursor(const char*,int,int,int,int,const char*)
       __ct__8wxCursorFPCciN32T1
       __vft15wxCursorRefData15wxObjectRefData
@@ -10132,13 +10200,13 @@ EXPORTS
       wxITALIC_FONT
       wxGREY_BRUSH
       wxWHITE
-      wxHOURGLASS_CURSOR
+      wxBLACK_PEN
       wxScrollBarNameStr
       wxSTANDARD_CURSOR
       wxMessageBoxCaptionStr
+      wxHOURGLASS_CURSOR
       wxComboBoxNameStr
       wxCROSS_CURSOR
-      wxBLACK_PEN
       wxTopLevelWindows
       wxTRANSPARENT_BRUSH
       wxWHITE_BRUSH
@@ -10407,6 +10475,8 @@ EXPORTS
       RemoveAt__13wxArrayDCInfoFUi
       ;wxPaintDC::FindInCache(unsigned int*) const
       FindInCache__9wxPaintDCCFPUi
+      ;wxArrayDCInfo::DoEmpty()
+      DoEmpty__13wxArrayDCInfoFv
       ;wxWindowDC::~wxWindowDC()
       __dt__10wxWindowDCFv
       ;wxClientDC::~wxClientDC()
@@ -10423,8 +10493,6 @@ EXPORTS
       wxConstructorForwxClientDC__Fv
       ;wxWindowDC::wxWindowDC()
       __ct__10wxWindowDCFv
-      ;wxArrayDCInfo::Empty()
-      Empty__13wxArrayDCInfoFv
       ;wxArrayDCInfo::wxArrayDCInfo(const wxArrayDCInfo&)
       __ct__13wxArrayDCInfoFRC13wxArrayDCInfo
       ;wxWindowDC::sm_classwxWindowDC
diff --git a/locale/cs.po b/locale/cs.po
index 4635c52ff4..7d58078569 100644
--- a/locale/cs.po
+++ b/locale/cs.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: wxWindows-2.2\n"
-"POT-Creation-Date: 2000-07-01 14:41+0200\n"
+"POT-Creation-Date: 2000-07-09 00:08+0200\n"
 "PO-Revision-Date: 2000-06-17 19:23+0200\n"
 "Last-Translator: Vaclav Slavik <v.slavik@volny.cz>\n"
 "Language-Team: wxWindows Team <wx-devel@wxwindows.org>\n"
@@ -77,20 +77,23 @@ msgstr "#define %s mus
 msgid "%i of %i"
 msgstr "%i z %i"
 
-#: ../src/common/cmdline.cpp:727
+#: ../src/common/cmdline.cpp:735
 #, c-format
 msgid "%s (or %s)"
 msgstr "%s (nebo %s)"
 
 #: ../src/generic/logg.cpp:239
+#, c-format
 msgid "%s Error"
 msgstr "%s - chyba"
 
 #: ../src/generic/logg.cpp:247
+#, c-format
 msgid "%s Information"
 msgstr "%s - informace"
 
 #: ../src/generic/logg.cpp:243
+#, c-format
 msgid "%s Warning"
 msgstr "%s - varování"
 
@@ -173,7 +176,7 @@ msgstr "'%s' obsahuje p
 msgid "'%s' is invalid"
 msgstr "'%s' je neplatný"
 
-#: ../src/common/cmdline.cpp:649
+#: ../src/common/cmdline.cpp:657
 #, c-format
 msgid "'%s' is not a correct numeric value for option '%s'."
 msgstr "'%s' není správná èíselná hodnota pro volbu '%s'."
@@ -269,7 +272,7 @@ msgstr "<ADR>"
 
 #: ../src/generic/filedlgg.cpp:323
 msgid "<DIR> "
-msgstr "<ADR >"
+msgstr "<ADR> "
 
 #: ../src/generic/filedlgg.cpp:357
 msgid "<LINK>"
@@ -331,7 +334,7 @@ msgstr "ABCDEFGabcdefg12345"
 msgid "Add current page to bookmarks"
 msgstr "Pøidá tuto stránku k zálo¾kám"
 
-#: ../src/generic/colrdlgg.cpp:272
+#: ../src/generic/colrdlgg.cpp:269
 msgid "Add to custom colours"
 msgstr "Pøidat k u¾ivatelským barvám"
 
@@ -660,7 +663,7 @@ msgstr "Nemohu nastavit prioritu vl
 msgid "Can't set value of '%s'"
 msgstr "Nemohu nastavit hodnotu '%s'"
 
-#: ../src/common/dlgcmn.cpp:148 ../src/common/prntbase.cpp:107
+#: ../src/common/dlgcmn.cpp:148 ../src/common/prntbase.cpp:109
 #: ../src/generic/dcpsg.cpp:2241 ../src/generic/dirdlgg.cpp:424
 #: ../src/generic/filedlgg.cpp:916 ../src/generic/fontdlgg.cpp:257
 #: ../src/generic/prntdlgg.cpp:468 ../src/generic/progdlgg.cpp:179
@@ -761,7 +764,7 @@ msgstr "Vyberte p
 msgid "Clear the log contents"
 msgstr "Smazat obsah logu"
 
-#: ../src/common/prntbase.cpp:357 ../src/generic/progdlgg.cpp:307
+#: ../src/common/prntbase.cpp:359 ../src/generic/progdlgg.cpp:307
 #: ../src/generic/proplist.cpp:518
 msgid "Close"
 msgstr "Zavøít"
@@ -831,15 +834,15 @@ msgstr ""
 "Nemohu zjistit id menu '%s'. Pou¾ijte (nenulové) èíslo\n"
 "nebo poskytnìte #define (viz. manuál)"
 
-#: ../src/common/prntbase.cpp:709
+#: ../src/common/prntbase.cpp:711
 msgid "Could not start document preview."
 msgstr "Nemohu zobrazit náhled dokumentu."
 
-#: ../src/generic/printps.cpp:200 ../src/msw/printwin.cpp:242
+#: ../src/generic/printps.cpp:209 ../src/msw/printwin.cpp:252
 msgid "Could not start printing."
 msgstr "Nemohu zahájit tisk."
 
-#: ../src/common/wincmn.cpp:777
+#: ../src/common/wincmn.cpp:782
 msgid "Could not transfer data to window"
 msgstr "Nemohu pøenést data do okna."
 
@@ -1000,13 +1003,13 @@ msgid ""
 msgstr ""
 "Chyba bìhem expanze promìnných prostøedí: chybí '%c' na pozici %d v '%s'."
 
-#: ../src/generic/dcpsg.cpp:1584 ../src/generic/dirdlgg.cpp:268
-#: ../src/generic/dirdlgg.cpp:286 ../src/generic/dirdlgg.cpp:297
-#: ../src/generic/dirdlgg.cpp:604 ../src/generic/filedlgg.cpp:625
-#: ../src/generic/filedlgg.cpp:717 ../src/generic/filedlgg.cpp:731
-#: ../src/generic/filedlgg.cpp:744 ../src/generic/filedlgg.cpp:1043
-#: ../src/generic/filedlgg.cpp:1092 ../src/generic/helpxlp.cpp:241
-#: ../src/gtk/filedlg.cpp:83 ../src/gtk/fontdlg.cpp:72
+#: ../src/generic/dirdlgg.cpp:268 ../src/generic/dirdlgg.cpp:286
+#: ../src/generic/dirdlgg.cpp:297 ../src/generic/dirdlgg.cpp:604
+#: ../src/generic/filedlgg.cpp:625 ../src/generic/filedlgg.cpp:717
+#: ../src/generic/filedlgg.cpp:731 ../src/generic/filedlgg.cpp:744
+#: ../src/generic/filedlgg.cpp:1043 ../src/generic/filedlgg.cpp:1092
+#: ../src/generic/helpxlp.cpp:241 ../src/gtk/filedlg.cpp:83
+#: ../src/gtk/fontdlg.cpp:72
 msgid "Error"
 msgstr "Chyba"
 
@@ -1176,11 +1179,11 @@ msgstr "Nepoda
 msgid "Failed to get data from the clipboard"
 msgstr "Nelze získat data ze schránky"
 
-#: ../src/common/timercmn.cpp:243
+#: ../src/common/timercmn.cpp:237
 msgid "Failed to get the UTC system time."
 msgstr "Nemohu zjistit systémový UTC èas."
 
-#: ../src/common/timercmn.cpp:195
+#: ../src/common/timercmn.cpp:189
 msgid "Failed to get the local system time"
 msgstr "Nepodaøilo se zjistit místní systémový èas"
 
@@ -1703,12 +1706,12 @@ msgstr "Zak
 msgid "Option '%s' requires a value, '=' expected."
 msgstr "Volba '%s' vy¾aduje hodnotu, oèekávám '='."
 
-#: ../src/common/cmdline.cpp:609
+#: ../src/common/cmdline.cpp:610
 #, c-format
 msgid "Option '%s' requires a value."
 msgstr "Volba '%s' vy¾aduje hodnotu."
 
-#: ../src/common/cmdline.cpp:663
+#: ../src/common/cmdline.cpp:671
 #, c-format
 msgid "Option '%s': '%s' cannot be converted to a date."
 msgstr "Volba '%s': '%s' neudává datum."
@@ -1757,12 +1760,12 @@ msgstr "PNM: form
 msgid "PNM: File seems truncated."
 msgstr "PNM: Soubor je nejspí¹ uøíznutý pøed koncem."
 
-#: ../src/common/prntbase.cpp:729
+#: ../src/common/prntbase.cpp:731
 #, c-format
 msgid "Page %d"
 msgstr "Strana %d"
 
-#: ../src/common/prntbase.cpp:727
+#: ../src/common/prntbase.cpp:729
 #, c-format
 msgid "Page %d of %d"
 msgstr "Strana %d z %d"
@@ -1805,7 +1808,7 @@ msgstr "Vyberte pros
 msgid "Please choose which ISP do you want to connect to"
 msgstr "Prosím vyberte si poskytovatele (ISP), ke kterému se chcete pøipojit"
 
-#: ../src/common/prntbase.cpp:105
+#: ../src/common/prntbase.cpp:107
 msgid "Please wait..."
 msgstr "Èekejte prosím..."
 
@@ -1834,10 +1837,6 @@ msgstr "Pouze n
 msgid "Preview:"
 msgstr "Náhled:"
 
-#: ../src/html/htmprint.cpp:486
-msgid "Previewing"
-msgstr "Vytváøím náhled"
-
 #: ../src/html/helpfrm.cpp:512
 msgid "Previous page"
 msgstr "Pøedchozí stránka"
@@ -1846,15 +1845,11 @@ msgstr "P
 msgid "Print"
 msgstr "Vytisknout"
 
-#: ../src/generic/printps.cpp:200
-msgid "Print Error"
-msgstr "Chyba tisku"
-
 #: ../src/common/docview.cpp:895
 msgid "Print Preview"
 msgstr "Náhled tisku"
 
-#: ../src/common/prntbase.cpp:685 ../src/common/prntbase.cpp:709
+#: ../src/common/prntbase.cpp:687 ../src/common/prntbase.cpp:711
 msgid "Print Preview Failure"
 msgstr "Chyba bìhem vytváøení náhledu."
 
@@ -1882,7 +1877,7 @@ msgstr "Vytiskne tuto str
 msgid "Print to File"
 msgstr "Tisknout do souboru"
 
-#: ../src/common/prntbase.cpp:364
+#: ../src/common/prntbase.cpp:366
 msgid "Print..."
 msgstr "Tisknout..."
 
@@ -1914,21 +1909,20 @@ msgstr "Nastaven
 msgid "Printer..."
 msgstr "Tiskárna..."
 
-#: ../src/common/prntbase.cpp:104 ../src/common/prntbase.cpp:146
-#: ../src/html/htmprint.cpp:507
+#: ../src/common/prntbase.cpp:106 ../src/common/prntbase.cpp:148
 msgid "Printing"
 msgstr "Tisk"
 
-#: ../src/common/prntbase.cpp:118
+#: ../src/common/prntbase.cpp:120
 msgid "Printing Error"
 msgstr "Chyba tisku"
 
-#: ../src/generic/printps.cpp:218
+#: ../src/generic/printps.cpp:232
 #, c-format
 msgid "Printing page %d..."
 msgstr "Tisknu stranu %d..."
 
-#: ../src/generic/printps.cpp:185
+#: ../src/generic/printps.cpp:192
 msgid "Printing..."
 msgstr "Tisknu..."
 
@@ -2064,6 +2058,11 @@ msgstr "Vyberte soubor"
 msgid "Send to Printer"
 msgstr "Poslat na tiskárnu"
 
+#: ../src/common/cmdline.cpp:627
+#, c-format
+msgid "Separator expected after the option '%s'."
+msgstr ""
+
 #: ../src/common/dlgcmn.cpp:138
 msgid "Setup"
 msgstr "Nastavení"
@@ -2113,7 +2112,7 @@ msgstr "Tento soubor nelze otev
 msgid "Sorry, could not save this file."
 msgstr "Tento soubor nelze ulo¾it."
 
-#: ../src/common/prntbase.cpp:685
+#: ../src/common/prntbase.cpp:687
 msgid "Sorry, not enough memory to create a preview."
 msgstr "Nedostatek pamìti na vytvoøení náhledu."
 
@@ -2214,7 +2213,7 @@ msgstr ""
 "Soubor '%s' neexistuje.\n"
 "Bude odstranìn ze seznamu nedávno otevøených souborù."
 
-#: ../src/common/cmdline.cpp:753
+#: ../src/common/cmdline.cpp:761
 #, c-format
 msgid "The required parameter '%s' was not specified."
 msgstr "Po¾adovaný parametr '%s' nebyl zadán."
@@ -2223,7 +2222,7 @@ msgstr "Po
 msgid "The text couldn't be saved."
 msgstr "Text nelze ulo¾it."
 
-#: ../src/common/cmdline.cpp:732
+#: ../src/common/cmdline.cpp:740
 #, c-format
 msgid "The value for the option '%s' must be specified."
 msgstr "Musíte zadat hodnotu volby '%s'."
@@ -2237,22 +2236,6 @@ msgstr ""
 "Verze Remote Access Service (RAS) na tomto poèítaèi je pøíli¹ stará, prosím "
 "upgradujte (chybí tato funkce: %s)."
 
-#: ../src/html/htmprint.cpp:486
-msgid ""
-"There was a problem previewing.\n"
-"Perhaps your current printer is not set correctly?"
-msgstr ""
-"Pøi vytváøení náhledu se vyskytl problém.\n"
-"Mo¾ná nemáte správnì nastavenou tiskárnu?"
-
-#: ../src/html/htmprint.cpp:507
-msgid ""
-"There was a problem printing.\n"
-"Perhaps your current printer is not set correctly?"
-msgstr ""
-"Pøi tisku se vyskytla chyba.\n"
-"Mo¾ná máte ¹patnì nastavenou tiskárnu?"
-
 #: ../src/msw/thread.cpp:1058
 msgid ""
 "Thread module initialization failed: can not store value in thread local "
@@ -2336,7 +2319,7 @@ msgstr "Podtr
 msgid "Unexpected end of file whilst parsing resource."
 msgstr "Neoèekávaný konec souboru bìhem zpracování resource"
 
-#: ../src/common/cmdline.cpp:704
+#: ../src/common/cmdline.cpp:712
 #, c-format
 msgid "Unexpected parameter '%s'"
 msgstr "Neoèekávaný parametr '%s'"
@@ -2385,7 +2368,7 @@ msgstr "Nezn
 msgid "Unsupported clipboard format."
 msgstr "Nepodporovaný formát schránky."
 
-#: ../src/common/cmdline.cpp:789
+#: ../src/common/cmdline.cpp:797
 #, c-format
 msgid "Usage: %s"
 msgstr "Pou¾ití: %s"
@@ -2748,19 +2731,19 @@ msgstr "katalog pro dom
 msgid "ctrl"
 msgstr "ctrl"
 
-#: ../src/common/cmdline.cpp:897
+#: ../src/common/cmdline.cpp:910
 msgid "date"
 msgstr "datum"
 
-#: ../src/common/datetime.cpp:3213
+#: ../src/common/datetime.cpp:3232
 msgid "eighteenth"
 msgstr "osmnáctý"
 
-#: ../src/common/datetime.cpp:3203
+#: ../src/common/datetime.cpp:3222
 msgid "eighth"
 msgstr "osmý"
 
-#: ../src/common/datetime.cpp:3206
+#: ../src/common/datetime.cpp:3225
 msgid "eleventh"
 msgstr "jedenáctý"
 
@@ -2778,11 +2761,11 @@ msgstr "nav
 msgid "failed to flush the file '%s'"
 msgstr "nelze vyprázdnit buffer souboru '%s'"
 
-#: ../src/common/datetime.cpp:3210
+#: ../src/common/datetime.cpp:3229
 msgid "fifteenth"
 msgstr "patnáctý"
 
-#: ../src/common/datetime.cpp:3200
+#: ../src/common/datetime.cpp:3219
 msgid "fifth"
 msgstr "pátý"
 
@@ -2811,19 +2794,19 @@ msgstr "soubor '%s', 
 msgid "file '%s': unexpected character %c at line %d."
 msgstr "soubor '%s': neoèekávaný znak %c na øádku %d."
 
-#: ../src/common/datetime.cpp:3196
+#: ../src/common/datetime.cpp:3215
 msgid "first"
 msgstr "první"
 
-#: ../src/common/datetime.cpp:3209
+#: ../src/common/datetime.cpp:3228
 msgid "fourteenth"
 msgstr "ètrnáctý"
 
-#: ../src/common/datetime.cpp:3199
+#: ../src/common/datetime.cpp:3218
 msgid "fourth"
 msgstr "ètvrtý"
 
-#: ../src/common/timercmn.cpp:239
+#: ../src/common/timercmn.cpp:233
 msgid "gmtime() failed"
 msgstr "gmtime() selhalo"
 
@@ -2857,19 +2840,19 @@ msgstr "hled
 msgid "medium"
 msgstr "støední"
 
-#: ../src/common/datetime.cpp:3360
+#: ../src/common/datetime.cpp:3379
 msgid "midnight"
 msgstr "Tenké"
 
-#: ../src/common/timercmn.cpp:235
+#: ../src/common/timercmn.cpp:229
 msgid "mktime() failed"
 msgstr "mktime() selhalo"
 
-#: ../src/common/datetime.cpp:3214
+#: ../src/common/datetime.cpp:3233
 msgid "nineteenth"
 msgstr "devatenáctý"
 
-#: ../src/common/datetime.cpp:3204
+#: ../src/common/datetime.cpp:3223
 msgid "ninth"
 msgstr "devátý"
 
@@ -2881,11 +2864,11 @@ msgstr "
 msgid "noname"
 msgstr "bezejmenná"
 
-#: ../src/common/datetime.cpp:3359
+#: ../src/common/datetime.cpp:3378
 msgid "noon"
 msgstr "poledne"
 
-#: ../src/common/cmdline.cpp:896
+#: ../src/common/cmdline.cpp:909
 msgid "num"
 msgstr "èíslo"
 
@@ -2893,15 +2876,15 @@ msgstr "
 msgid "reentrancy problem."
 msgstr "problém reentrance."
 
-#: ../src/common/datetime.cpp:3197
+#: ../src/common/datetime.cpp:3216
 msgid "second"
 msgstr "druhý"
 
-#: ../src/common/datetime.cpp:3212
+#: ../src/common/datetime.cpp:3231
 msgid "seventeenth"
 msgstr "sedmnáctý"
 
-#: ../src/common/datetime.cpp:3202
+#: ../src/common/datetime.cpp:3221
 msgid "seventh"
 msgstr "sedmý"
 
@@ -2909,11 +2892,11 @@ msgstr "sedm
 msgid "shift"
 msgstr "shift"
 
-#: ../src/common/datetime.cpp:3211
+#: ../src/common/datetime.cpp:3230
 msgid "sixteenth"
 msgstr "¹estnáctý"
 
-#: ../src/common/datetime.cpp:3201
+#: ../src/common/datetime.cpp:3220
 msgid "sixth"
 msgstr "¹estý"
 
@@ -2921,11 +2904,11 @@ msgstr "
 msgid "small"
 msgstr "malé"
 
-#: ../src/common/cmdline.cpp:895
+#: ../src/common/cmdline.cpp:908
 msgid "str"
 msgstr "øetìzec"
 
-#: ../src/common/datetime.cpp:3205
+#: ../src/common/datetime.cpp:3224
 msgid "tenth"
 msgstr "desátý"
 
@@ -2933,27 +2916,27 @@ msgstr "des
 msgid "the response to the transaction caused the DDE_FBUSY bit to be set."
 msgstr "odpovìï na transakci zpùsobila nastavení bitu DDE_FBUSY."
 
-#: ../src/common/datetime.cpp:3198
+#: ../src/common/datetime.cpp:3217
 msgid "third"
 msgstr "tøetí"
 
-#: ../src/common/datetime.cpp:3208
+#: ../src/common/datetime.cpp:3227
 msgid "thirteenth"
 msgstr "tøináctý"
 
-#: ../src/common/datetime.cpp:3003
+#: ../src/common/datetime.cpp:3022
 msgid "today"
 msgstr "dnes"
 
-#: ../src/common/datetime.cpp:3005
+#: ../src/common/datetime.cpp:3024
 msgid "tomorrow"
 msgstr "vèera"
 
-#: ../src/common/datetime.cpp:3207
+#: ../src/common/datetime.cpp:3226
 msgid "twelfth"
 msgstr "dvanáctý"
 
-#: ../src/common/datetime.cpp:3215
+#: ../src/common/datetime.cpp:3234
 msgid "twentieth"
 msgstr "dvacátý"
 
@@ -3002,7 +2985,7 @@ msgstr "velmi velk
 msgid "very small"
 msgstr "velmi malé"
 
-#: ../src/common/timercmn.cpp:266
+#: ../src/common/timercmn.cpp:260
 msgid "wxGetTimeOfDay failed."
 msgstr "wxGetTimeOfDay selhalo."
 
@@ -3023,10 +3006,30 @@ msgstr "wxWindows nemohou otev
 msgid "wxWindows: error finding temporary file name.\n"
 msgstr "wxWindows: chyba pøi hledání jména doèasného souboru.\n"
 
-#: ../src/common/datetime.cpp:3004
+#: ../src/common/datetime.cpp:3023
 msgid "yesterday"
 msgstr "vèera"
 
+#~ msgid "Previewing"
+#~ msgstr "Vytváøím náhled"
+
+#~ msgid "Print Error"
+#~ msgstr "Chyba tisku"
+
+#~ msgid ""
+#~ "There was a problem previewing.\n"
+#~ "Perhaps your current printer is not set correctly?"
+#~ msgstr ""
+#~ "Pøi vytváøení náhledu se vyskytl problém.\n"
+#~ "Mo¾ná nemáte správnì nastavenou tiskárnu?"
+
+#~ msgid ""
+#~ "There was a problem printing.\n"
+#~ "Perhaps your current printer is not set correctly?"
+#~ msgstr ""
+#~ "Pøi tisku se vyskytla chyba.\n"
+#~ "Mo¾ná máte ¹patnì nastavenou tiskárnu?"
+
 #~ msgid "Baltic II (ISO-8859-10)"
 #~ msgstr "Baltské II (ISO-8859-10)"
 
diff --git a/samples/console/console.cpp b/samples/console/console.cpp
index 74b31145f1..a935db655f 100644
--- a/samples/console/console.cpp
+++ b/samples/console/console.cpp
@@ -37,11 +37,11 @@
 
 //#define TEST_ARRAYS
 //#define TEST_CMDLINE
-#define TEST_DATETIME
+//#define TEST_DATETIME
 //#define TEST_DIR
 //#define TEST_DLLLOADER
 //#define TEST_EXECUTE
-//#define TEST_FILE
+#define TEST_FILE
 //#define TEST_FILECONF
 //#define TEST_HASH
 //#define TEST_LIST
@@ -53,9 +53,10 @@
 //#define TEST_STRINGS
 //#define TEST_THREADS
 //#define TEST_TIMER
-//#define TEST_VCARD
+//#define TEST_VCARD            -- don't enable this (VZ)
 //#define TEST_WCHAR
 //#define TEST_ZIP
+//#define TEST_ZLIB
 
 // ----------------------------------------------------------------------------
 // test class for container objects
@@ -367,7 +368,7 @@ static void TestFileRead()
 
         puts("File dump:\n----------");
 
-        static const size_t len = 1024;
+        static const off_t len = 1024;
         char buf[len];
         for ( ;; )
         {
@@ -403,6 +404,24 @@ static void TestTextFileRead()
     {
         printf("Number of lines: %u\n", file.GetLineCount());
         printf("Last line: '%s'\n", file.GetLastLine().c_str());
+
+        wxString s;
+
+        puts("\nDumping the entire file:");
+        for ( s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
+        {
+            printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+        }
+        printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+
+        puts("\nAnd now backwards:");
+        for ( s = file.GetLastLine();
+              file.GetCurrentLine() != 0;
+              s = file.GetPrevLine() )
+        {
+            printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
+        }
+        printf("%6u: %s\n", file.GetCurrentLine() + 1, s.c_str());
     }
     else
     {
@@ -1643,6 +1662,58 @@ static void TestZipStreamRead()
 
 #endif // TEST_ZIP
 
+// ----------------------------------------------------------------------------
+// ZLIB stream
+// ----------------------------------------------------------------------------
+
+#ifdef TEST_ZLIB
+
+#include <wx/zstream.h>
+#include <wx/wfstream.h>
+
+static const wxChar *FILENAME_GZ = _T("test.gz");
+static const char *TEST_DATA = "hello and hello again";
+
+static void TestZlibStreamWrite()
+{
+    puts("*** Testing Zlib stream reading ***\n");
+
+    wxFileOutputStream fileOutStream(FILENAME_GZ);
+    wxZlibOutputStream ostr(fileOutStream, 0);
+    printf("Compressing the test string... ");
+    ostr.Write(TEST_DATA, sizeof(TEST_DATA));
+    if ( !ostr )
+    {
+        puts("(ERROR: failed)");
+    }
+    else
+    {
+        puts("(ok)");
+    }
+
+    puts("\n----- done ------");
+}
+
+static void TestZlibStreamRead()
+{
+    puts("*** Testing Zlib stream reading ***\n");
+
+    wxFileInputStream fileInStream(FILENAME_GZ);
+    wxZlibInputStream istr(fileInStream);
+    printf("Archive size: %u\n", istr.GetSize());
+
+    puts("Dumping the file:");
+    while ( !istr.Eof() )
+    {
+        putchar(istr.GetC());
+        fflush(stdout);
+    }
+
+    puts("\n----- done ------");
+}
+
+#endif // TEST_ZLIB
+
 // ----------------------------------------------------------------------------
 // date time
 // ----------------------------------------------------------------------------
@@ -2484,7 +2555,25 @@ static void TestTimeMS()
 
     printf("Now = %s\n", dt1.Format("%H:%M:%S:%l").c_str());
     printf("UNow = %s\n", dt2.Format("%H:%M:%S:%l").c_str());
-    printf("Difference is %s\n", (dt2 - dt1).Format("%l").c_str());
+    printf("Dummy loop: ");
+    for ( int i = 0; i < 6000; i++ )
+    {
+        //for ( int j = 0; j < 10; j++ )
+        {
+            wxString s;
+            s.Printf("%g", sqrt(i));
+        }
+
+        if ( !(i % 100) )
+            putchar('.');
+    }
+    puts(", done");
+
+    dt1 = dt2;
+    dt2 = wxDateTime::UNow();
+    printf("UNow = %s\n", dt2.Format("%H:%M:%S:%l").c_str());
+
+    printf("Loop executed in %s ms\n", (dt2 - dt1).Format("%l").c_str());
 
     puts("\n*** done ***");
 }
@@ -3434,7 +3523,8 @@ int main(int argc, char **argv)
 #endif // TEST_LOG
 
 #ifdef TEST_FILE
-    TestFileRead();
+    if ( 0 )
+        TestFileRead();
     TestTextFileRead();
 #endif // TEST_FILE
 
@@ -3524,10 +3614,10 @@ int main(int argc, char **argv)
         TestTimeArithmetics();
         TestTimeHolidays();
         TestTimeFormat();
+        TestTimeMS();
 
         TestTimeZoneBug();
     }
-    TestTimeMS();
     if ( 0 )
         TestInteractive();
 #endif // TEST_DATETIME
@@ -3546,6 +3636,12 @@ int main(int argc, char **argv)
     TestZipStreamRead();
 #endif // TEST_ZIP
 
+#ifdef TEST_ZLIB
+    if ( 0 )
+    TestZlibStreamWrite();
+    TestZlibStreamRead();
+#endif // TEST_ZLIB
+
     wxUninitialize();
 
     return 0;
diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp
index 5f623ff4cc..2b4e7e17c8 100644
--- a/samples/controls/controls.cpp
+++ b/samples/controls/controls.cpp
@@ -308,7 +308,7 @@ bool MyApp::OnInit()
     // parse the cmd line
     int x = 50,
         y = 50;
-    if ( argc == 2 )
+    if ( argc == 3 )
     {
         wxSscanf(argv[1], "%d", &x);
         wxSscanf(argv[2], "%d", &y);
diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp
index 1b5522ec68..9643f3dff5 100644
--- a/samples/db/dbtest.cpp
+++ b/samples/db/dbtest.cpp
@@ -82,7 +82,8 @@ wxDb    *READONLY_DB;
 /*
  * This function will return the exact string(s) from the database engine
  * indicating all error conditions which have just occured during the
- * last call to the database engine.
+ * last call to the database engine for the database connection pointed
+ * to by pDb.
  *
  * This demo uses the returned string by displaying it in a wxMessageBox.  The
  * formatting therefore is not the greatest, but this is just a demo, not a
@@ -91,9 +92,10 @@ wxDb    *READONLY_DB;
  * NOTE: The value returned by this function is for temporary use only and
  *       should be copied for long term use
  */
-char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
+const char *GetExtendedDBErrorMsg(wxDb *pDb, char *ErrFile, int ErrLine)
 {
     static wxString msg;
+    msg = "";
 
     wxString tStr;
 
@@ -110,29 +112,23 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
     msg.Append ("\nODBC errors:\n");
     msg += "\n";
     
-    /* Scan through each database connection displaying 
-     * any ODBC errors that have occured. */
-    wxDbList *pDbList;
-    for (pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext)
-    {
-        // Skip over any free connections
-        if (pDbList->Free)
-            continue;
-        // Display errors for this connection
-        int i;
-        for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
+    // Display errors for this connection
+    int i;
+    for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
+    {
+        if (pDb->errorList[i])
         {
-            if (pDbList->PtrDb->errorList[i])
-            {
-                msg.Append(pDbList->PtrDb->errorList[i]);
-                if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0)
-                    msg.Append("\n");
-            }
+            msg.Append(pDb->errorList[i]);
+            if (wxStrcmp(pDb->errorList[i],"") != 0)
+                msg.Append("\n");
+            // Clear the errmsg buffer so the next error will not
+            // end up showing the previous error that have occurred
+            wxStrcpy(pDb->errorList[i],"");
         }
     }
     msg += "\n";
 
-    return (char*) (const char*) msg;
+    return msg.c_str();
 }  // GetExtendedDBErrorMsg
 
 
@@ -146,7 +142,9 @@ bool DatabaseDemoApp::OnInit()
 
     // Make a menubar
     wxMenu *file_menu = new wxMenu;
-    file_menu->Append(FILE_CREATE, "&Create contact table");
+    file_menu->Append(FILE_CREATE, "&Create CONTACT table");
+    file_menu->Append(FILE_RECREATE_TABLE, "&Recreate CONTACT table");
+    file_menu->Append(FILE_RECREATE_INDEXES, "&Recreate CONTACT indexes");
     file_menu->Append(FILE_EXIT, "E&xit");
 
     wxMenu *edit_menu = new wxMenu;
@@ -173,6 +171,9 @@ bool DatabaseDemoApp::OnInit()
     params.Password[0]   = 0;
     params.DirPath[0]    = 0;
 
+    // Show the frame
+    DemoFrame->Show(TRUE);
+
     FILE *paramFile;
     if ((paramFile = fopen(paramFilename, "r")) == NULL)
     {
@@ -225,36 +226,77 @@ bool DatabaseDemoApp::OnInit()
     DemoFrame->BuildEditorDialog();
 
     // Show the frame
-    DemoFrame->Show(TRUE);
+    DemoFrame->Refresh();
 
     return TRUE;
 }  // DatabaseDemoApp::OnInit()
 
+
 BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame)
     EVT_MENU(FILE_CREATE, DatabaseDemoFrame::OnCreate)
+    EVT_MENU(FILE_RECREATE_TABLE, DatabaseDemoFrame::OnRecreateTable)
+    EVT_MENU(FILE_RECREATE_INDEXES, DatabaseDemoFrame::OnRecreateIndexes)
     EVT_MENU(FILE_EXIT, DatabaseDemoFrame::OnExit)
     EVT_MENU(EDIT_PARAMETERS, DatabaseDemoFrame::OnEditParameters)
     EVT_MENU(ABOUT_DEMO, DatabaseDemoFrame::OnAbout)
     EVT_CLOSE(DatabaseDemoFrame::OnCloseWindow)
 END_EVENT_TABLE()
 
+
 // DatabaseDemoFrame constructor
 DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
-  const wxPoint& pos, const wxSize& size):
-  wxFrame(frame, -1, title, pos, size)
+                                     const wxPoint& pos, const wxSize& size):
+                                        wxFrame(frame, -1, title, pos, size)
 {
-// Put any code in necessary for initializing the main frame here
-}
+    // Put any code in necessary for initializing the main frame here
+    pEditorDlg = NULL;
+    pParamDlg  = NULL;
+}  // DatabaseDemoFrame constructor
+
 
 void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
 {
-    CreateDataTable();
-}
+    CreateDataTable(FALSE);
+}  // DatabaseDemoFrame::OnCreate()
+
+
+void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
+{
+    CreateDataTable(TRUE);
+}  // DatabaseDemoFrame::OnRecreate()
+
+
+void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
+{
+    // Using a new connection to the database so as not to disturb
+    // the current cursors on the table in use in the editor dialog
+    Ccontact *Contact = new Ccontact();
+
+    if (!Contact)
+    {
+        wxEndBusyCursor();
+        wxMessageBox("Error allocating memory for 'Ccontact'object.\n\nTable could not be opened.","Error...",wxOK | wxICON_EXCLAMATION);
+        return;
+    }
+
+    if (!Contact->CreateIndexes())
+    {
+       wxEndBusyCursor();
+       wxString tStr;
+       tStr  = "Error creating CONTACTS indexes.\nNew indexes will be unavailable.\n\n";
+       tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+       wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+    }
+
+    delete Contact;
+    Contact = NULL;
+}  // DatabaseDemoFrame::OnRecreateIndexes()
 
 void DatabaseDemoFrame::OnExit(wxCommandEvent& event)
 {
     Close();
-}
+}  // DatabaseDemoFrame::OnExit()
+
 
 void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
 {
@@ -262,12 +304,14 @@ void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
         BuildParameterDialog(this);
     else
         wxMessageBox("Cannot change database parameters while creating or editing a record","Notice...",wxOK | wxICON_INFORMATION);
-}
+}  // DatabaseDemoFrame::OnEditParameters()
+
 
 void DatabaseDemoFrame::OnAbout(wxCommandEvent& event)
 {
     wxMessageBox("wxWindows sample program for database classes\n\nContributed on 27 July 1998","About...",wxOK | wxICON_INFORMATION);
-}
+}  // DatabaseDemoFrame::OnAbout()
+
 
 void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
 {
@@ -275,14 +319,21 @@ void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
     // to close the program here that is not done elsewhere
 
     // Clean up time
-    if (pEditorDlg->Close())
+    if (pEditorDlg && pEditorDlg->Close())
         pEditorDlg = NULL;
     else
     {
-        event.Veto();
-        return;
+        if (pEditorDlg)
+        {
+            event.Veto();
+            return;
+        }
     }
 
+    // This function will close all the connections to the database that have been
+    // previously cached.
+    wxDbCloseConnections();
+
     // Cleans up the environment space allocated for the SQL/ODBC connection handle
     SQLFreeEnv(DbConnectInf.Henv);
 
@@ -291,9 +342,11 @@ void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
 }  // DatabaseDemoFrame::OnCloseWindow()
 
 
-void DatabaseDemoFrame::CreateDataTable()
+void DatabaseDemoFrame::CreateDataTable(bool recreate)
 {
-    bool Ok = (wxMessageBox("Any data currently residing in the table will be erased.\n\nAre you sure?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
+    bool Ok = TRUE;
+    if (recreate)
+       Ok = (wxMessageBox("Any data currently residing in the table will be erased.\n\nAre you sure?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
 
     if (!Ok)
         return;
@@ -310,23 +363,23 @@ void DatabaseDemoFrame::CreateDataTable()
         return;
     }
 
-    if (!Contact->CreateTable(FALSE))
+    if (!Contact->CreateTable(recreate))
     {
         wxEndBusyCursor();
         wxString tStr;
         tStr  = "Error creating CONTACTS table.\nTable was not created.\n\n";
-        tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+        tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
         wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
         success = FALSE;
     }
-     else
+    else
     {
         if (!Contact->CreateIndexes())
         {
             wxEndBusyCursor();
             wxString tStr;
             tStr  = "Error creating CONTACTS indexes.\nIndexes will be unavailable.\n\n";
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+            tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
             wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
             success = FALSE;
         }
@@ -335,6 +388,7 @@ void DatabaseDemoFrame::CreateDataTable()
         wxEndBusyCursor();
 
     delete Contact;
+     Contact = NULL;
 
     if (success)
         wxMessageBox("Table and index(es) were successfully created.","Notice...",wxOK | wxICON_INFORMATION);
@@ -343,9 +397,24 @@ void DatabaseDemoFrame::CreateDataTable()
 
 void DatabaseDemoFrame::BuildEditorDialog()
 {
+    pEditorDlg = NULL;
     pEditorDlg = new CeditorDlg(this);
-    if (!pEditorDlg)
+    if (pEditorDlg)
+    {
+        pEditorDlg->Initialize();
+        if (!pEditorDlg->initialized)
+        {
+            pEditorDlg->Close();
+            delete pEditorDlg;
+            wxMessageBox("Unable to initialize the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
+            DemoFrame->Close();
+        }
+    } 
+    else
+    {
         wxMessageBox("Unable to create the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
+        DemoFrame->Close();
+    }
 }  // DatabaseDemoFrame::BuildEditorDialog()
 
 
@@ -414,7 +483,7 @@ Ccontact::~Ccontact()
         {
             wxString tStr;
             tStr  = "Unable to Free the Ccontact data table handle\n\n";
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+            tStr += GetExtendedDBErrorMsg(GetDb(),__FILE__,__LINE__);
             wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
         }
     }
@@ -509,168 +578,18 @@ BEGIN_EVENT_TABLE(CeditorDlg, wxPanel)
     EVT_CLOSE(CeditorDlg::OnCloseWindow)
 END_EVENT_TABLE()
  
-CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
+CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 0, 0, 537, 480)
 {
     // Since the ::OnCommand() function is overridden, this prevents the widget
     // detection in ::OnCommand() until all widgets have been initialized to prevent
     // uninitialized pointers from crashing the program
     widgetPtrsSet = FALSE;
 
-    // Create the data structure and a new database connection.  
-    // (As there is not a pDb being passed in the constructor, a new database
-    // connection is created)
-    Contact = new Ccontact();
-
-    if (!Contact)
-    {
-        wxMessageBox("Unable to instantiate an instance of Ccontact","Error...",wxOK | wxICON_EXCLAMATION);
-        return;
-    }
-
-    // Check if the table exists or not.  If it doesn't, ask the user if they want to 
-    // create the table.  Continue trying to create the table until it exists, or user aborts
-    while (!Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME,DbConnectInf.Uid,DbConnectInf.defaultDir))
-    {
-        wxString tStr;
-        tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
-        tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
-        wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
-
-        bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
-
-        if (!createTable)
-        {
-            delete Contact;
-            Close();
-            DemoFrame->Close();
-            return;
-        }
-        else
-            DemoFrame->CreateDataTable();
-    }
-
-    // Tables must be "opened" before anything other than creating/deleting table can be done
-    if (!Contact->Open())
-    {
-        // Table does exist, there was some problem opening it.  Currently this should
-        // never fail, except in the case of the table not exisiting.  Open() basically
-        // only sets up variable/pointer values, other than checking for table existence.
-        if (Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME))
-        {
-            wxString tStr;
-            tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
-            wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
-            delete Contact;
-            Close();
-            DemoFrame->Close();
-            return;
-        }
-    }
+    initialized = FALSE;
 
-    // Build the dialog
+    Contact = NULL;
 
-    (void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "",  wxPoint(15, 1), wxSize(497,  69), 0, "FunctionGrp");
-    (void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
-
-    pCreateBtn      = new wxButton(this, EDITOR_DIALOG_CREATE,           "&Create",     wxPoint( 25,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CreateBtn");
-    pEditBtn        = new wxButton(this, EDITOR_DIALOG_EDIT,             "&Edit",       wxPoint(102,  21), wxSize( 70,  35), 0, wxDefaultValidator, "EditBtn");
-    pDeleteBtn      = new wxButton(this, EDITOR_DIALOG_DELETE,           "&Delete",     wxPoint(179,  21), wxSize( 70,  35), 0, wxDefaultValidator, "DeleteBtn");
-    pCopyBtn        = new wxButton(this, EDITOR_DIALOG_COPY,             "Cop&y",       wxPoint(256,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CopyBtn");
-    pSaveBtn        = new wxButton(this, EDITOR_DIALOG_SAVE,             "&Save",       wxPoint(333,  21), wxSize( 70,  35), 0, wxDefaultValidator, "SaveBtn");
-    pCancelBtn      = new wxButton(this, EDITOR_DIALOG_CANCEL,           "C&ancel",     wxPoint(430,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CancelBtn");
-    pPrevBtn        = new wxButton(this, EDITOR_DIALOG_PREV,             "<< &Prev",    wxPoint(430,  81), wxSize( 70,  35), 0, wxDefaultValidator, "PrevBtn");
-    pNextBtn        = new wxButton(this, EDITOR_DIALOG_NEXT,             "&Next >>",    wxPoint(430, 121), wxSize( 70,  35), 0, wxDefaultValidator, "NextBtn");
-    pQueryBtn       = new wxButton(this, EDITOR_DIALOG_QUERY,            "&Query",      wxPoint(430, 161), wxSize( 70,  35), 0, wxDefaultValidator, "QueryBtn");
-    pResetBtn       = new wxButton(this, EDITOR_DIALOG_RESET,            "&Reset",      wxPoint(430, 200), wxSize( 70,  35), 0, wxDefaultValidator, "ResetBtn");
-    pNameMsg        = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG,     "Name:",       wxPoint( 17,  80), wxSize( -1,  -1), 0, "NameMsg");
-    pNameTxt        = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT,      "",            wxPoint( 17,  97), wxSize(308,  25), 0, wxDefaultValidator, "NameTxt");
-    pNameListBtn    = new wxButton(this, EDITOR_DIALOG_LOOKUP,           "&Lookup",     wxPoint(333,  97), wxSize( 70,  24), 0, wxDefaultValidator, "LookupBtn");
-    pAddress1Msg    = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:",    wxPoint( 17, 130), wxSize( -1,  -1), 0, "Address1Msg");
-    pAddress1Txt    = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT,  "",            wxPoint( 17, 147), wxSize(308,  25), 0, wxDefaultValidator, "Address1Txt");
-    pAddress2Msg    = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:",    wxPoint( 17, 180), wxSize( -1,  -1), 0, "Address2Msg");
-    pAddress2Txt    = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT,  "",            wxPoint( 17, 197), wxSize(308,  25), 0, wxDefaultValidator, "Address2Txt");
-    pCityMsg        = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG,     "City:",       wxPoint( 17, 230), wxSize( -1,  -1), 0, "CityMsg");
-    pCityTxt        = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT,      "",            wxPoint( 17, 247), wxSize(225,  25), 0, wxDefaultValidator, "CityTxt");
-    pStateMsg       = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG,    "State:",      wxPoint(250, 230), wxSize( -1,  -1), 0, "StateMsg");
-    pStateTxt       = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT,     "",            wxPoint(250, 247), wxSize(153,  25), 0, wxDefaultValidator, "StateTxt");
-    pCountryMsg     = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG,  "Country:",    wxPoint( 17, 280), wxSize( -1,  -1), 0, "CountryMsg");
-    pCountryTxt     = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT,   "",            wxPoint( 17, 297), wxSize(225,  25), 0, wxDefaultValidator, "CountryTxt");
-    pPostalCodeMsg  = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG,   "Postal Code:",wxPoint(250, 280), wxSize( -1,  -1), 0, "PostalCodeMsg");
-    pPostalCodeTxt  = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT,    "",            wxPoint(250, 297), wxSize(153,  25), 0, wxDefaultValidator, "PostalCodeTxt");
-
-    wxString choice_strings[5];
-    choice_strings[0] = "English";
-    choice_strings[1] = "French";
-    choice_strings[2] = "German";
-    choice_strings[3] = "Spanish";
-    choice_strings[4] = "Other";
-
-    pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE,                        wxPoint( 17, 346), wxSize(277,  -1), 5, choice_strings);
-    pNativeLangMsg    = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG,   "Native language:", wxPoint( 17, 330), wxSize( -1,  -1), 0, "NativeLangMsg");
-
-    wxString radio_strings[2];
-    radio_strings[0]  = "No";
-    radio_strings[1]  = "Yes";
-    pDeveloperRadio   = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER,     "Developer:",       wxPoint(303, 330), wxSize( -1,  -1), 2, radio_strings, 2, wxHORIZONTAL);
-    pJoinDateMsg      = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG,   "Date joined:",     wxPoint( 17, 380), wxSize( -1,  -1), 0, "JoinDateMsg");
-    pJoinDateTxt      = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT,    "",                 wxPoint( 17, 397), wxSize(150,  25), 0, wxDefaultValidator, "JoinDateTxt");
-    pContribMsg       = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG,"Contributions:",   wxPoint(175, 380), wxSize( -1,  -1), 0, "ContribMsg");
-    pContribTxt       = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "",                 wxPoint(175, 397), wxSize(120,  25), 0, wxDefaultValidator, "ContribTxt");
-    pLinesMsg         = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG,  "Lines of code:",   wxPoint(303, 380), wxSize( -1,  -1), 0, "LinesMsg");
-    pLinesTxt         = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT,   "",                 wxPoint(303, 397), wxSize(100,  25), 0, wxDefaultValidator, "LinesTxt");
-
-    // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to 
-    // handle all widget processing
-    widgetPtrsSet = TRUE;
-
-    // Setup the orderBy and where clauses to return back a single record as the result set, 
-    // as there will only be one record being shown on the dialog at a time, this optimizes
-    // network traffic by only returning a one row result
-    
-    Contact->SetOrderByClause("NAME");  // field name to sort by
-
-    // The wxString "whereStr" is not a member of the wxDbTable object, it is a member variable
-    // specifically in the Ccontact class.  It is used here for simpler construction of a varying
-    // length string, and then after the string is built, the wxDbTable member variable "where" is
-    // assigned the pointer to the constructed string.
-    //
-    // The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s" 
-    // to achieve a single row (in this case the first name in alphabetical order).
-    
-    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
-    {
-        Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->GetTableName());
-        // NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
-        Contact->SetWhereClause(Contact->whereStr.c_str());
-    }
-    else
-       Contact->SetWhereClause("");
-
-    // Perform the Query to get the result set.  
-    // NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.  
-    //       Only if there is a database error will Query() come back as FALSE
-    if (!Contact->Query())
-    {
-        wxString tStr;
-        tStr  = "ODBC error during Query()\n\n";
-        tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
-        wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
-        GetParent()->Close();
-        return;
-    }
-
-    // Since Query succeeded, now get the row that was returned
-    if (!Contact->GetNext())
-        // If the GetNext() failed at this point, then there are no rows to retrieve, 
-        // so clear the values in the members of "Contact" so that PutData() blanks the 
-        // widgets on the dialog
-        Contact->Initialize();
-
-    SetMode(mView);
-    PutData();
-
-    Show(TRUE);
+    Show(FALSE);
 }  // CeditorDlg constructor
 
 
@@ -680,7 +599,10 @@ void CeditorDlg::OnCloseWindow(wxCloseEvent& event)
     if ((mode != mCreate) && (mode != mEdit))
     {
         if (Contact)
+        {
             delete Contact;
+            Contact = NULL;
+        }
         this->Destroy();
     }
     else
@@ -691,11 +613,11 @@ void CeditorDlg::OnCloseWindow(wxCloseEvent& event)
 }  // CeditorDlg::OnCloseWindow()
 
 
-void CeditorDlg::OnButton( wxCommandEvent &event )
+void CeditorDlg::OnButton(wxCommandEvent &event)
 {
-  wxWindow *win = (wxWindow*) event.GetEventObject();
-  OnCommand( *win, event );
-}
+    wxWindow *win = (wxWindow*) event.GetEventObject();
+    OnCommand( *win, event );
+}  // CeditorDlg::OnButton()
 
 
 void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
@@ -805,7 +727,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         }
 
         // Previous record not available, retrieve first record in table
-        if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+        if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
         {
             Contact->whereStr  = "NAME = (SELECT MIN(NAME) FROM ";
             Contact->whereStr += Contact->GetTableName();
@@ -819,7 +741,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         {
             wxString tStr;
             tStr  = "ODBC error during Query()\n\n";
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+            tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
             wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
             SetMode(mView);
             return;
@@ -863,11 +785,10 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         // display it, if the query string has changed.
         if (wxStrcmp(qryWhere, (const char*) Contact->qryWhereStr))
         {
- 
             Contact->whereStr = "";
             Contact->SetOrderByClause("NAME");
 
-            if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+            if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
             {
                 Contact->whereStr  = "NAME = (SELECT MIN(NAME) FROM ";
                 Contact->whereStr += CONTACT_TABLE_NAME;
@@ -888,7 +809,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
             {
                 wxString tStr;
                 tStr  = "ODBC error during Query()\n\n";
-                tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+                tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
                 wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
                 return;
             }
@@ -911,7 +832,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         Contact->qryWhereStr = "";
         Contact->SetOrderByClause("NAME");
 
-        if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+        if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
         {
             Contact->whereStr        = "NAME = (SELECT MIN(NAME) FROM ";
             Contact->whereStr        += CONTACT_TABLE_NAME;
@@ -923,7 +844,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         {
             wxString tStr;
             tStr  = "ODBC error during Query()\n\n";
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+            tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
             wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
             return;
         }
@@ -957,10 +878,182 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
 
         return;
     }
-
 }  // CeditorDlg::OnCommand()
 
 
+bool CeditorDlg::Initialize()
+{
+    // Create the data structure and a new database connection.  
+    // (As there is not a pDb being passed in the constructor, a new database
+    // connection is created)
+    Contact = new Ccontact();
+
+    if (!Contact)
+    {
+        wxMessageBox("Unable to instantiate an instance of Ccontact","Error...",wxOK | wxICON_EXCLAMATION);
+        return FALSE;
+    }
+
+    // Check if the table exists or not.  If it doesn't, ask the user if they want to 
+    // create the table.  Continue trying to create the table until it exists, or user aborts
+    while (!Contact->GetDb()->TableExists((char *)CONTACT_TABLE_NAME,DbConnectInf.Uid,DbConnectInf.defaultDir))
+    {
+        wxString tStr;
+        tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
+        tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+        wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+
+        bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
+
+        if (!createTable)
+        {
+//            Close();
+            return FALSE;
+        }
+        else
+            DemoFrame->CreateDataTable(TRUE);
+    }
+
+    // Tables must be "opened" before anything other than creating/deleting table can be done
+    if (!Contact->Open())
+    {
+        // Table does exist, or there was some problem opening it.  Currently this should
+        // never fail, except in the case of the table not exisiting or the current 
+        // user has insufficent privileges to access the table
+#if 0
+// This code is experimenting with a new function that will hopefully be available
+// in the 2.4 release.  This check will determine whether the open failing was due
+// to the table not existing, or the users privileges being insufficient to
+// open the table.
+        if (!Contact->GetDb()->TablePrivileges(CONTACT_TABLE_NAME,"SELECT",Contact->GetDb()->GetUsername(),DbConnectInf.defaultDir))
+        {
+            wxString tStr;
+            tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
+            tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+            wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+        }
+        else 
+#endif
+        if (Contact->GetDb()->TableExists(CONTACT_TABLE_NAME,Contact->GetDb()->GetUsername(),DbConnectInf.defaultDir))
+        {
+            wxString tStr;
+            tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
+            tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+            wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+        }
+
+        return FALSE;
+    }
+
+    // Build the dialog
+
+    (void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "",  wxPoint(15, 1), wxSize(497,  69), 0, "FunctionGrp");
+    (void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
+
+    pCreateBtn      = new wxButton(this, EDITOR_DIALOG_CREATE,           "&Create",     wxPoint( 25,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CreateBtn");
+    pEditBtn        = new wxButton(this, EDITOR_DIALOG_EDIT,             "&Edit",       wxPoint(102,  21), wxSize( 70,  35), 0, wxDefaultValidator, "EditBtn");
+    pDeleteBtn      = new wxButton(this, EDITOR_DIALOG_DELETE,           "&Delete",     wxPoint(179,  21), wxSize( 70,  35), 0, wxDefaultValidator, "DeleteBtn");
+    pCopyBtn        = new wxButton(this, EDITOR_DIALOG_COPY,             "Cop&y",       wxPoint(256,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CopyBtn");
+    pSaveBtn        = new wxButton(this, EDITOR_DIALOG_SAVE,             "&Save",       wxPoint(333,  21), wxSize( 70,  35), 0, wxDefaultValidator, "SaveBtn");
+    pCancelBtn      = new wxButton(this, EDITOR_DIALOG_CANCEL,           "C&ancel",     wxPoint(430,  21), wxSize( 70,  35), 0, wxDefaultValidator, "CancelBtn");
+    pPrevBtn        = new wxButton(this, EDITOR_DIALOG_PREV,             "<< &Prev",    wxPoint(430,  81), wxSize( 70,  35), 0, wxDefaultValidator, "PrevBtn");
+    pNextBtn        = new wxButton(this, EDITOR_DIALOG_NEXT,             "&Next >>",    wxPoint(430, 121), wxSize( 70,  35), 0, wxDefaultValidator, "NextBtn");
+    pQueryBtn       = new wxButton(this, EDITOR_DIALOG_QUERY,            "&Query",      wxPoint(430, 161), wxSize( 70,  35), 0, wxDefaultValidator, "QueryBtn");
+    pResetBtn       = new wxButton(this, EDITOR_DIALOG_RESET,            "&Reset",      wxPoint(430, 200), wxSize( 70,  35), 0, wxDefaultValidator, "ResetBtn");
+    pNameMsg        = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG,     "Name:",       wxPoint( 17,  80), wxSize( -1,  -1), 0, "NameMsg");
+    pNameTxt        = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT,      "",            wxPoint( 17,  97), wxSize(308,  25), 0, wxDefaultValidator, "NameTxt");
+    pNameListBtn    = new wxButton(this, EDITOR_DIALOG_LOOKUP,           "&Lookup",     wxPoint(333,  97), wxSize( 70,  24), 0, wxDefaultValidator, "LookupBtn");
+    pAddress1Msg    = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:",    wxPoint( 17, 130), wxSize( -1,  -1), 0, "Address1Msg");
+    pAddress1Txt    = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT,  "",            wxPoint( 17, 147), wxSize(308,  25), 0, wxDefaultValidator, "Address1Txt");
+    pAddress2Msg    = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:",    wxPoint( 17, 180), wxSize( -1,  -1), 0, "Address2Msg");
+    pAddress2Txt    = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT,  "",            wxPoint( 17, 197), wxSize(308,  25), 0, wxDefaultValidator, "Address2Txt");
+    pCityMsg        = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG,     "City:",       wxPoint( 17, 230), wxSize( -1,  -1), 0, "CityMsg");
+    pCityTxt        = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT,      "",            wxPoint( 17, 247), wxSize(225,  25), 0, wxDefaultValidator, "CityTxt");
+    pStateMsg       = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG,    "State:",      wxPoint(250, 230), wxSize( -1,  -1), 0, "StateMsg");
+    pStateTxt       = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT,     "",            wxPoint(250, 247), wxSize(153,  25), 0, wxDefaultValidator, "StateTxt");
+    pCountryMsg     = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG,  "Country:",    wxPoint( 17, 280), wxSize( -1,  -1), 0, "CountryMsg");
+    pCountryTxt     = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT,   "",            wxPoint( 17, 297), wxSize(225,  25), 0, wxDefaultValidator, "CountryTxt");
+    pPostalCodeMsg  = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG,   "Postal Code:",wxPoint(250, 280), wxSize( -1,  -1), 0, "PostalCodeMsg");
+    pPostalCodeTxt  = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT,    "",            wxPoint(250, 297), wxSize(153,  25), 0, wxDefaultValidator, "PostalCodeTxt");
+
+    wxString choice_strings[5];
+    choice_strings[0] = "English";
+    choice_strings[1] = "French";
+    choice_strings[2] = "German";
+    choice_strings[3] = "Spanish";
+    choice_strings[4] = "Other";
+
+    pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE,                        wxPoint( 17, 346), wxSize(277,  -1), 5, choice_strings);
+    pNativeLangMsg    = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG,   "Native language:", wxPoint( 17, 330), wxSize( -1,  -1), 0, "NativeLangMsg");
+
+    wxString radio_strings[2];
+    radio_strings[0]  = "No";
+    radio_strings[1]  = "Yes";
+    pDeveloperRadio   = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER,     "Developer:",       wxPoint(303, 330), wxSize( -1,  -1), 2, radio_strings, 2, wxHORIZONTAL);
+    pJoinDateMsg      = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG,   "Date joined:",     wxPoint( 17, 380), wxSize( -1,  -1), 0, "JoinDateMsg");
+    pJoinDateTxt      = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT,    "",                 wxPoint( 17, 397), wxSize(150,  25), 0, wxDefaultValidator, "JoinDateTxt");
+    pContribMsg       = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG,"Contributions:",   wxPoint(175, 380), wxSize( -1,  -1), 0, "ContribMsg");
+    pContribTxt       = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "",                 wxPoint(175, 397), wxSize(120,  25), 0, wxDefaultValidator, "ContribTxt");
+    pLinesMsg         = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG,  "Lines of code:",   wxPoint(303, 380), wxSize( -1,  -1), 0, "LinesMsg");
+    pLinesTxt         = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT,   "",                 wxPoint(303, 397), wxSize(100,  25), 0, wxDefaultValidator, "LinesTxt");
+
+    // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to 
+    // handle all widget processing
+    widgetPtrsSet = TRUE;
+
+    // Setup the orderBy and where clauses to return back a single record as the result set, 
+    // as there will only be one record being shown on the dialog at a time, this optimizes
+    // network traffic by only returning a one row result
+    
+    Contact->SetOrderByClause("NAME");  // field name to sort by
+
+    // The wxString "whereStr" is not a member of the wxDbTable object, it is a member variable
+    // specifically in the Ccontact class.  It is used here for simpler construction of a varying
+    // length string, and then after the string is built, the wxDbTable member variable "where" is
+    // assigned the pointer to the constructed string.
+    //
+    // The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s" 
+    // to achieve a single row (in this case the first name in alphabetical order).
+    
+    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
+    {
+        Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->GetTableName());
+        // NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
+        Contact->SetWhereClause(Contact->whereStr.c_str());
+    }
+    else
+       Contact->SetWhereClause("");
+
+    // Perform the Query to get the result set.  
+    // NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.  
+    //       Only if there is a database error will Query() come back as FALSE
+    if (!Contact->Query())
+    {
+        wxString tStr;
+        tStr  = "ODBC error during Query()\n\n";
+        tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
+        wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
+//        GetParent()->Close();
+        return FALSE;
+    }
+
+    // Since Query succeeded, now get the row that was returned
+    if (!Contact->GetNext())
+        // If the GetNext() failed at this point, then there are no rows to retrieve, 
+        // so clear the values in the members of "Contact" so that PutData() blanks the 
+        // widgets on the dialog
+        Contact->Initialize();
+
+    SetMode(mView);
+    PutData();
+
+    Show(TRUE);
+
+    initialized = TRUE;
+    return TRUE;
+}  // CeditorDlg::Initialize()
+
+
 void CeditorDlg::FieldsEditable()
 {
     pNameTxt->Enable((mode == mCreate) || (mode == mEdit));
@@ -982,7 +1075,7 @@ void CeditorDlg::FieldsEditable()
 
 void CeditorDlg::SetMode(enum DialogModes m)
 {
-    bool    edit = FALSE;
+    bool edit = FALSE;
 
     mode = m;
     switch (mode)
@@ -1186,7 +1279,7 @@ bool CeditorDlg::Save()
                 {
                     wxString tStr;
                     tStr  = "A duplicate key value already exists in the table.\nUnable to save record\n\n";
-                    tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+                    tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
                     wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
                 }
                 else
@@ -1194,7 +1287,7 @@ bool CeditorDlg::Save()
                     // Some other unexpexted error occurred
                     wxString tStr;
                     tStr  = "Database insert failed\n\n";
-                    tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+                    tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
                     wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
                 }
             }
@@ -1205,7 +1298,7 @@ bool CeditorDlg::Save()
             {
                 wxString tStr;
                 tStr  = "Database update failed\n\n";
-                tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+                tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
                 wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
                 failed = TRUE;
             }
@@ -1235,7 +1328,7 @@ bool CeditorDlg::GetNextRec()
 {
     wxString w;
 
-    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
     {
         w  = "NAME = (SELECT MIN(NAME) FROM ";
         w += Contact->GetTableName();
@@ -1270,7 +1363,7 @@ bool CeditorDlg::GetPrevRec()
 {
     wxString w;
 
-    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES)
+    if (Contact->GetDb()->Dbms() != dbmsPOSTGRES && Contact->GetDb()->Dbms() != dbmsMY_SQL)
     {
         w  = "NAME = (SELECT MAX(NAME) FROM ";
         w += Contact->GetTableName();
@@ -1310,7 +1403,7 @@ bool CeditorDlg::GetRec(char *whereStr)
     {
         wxString tStr;
         tStr  = "ODBC error during Query()\n\n";
-        tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+        tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
         wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
 
         return(FALSE);
@@ -1375,21 +1468,27 @@ void CparameterDlg::OnCloseWindow(wxCloseEvent& event)
     if (!saved)
     {
         bool Ok = (wxMessageBox("No changes have been saved.\n\nAre you sure you wish exit the parameter screen?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
-
+        
         if (!Ok)
         {
             event.Veto();
             return;
         }
-
+        
         wxGetApp().params = savedParamSettings;
     }
 
     if (GetParent() != NULL)
         GetParent()->SetFocus();
-    this->Destroy();
 
-}  // Cparameter::OnCloseWindow()
+    while (wxIsBusy())
+        wxEndBusyCursor();
+
+    Show(FALSE);
+    SetReturnCode(0);  // added so BoundsChecker would not report use of uninitialized variable
+
+    this->Destroy();
+}  // CparameterDlg::OnCloseWindow()
 
 
 void CparameterDlg::OnButton( wxCommandEvent &event )
@@ -1398,6 +1497,7 @@ void CparameterDlg::OnButton( wxCommandEvent &event )
     OnCommand( *win, event );
 }
 
+
 void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
 {
     wxString widgetName;
@@ -1545,6 +1645,8 @@ void CparameterDlg::FillDataSourceList()
     int i;
     for (i = 0; wxStrlen(p[i]); i++)
         pParamODBCSourceList->Append(p[i]);
+
+     delete p;
 }  // CparameterDlg::CparameterDlg::FillDataSourceList()
 
 
@@ -1552,6 +1654,7 @@ BEGIN_EVENT_TABLE(CqueryDlg, wxDialog)
     EVT_BUTTON(-1,  CqueryDlg::OnButton)
     EVT_CLOSE(CqueryDlg::OnCloseWindow)
 END_EVENT_TABLE()
+
  
 // CqueryDlg() constructor
 CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg) : wxDialog (parent, QUERY_DIALOG, "Query", wxPoint(-1, -1), wxSize(480, 360))
@@ -1566,7 +1669,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
 
     // Initialize the WHERE clause from the string passed in
     pWhere = pWhereArg;                                            // Save a pointer to the output buffer
-    if (wxStrlen(pWhere) > DB_MAX_WHERE_CLAUSE_LEN)        // Check the length of the buffer passed in
+    if (wxStrlen(pWhere) > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN)  // Check the length of the buffer passed in
     {
         wxString s;
         s.Printf("Maximum where clause length exceeded.\nLength must be less than %d", DB_MAX_WHERE_CLAUSE_LEN+1);
@@ -1599,7 +1702,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
     pQuerySqlWhereMtxt      = new wxTextCtrl(this, QUERY_DIALOG_WHERE_TEXT,     "",                     wxPoint( 10, 159), wxSize(377, 134), wxTE_MULTILINE, wxDefaultValidator, "QuerySqlWhereMtxt");
     pQueryAddBtn            = new wxButton(this, QUERY_DIALOG_ADD,              "&Add",                 wxPoint(406,  24), wxSize( 56,  26), 0, wxDefaultValidator, "QueryAddBtn");
     pQueryAndBtn            = new wxButton(this, QUERY_DIALOG_AND,              "A&nd",                 wxPoint(406,  58), wxSize( 56,  26), 0, wxDefaultValidator, "QueryAndBtn");
-    pQueryOrBtn                = new wxButton(this, QUERY_DIALOG_OR,            "&Or",                  wxPoint(406,  92), wxSize( 56,  26), 0, wxDefaultValidator, "QueryOrBtn");
+    pQueryOrBtn             = new wxButton(this, QUERY_DIALOG_OR,               "&Or",                  wxPoint(406,  92), wxSize( 56,  26), 0, wxDefaultValidator, "QueryOrBtn");
     pQueryLParenBtn         = new wxButton(this, QUERY_DIALOG_LPAREN,           "(",                    wxPoint(406, 126), wxSize( 26,  26), 0, wxDefaultValidator, "QueryLParenBtn");
     pQueryRParenBtn         = new wxButton(this, QUERY_DIALOG_RPAREN,           ")",                    wxPoint(436, 126), wxSize( 26,  26), 0, wxDefaultValidator, "QueryRParenBtn");
     pQueryDoneBtn           = new wxButton(this, QUERY_DIALOG_DONE,             "&Done",                wxPoint(406, 185), wxSize( 56,  26), 0, wxDefaultValidator, "QueryDoneBtn");
@@ -1623,7 +1726,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
         wxEndBusyCursor();
         wxString tStr;
         tStr  = "ODBC error during GetColumns()\n\n";
-        tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+        tStr += GetExtendedDBErrorMsg(pDb,__FILE__,__LINE__);
         wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
         return;
     }
@@ -1662,7 +1765,6 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
     // Display the dialog window
     Centre(wxBOTH);
     ShowModal();
-
 }  // CqueryDlg() constructor
 
 
@@ -1671,11 +1773,12 @@ CqueryDlg::~CqueryDlg()
 }  // CqueryDlg::~CqueryDlg() destructor
 
 
-void CqueryDlg::OnButton( wxCommandEvent &event )
+void CqueryDlg::OnButton(wxCommandEvent &event)
 {
   wxWindow *win = (wxWindow*) event.GetEventObject();
   OnCommand( *win, event );
-}
+}  // CqueryDlg::OnButton()
+
 
 void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
 {
@@ -1693,33 +1796,33 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         // Set the help text
         switch((qryOp) pQueryOperatorChoice->GetSelection())
         {
-        case qryOpEQ:
-            pQueryHintMsg->SetLabel(langQRY_EQ);
-            break;
-        case qryOpLT:
-            pQueryHintMsg->SetLabel(langQRY_LT);
-            break;
-        case qryOpGT:
-            pQueryHintMsg->SetLabel(langQRY_GT);
-            break;
-        case qryOpLE:
-            pQueryHintMsg->SetLabel(langQRY_LE);
-            break;
-        case qryOpGE:
-            pQueryHintMsg->SetLabel(langQRY_GE);
-            break;
-        case qryOpBEGINS:
-            pQueryHintMsg->SetLabel(langQRY_BEGINS);
-            break;
-        case qryOpCONTAINS:
-            pQueryHintMsg->SetLabel(langQRY_CONTAINS);
-            break;
-        case qryOpLIKE:
-            pQueryHintMsg->SetLabel(langQRY_LIKE);
-            break;
-        case qryOpBETWEEN:
-            pQueryHintMsg->SetLabel(langQRY_BETWEEN);
-            break;
+            case qryOpEQ:
+                pQueryHintMsg->SetLabel(langQRY_EQ);
+                break;
+            case qryOpLT:
+                pQueryHintMsg->SetLabel(langQRY_LT);
+                break;
+            case qryOpGT:
+                pQueryHintMsg->SetLabel(langQRY_GT);
+                break;
+            case qryOpLE:
+                pQueryHintMsg->SetLabel(langQRY_LE);
+                break;
+            case qryOpGE:
+                pQueryHintMsg->SetLabel(langQRY_GE);
+                break;
+            case qryOpBEGINS:
+                pQueryHintMsg->SetLabel(langQRY_BEGINS);
+                break;
+            case qryOpCONTAINS:
+                pQueryHintMsg->SetLabel(langQRY_CONTAINS);
+                break;
+            case qryOpLIKE:
+                pQueryHintMsg->SetLabel(langQRY_LIKE);
+                break;
+            case qryOpBETWEEN:
+                pQueryHintMsg->SetLabel(langQRY_BETWEEN);
+                break;
         }
 
         // Hide the value2 widget
@@ -1729,57 +1832,57 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         // Disable the NOT operator for <, <=, >, >=
         switch((qryOp) pQueryOperatorChoice->GetSelection())
         {
-        case qryOpLT:
-        case qryOpGT:
-        case qryOpLE:
-        case qryOpGE:
-            pQueryNotCheck->SetValue(0);
-            pQueryNotCheck->Enable(FALSE);
-            break;
-        default:
-            pQueryNotCheck->Enable(TRUE);
-            break;
+            case qryOpLT:
+            case qryOpGT:
+            case qryOpLE:
+            case qryOpGE:
+                pQueryNotCheck->SetValue(0);
+                pQueryNotCheck->Enable(FALSE);
+                break;
+            default:
+                pQueryNotCheck->Enable(TRUE);
+                break;
         }
 
         // Manipulate the dialog to handle the selected operator
         switch((qryOp) pQueryOperatorChoice->GetSelection())
         {
-        case qryOpEQ:
-        case qryOpLT:
-        case qryOpGT:
-        case qryOpLE:
-        case qryOpGE:
-            pQueryCol2Choice->Enable(TRUE);
-            if (pQueryCol2Choice->GetSelection())    // Column name is highlighted
-            {
-                pQueryValue1Msg->Show(FALSE);
-                pQueryValue1Txt->Show(FALSE);
-            }
-            else                                                // "Value" is highlighted
-            {
+            case qryOpEQ:
+            case qryOpLT:
+            case qryOpGT:
+            case qryOpLE:
+            case qryOpGE:
+                pQueryCol2Choice->Enable(TRUE);
+                if (pQueryCol2Choice->GetSelection())    // Column name is highlighted
+                {
+                    pQueryValue1Msg->Show(FALSE);
+                    pQueryValue1Txt->Show(FALSE);
+                }
+                else                                                // "Value" is highlighted
+                {
+                    pQueryValue1Msg->Show(TRUE);
+                    pQueryValue1Txt->Show(TRUE);
+                    pQueryValue1Txt->SetFocus();
+                }
+                break;
+            case qryOpBEGINS:
+            case qryOpCONTAINS:
+            case qryOpLIKE:
+                pQueryCol2Choice->SetSelection(0);
+                pQueryCol2Choice->Enable(FALSE);
                 pQueryValue1Msg->Show(TRUE);
                 pQueryValue1Txt->Show(TRUE);
                 pQueryValue1Txt->SetFocus();
-            }
-            break;
-        case qryOpBEGINS:
-        case qryOpCONTAINS:
-        case qryOpLIKE:
-            pQueryCol2Choice->SetSelection(0);
-            pQueryCol2Choice->Enable(FALSE);
-            pQueryValue1Msg->Show(TRUE);
-            pQueryValue1Txt->Show(TRUE);
-            pQueryValue1Txt->SetFocus();
-            break;
-        case qryOpBETWEEN:
-            pQueryCol2Choice->SetSelection(0);
-            pQueryCol2Choice->Enable(FALSE);
-            pQueryValue2Msg->Show(TRUE);
-            pQueryValue2Txt->Show(TRUE);
-            pQueryValue1Msg->Show(TRUE);
-            pQueryValue1Txt->Show(TRUE);
-            pQueryValue1Txt->SetFocus();
-            break;
+                break;
+            case qryOpBETWEEN:
+                pQueryCol2Choice->SetSelection(0);
+                pQueryCol2Choice->Enable(FALSE);
+                pQueryValue2Msg->Show(TRUE);
+                pQueryValue2Txt->Show(TRUE);
+                pQueryValue1Msg->Show(TRUE);
+                pQueryValue1Txt->Show(TRUE);
+                pQueryValue1Txt->SetFocus();
+                break;
         }
 
         return;
@@ -1801,7 +1904,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
             pQueryValue1Txt->SetFocus();
         }
         return;
-
     }  // Column 2 choice
 
     // Add button
@@ -1809,7 +1911,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
     {
         ProcessAddBtn();
         return;
-
     }  // Add button
 
     // And button
@@ -1817,7 +1918,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
     {
         AppendToWhere(" AND\n");
         return;
-
     }  // And button
 
     // Or button
@@ -1825,7 +1925,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
     {
         AppendToWhere(" OR\n");
         return;
-
     }  // Or button
 
     // Left Paren button
@@ -1833,7 +1932,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
     {
         AppendToWhere("(");
         return;
-
     }  // Left Paren button
 
     // Right paren button
@@ -1841,14 +1939,13 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
     {
         AppendToWhere(")");
         return;
-
     }  // Right Paren button
 
     // Done button
     if (widgetName == pQueryDoneBtn->GetName())
     {
         // Be sure the where clause will not overflow the output buffer
-        if (wxStrlen(pQuerySqlWhereMtxt->GetValue()) > DB_MAX_WHERE_CLAUSE_LEN)
+        if (wxStrlen(pQuerySqlWhereMtxt->GetValue()) > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN)
         {
             wxString s;
             s.Printf("Maximum where clause length exceeded.\nLength must be less than %d", DB_MAX_WHERE_CLAUSE_LEN+1);
@@ -1862,7 +1959,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         wxStrcpy(pWhere, pQuerySqlWhereMtxt->GetValue());
         Close();
         return;
-
     }  // Done button
 
     // Clear button
@@ -1873,7 +1969,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         if (Ok)
             pQuerySqlWhereMtxt->SetValue("");
         return;
-
     }  // Clear button
 
     // Count button
@@ -1883,7 +1978,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
         ProcessCountBtn();
         wxEndBusyCursor();
         return;
-
     }  // Count button
 
 }  // CqueryDlg::OnCommand
@@ -1909,17 +2003,17 @@ void CqueryDlg::OnCloseWindow(wxCloseEvent& event)
         wxEndBusyCursor();
 
     Show(FALSE);
-    this->Destroy();
+    SetReturnCode(1);  // added so BoundsChecker would not report use of uninitialized variable
 
+    this->Destroy();
 }  // CqueryDlg::OnCloseWindow()
 
 
 void CqueryDlg::AppendToWhere(char *s)
 {
-        wxString whereStr = pQuerySqlWhereMtxt->GetValue();
-        whereStr += s;
-        pQuerySqlWhereMtxt->SetValue(whereStr);
-
+    wxString whereStr = pQuerySqlWhereMtxt->GetValue();
+    whereStr += s;
+    pQuerySqlWhereMtxt->SetValue(whereStr);
 }  // CqueryDlg::AppendToWhere()
 
 
@@ -2040,7 +2134,7 @@ void CqueryDlg::ProcessCountBtn()
         {
             wxString tStr;
             tStr  = "ODBC error during Open()\n\n";
-            tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
+            tStr += GetExtendedDBErrorMsg(dbTable->GetDb(),__FILE__,__LINE__);
             wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
             return;
         }
diff --git a/samples/db/dbtest.h b/samples/db/dbtest.h
index 375dd149e3..ed36a3a411 100644
--- a/samples/db/dbtest.h
+++ b/samples/db/dbtest.h
@@ -20,9 +20,11 @@
 enum    DialogModes {mView,mCreate,mEdit,mSearch};
 
 // ID for the menu quit command
-#define FILE_CREATE            100
-#define FILE_EXIT                199
-#define EDIT_PARAMETERS        200
+#define FILE_CREATE           100
+#define FILE_RECREATE_TABLE   110
+#define FILE_RECREATE_INDEXES 120
+#define FILE_EXIT             199
+#define EDIT_PARAMETERS       200
 #define ABOUT_DEMO            300
 
 // this seems to be missing, Robert Roebling (?)
@@ -129,11 +131,13 @@ class DatabaseDemoFrame: public wxFrame
 
         void    OnCloseWindow(wxCloseEvent& event);
         void    OnCreate(wxCommandEvent& event);
+        void    OnRecreateTable(wxCommandEvent& event);
+        void    OnRecreateIndexes(wxCommandEvent& event);
         void    OnExit(wxCommandEvent& event);
         void    OnEditParameters(wxCommandEvent& event);
         void    OnAbout(wxCommandEvent& event);
 
-        void    CreateDataTable();
+        void    CreateDataTable(bool recreate);
         void    BuildEditorDialog();
         void    BuildParameterDialog(wxWindow *parent);
 
@@ -147,8 +151,8 @@ DECLARE_EVENT_TABLE()
 class CeditorDlg : public wxPanel
 {
     private:
-        bool                         widgetPtrsSet;
-        wxString                     saveName;
+        bool             widgetPtrsSet;
+        wxString         saveName;
 
         // Pointers to all widgets on the dialog
         wxButton        *pCreateBtn,  *pEditBtn,      *pDeleteBtn,  *pCopyBtn,  *pSaveBtn,  *pCancelBtn;
@@ -163,8 +167,9 @@ class CeditorDlg : public wxPanel
         wxStaticText    *pNativeLangMsg;
 
     public:
-        enum DialogModes     mode;
-        Ccontact            *Contact;    // this is the table object that will be being manipulated
+        bool             initialized;
+        enum DialogModes mode;
+        Ccontact        *Contact;    // this is the table object that will be being manipulated
 
         CeditorDlg(wxWindow *parent);
 
@@ -173,6 +178,7 @@ class CeditorDlg : public wxPanel
         void    OnCommand(wxWindow& win, wxCommandEvent& event);
         void    OnActivate(bool) {};  // necessary for hot keys
 
+        bool    Initialize();
         void    FieldsEditable();
         void    SetMode(enum DialogModes m);
         bool    PutData();
@@ -343,7 +349,7 @@ class CqueryDlg : public wxDialog
         wxStaticBox             *pQueryHintGrp;
         wxStaticText            *pQueryHintMsg;
 
-        wxTextCtrl                 *pFocusTxt;
+        wxTextCtrl              *pFocusTxt;
 
         CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg);
         ~CqueryDlg();
diff --git a/samples/db/listdb.cpp b/samples/db/listdb.cpp
index 57e48dd087..e00f3c8740 100644
--- a/samples/db/listdb.cpp
+++ b/samples/db/listdb.cpp
@@ -93,9 +93,10 @@ const int LISTDB_NO_SPACES_BETWEEN_COLS = 3;
  * NOTE: The value returned by this function is for temporary use only and
  *       should be copied for long term use
  */
-char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine)
+const char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine)
 {
     static wxString msg;
+    msg = "";
 
     wxString tStr;
 
@@ -128,12 +129,15 @@ char *GetExtendedDBErrorMsg2(char *ErrFile, int ErrLine)
                 msg.Append(pDbList->PtrDb->errorList[i]);
                 if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0)
                     msg.Append("\n");
+                // Clear the errmsg buffer so the next error will not
+                // end up showing the previous error that have occurred
+                wxStrcpy(pDbList->PtrDb->errorList[i],"");
             }
         }
     }
     msg += "\n";
 
-    return (char*) (const char*) msg;
+    return /*(char*) (const char*) msg*/msg.c_str();
 }  // GetExtendedDBErrorMsg
 
 
@@ -407,8 +411,10 @@ void ClookUpDlg::OnClose(wxCloseEvent& event)
     if (lookup2)
         delete lookup2;
 
+     SetReturnCode(1);
+
     while (wxIsBusy()) wxEndBusyCursor();
-   event.Skip();
+    event.Skip();
 
 //    return TRUE;
 
diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp
index 3f328b2224..4abdd98dca 100644
--- a/samples/dialogs/dialogs.cpp
+++ b/samples/dialogs/dialogs.cpp
@@ -304,7 +304,7 @@ void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event) )
 void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
 {
     wxString pwd = wxGetPasswordFromUser("Enter password:",
-                                         "Passowrd entry dialog",
+                                         "Password entry dialog",
                                          "",
                                          this);
     if ( !!pwd )
diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp
index 831b75f128..ac67006879 100644
--- a/samples/drawing/drawing.cpp
+++ b/samples/drawing/drawing.cpp
@@ -367,7 +367,8 @@ MyCanvas::MyCanvas( MyFrame *parent ) : wxScrolledWindow( parent )
 
 void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
 {
-    wxBrush* brush4 = new wxBrush(*gs_bmp4);
+//    wxBrush* brush4 = new wxBrush(*gs_bmp4);
+    wxBrush* brush4 = new wxBrush(*wxBLACK,wxFDIAGONAL_HATCH);
     wxBrush* brush4_mono = new wxBrush(*gs_bmp4_mono);
     wxBrush* brush36 = new wxBrush(*gs_bmp36);
 
@@ -1015,6 +1016,7 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
 {
     wxPaintDC dc(this);
     PrepareDC(dc);
+    
     m_owner->PrepareDC(dc);
 
     dc.SetBackgroundMode( m_owner->m_backgroundMode );
@@ -1080,6 +1082,13 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
         case Show_Ops:
             DrawWithLogicalOps(dc);
             break;
+          
+        default:
+        {
+          dc.SetPen( *wxBLACK_PEN );
+          dc.DrawLine( 0,0,100,100 );
+        }
+    
     }
 }
 
@@ -1220,12 +1229,12 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnShow(wxCommandEvent& event)
 {
-    m_canvas->Show((ScreenToShow)(event.GetInt() - MenuShow_First));
+    m_canvas->Show((ScreenToShow)(event.GetId() - MenuShow_First));
 }
 
 void MyFrame::OnOption(wxCommandEvent& event)
 {
-    switch (event.GetInt())
+    switch (event.GetId())
     {
         case MapMode_Text:
             m_mapMode = wxMM_TEXT;
diff --git a/samples/help/doc.chm b/samples/help/doc.chm
index 6e9157cfcbfc93d39bb425f11bb54d27609007d2..77ff9c01ebe621591a54592ad3b0ace5855d1b17 100644
GIT binary patch
delta 7
OcmeyB(d)XQR|x<RZUdA6

delta 4633
zcmV+!66WoVMfzy4jUs;<P%a`YMEt_~000F5G$UY8Z$+2cw!N0+VzDS#iUQ;mu&7Ez
z4H&_QivSbiby()fxQ+{m4&w6o>i{et=SlO6l(PzI^U#yy;q@%&r8CLp^4L{{Wo4tq
zaEtIn^W>SgYEdYG$eYV!ZyA=ZXO^vx2(69|?0hy8Pn4=r0@HuR$qDx7K#!YfpuvG6
z=&qQ7;Jc?f*{G^E^f<V6+IhUTd^}wK8Lg0Foaw}QelbRLezdwVkvh<{Hvnf@fi%ar
zqc^y?LA7-_w6^`Qj&<H9!h_$COQiE0v>VMV{bTEAm)jN@n?m9DQJsTXp73GNJ2%BY
zA9xi1EktYUL&ty3?V-&O!Lw_L22#x2K=DlL9?Rl)<NkpdpAYEd=i~qQ?=Muqhii!b
zY>qNxxsW^DkvkLZh-5qFgGeN!zLN7m*I^hJk<+P`%sX_xW}X@5mj?bLQ6|lq?prf%
z`P4v;GwYIb%LrLZAMQd=Z54t)sV%DcAr!$?PhTFLhhl$>S3arLwHR;YX)YNN0w0oy
zRWj~sM-8{J<LV%)rNh)K^_62_{o&%}#k{GZ`Mj~>dD}(Lk^gF^GJkepmDG85_PoBq
zzEn2;TiP!9c6wyY0&4w!Cw8S!dsq5r9o$2K_MJ9Rtt}2^Fh27_;AeC#LAGaJFgbxV
zgv`b|=#zizS!3hV+t4+1&7i_O+;7nLHigv=pLO@-|F-u^AK*T6o;H|Z;i_q2Ep6!@
zvtP^<nlgl1?DSsh_mR(Xg|7VRf4yo}I%p5im8fi>&uDw51zibu;iRPPFLw?YHT)xu
zMK$g1S(0mVq-}SOIz@hxdu)qD*}uTWo%SWHmb8DFwn{`xVp=>ziAuZXAf>H$PQ>F`
zbH2$iB5z@e`>uwL8Qh+uAs1AN28dpi>k(0EVkV-lh%N07&Rl2W8LA_v2NnglqVJMY
z&tmlS)oSSW4dd)vQ~!u`N_}=XMn&;9IilxzKA=Nvjh#D-GD;db5J{s}OSYqsQmupW
zt>u5Tj=zl}BB3=6EoJ|Vg5pX^Ay4gFrOC6cjWt+#pL5~hIAAQdNzS|fv+cytayb5P
z@o!Pp{_zm_3|e}qd>389>$a$-l0v`yZg(Md`@P2pa&Qnowbbq&GBb17jz;GY9)w;K
z*&v?IiEdN$9xjv*=LXyU&>iX44B;PoMqYm%*BTH%OrcRr*!}tR{i!I*Iw5=%Kh6;a
zn&PKAgX)`JdDoepp<p_DhN<f2g8S!C-Cx$Wu<cID{|uArhez75W}=JwIvT(2_`0<@
zr?jI)+89|m?aaCI>5kpg^gYuv^%AwF-k*z<<vMYc={7eMv?qRye|@w`Gwfh~-F$zN
zeyHhFBZ5X<UYbvHjY?53mbWiW#MwM_`BFz6aXZ5<Id5M2kAt!~^Il!AmP~K+gaAgr
zsah$5nsw%CQgJuzUh{b+XrDj-*}MI~3!L_B{T*cMq?oZ0bI{1`wdEtpx5NK5%djKp
zpf&rHvm*qGC5lJsw$)3bUwWCA)GmKt?Z0%$s!JXkg0fy>e`mB~oYbjl5;cBscJ=qO
zMuGl$7H7?3y-)0EP>x`9+LHTyLR26Vs=xXtj4kRwkkElW5Wt}hGLRt$cgPTkI<B70
zEweU|vkVSDa1Vtc)RgOhJpu7}g*~*oVo+qPgWYrxP#8Z`{JpyiolWQCs62nlKmGKl
zq;(PfprL%!&k`BP1^J<X26>^vr}78a&3i*Vm0sU58!qa_q^2dQj5NIm>$(NAPt#Ti
zb#E+*Z0}FR>aXgP(AHb0?l=&K?U<gl<D-=?nZ3SpLa%SPc#Yf>>qc}n@WvFKP{G6-
ztLk#FSPVV9#R{#q+fD6w*T#RffR<|`+N*1t4PlA!p!_P0;(E{3!5HWT7Q2VHopcG<
zZ~U;96o!l4!nu?U?jDb=;NG{m8*a>X|HX4}Uz{z<^H;^QpYBkpj{EBMI<Xb%osXf^
zmadon5`{}Eu=Zj7N#)vL%v)`8GG<HKv9dWpVC4M0t}6yPw)^&kC;5N+^G=qL<LWN#
z-yAP5uCvusD;EyS2A%gFOS%_l#TFYE4o6XKk)zm{WgK=dyIIPkhz;lA3ahTvNKGKH
zUS?<BW%eT5mFt0~*JRx{i?hXg@LKgYyE_FptyC||iZw<Hwezq&DB?EOO0FY4x0+J6
zZY)W7o>g>fzhxI)_VIt3?K9WylN0<up0yH^RR?YiYNp&W&&`$iCAxRcTv5@n+Yzp^
zCh5$R`;!|~ab-J5E*zx<bo>unH{-*Qf^|uv-B*RymsBOIhxeAWfl{rY4^WjS<xDD#
zJN7C<>A__fR);P&<bE!LSIMRhFZ#1BwE<UQa8j<;rWMSKvXOsmTH9|`vy@BtF1^sT
z>^3%dLf(hmA{WA2aaTTAj}`Leb(aF(%H!9)Q`Lk05Ol*kjCIyE=%m1EQk9gQG$(V~
z$F`$86yq!y+V{zRvN+MP&83wKUFqf_w4qPFrJeq=3qQbLUn-Jpn}0QH#wBk`CH7Zu
zVN&e3Q|m5A_hNrxO|+1#&2}m_ejnMxT{zSh_BLA8{GE4fNG?-~ZQtbDyV&M;O{1Eq
z?`}ED6~<K<OVhV({7iavy<xaguhbMxz=}qMuaElr<1xwbHI#iV86|3>DTvrjkv}5I
z#yVPbCVx_?7=~AKaY+Q0s7(=_c10>F2FHxEs+P@gHp_p88pQdEJ40zDPfy3y(UYX7
zvNB)>0XGQ9P%_lb`G1UT4eUBV{020=!U07qYIs0OheX&Q#)(q|W{y#wN+NEFBPc!K
z`Q9k5@Z%KKk9gG#ZN%r7Oa!^`+6<<K2oyNcfyo2{5D3pF0sS8`?B|HaUZMlo$eEJ{
zk_y`*&*Oi6j%8!tDznGeEj%!tQiz6y2c7#JTT<MuZtulm(UD<Xg8==%5k&QTa_Ff9
z_LEr3A2c!il3)b*MVqQDD?lgCi#&l8qfj6y23V5MqZ#ES9~Zv?$w)>}U`Pg$iR4Jv
zVk`+yN*Luyrq^Q1UtTl6Bok`Pg=^m^@HPWW0>Xb5QT{@b7EAubl2J=i#uicjD4)fW
zKeA+$l9=+v%HR6?p&SA#P)>lh3QDXJEFkepi?GZTF&kJy&IXQF$WkRGw-^WxHUn+Y
z=p|6)DnZRF3AA2W3SlKU8HL2R1EMs{3C>?>HCtGLGOsBUaj9ZiYLrl38jvVgnOlLW
zszQI58Y+~n*`cV-Sc*)b70lFJp-l}H3f9<H)&qUp;4uml#LQA?rhs7QGi(BsSxw;Z
z%c<0Gf}Kz~fzK=Ab{!2TSz#<Q&52Gl7U|I<*&C0ZXDJf4F`|X8M5S$!Y@035q!mfq
z9Qafpk=8ayxW=hV>58OpyxVXUN!zUPV&H!ww#~`U02cb$A_1GkUv6C_wiyZfks@v<
zA~YyPa84v(BvTsaA{kCya6mGVIVX}Z1SehUkr0zq=$wkAox);FRwU=-F-mzN`A%|_
zWOP6)irc(0G6u2CkOGcb{_ypH8-{Px#e$7%U&yp)i*U{BA{;Qv#G*!7SQIFWi^6|p
z5m6W{VhW>0EMb(0MU1ksC{Y#`g~}qLFj>SDMvGX&C=rVoWnxjwEIxQ*X#=?^asXU$
zKHx&R!7G$Mz@cz|Jh;l({E$~^Q$@W)>pP`~5AYTG6bXMm!r<^!s7^WeQ3?P?jeYy$
zeKk^dQWkd=6rVcDC*i(SfkvtprWJoAu38Zzl<4O=ig{WEg{{8AG)Nt3j<{GLRnYnB
z$AEMLJKdoZVg>!M0?}Es8py%uty+9>BU&(hbt^NzM2u*h<!S+QM1Z26>o(xJC~%R6
zT@CN9(p$|WYIu9~;)*7b2FbVG{cFwqYLI{Z4apiPV8Pn85%gbJ<E5-vhg^R}Ac>D(
z;$vnkS<{cKL07g$&v*N{<1FFt3}gUp<ap!WyjEY{hA~TPbY?M)FSBPb;b57`;JF}$
zTpC7b(ech}kflu+8Ebf}Ro{GCAKr!p;4<2{N(3GQPAywEocath=6N_4c{SwPwyLU4
z``sFcZmIxVL;dYS4_5o(8c2U|tI%&F0<ev)xN-gcMp(DspY9oV&>}MaHqHS5>@A&Z
zB+a*ibPZv;&#>^jTh~diKGH_rIN;w5#$8>zF1YmxWaM9!f-i>QnS;N8cMbNt{3Q==
zeuE9cym&l3Uuq8zd2i1f%PsQ|^2%PM*RMF@C`7$TY134?;les}WomylT%9_QsX1R`
zj(sE3ry=_j>miAk@A~EUo6b3SWM_WrnT~jxYl$QI=1skd>$XWjrl@}iRCB=p{9t6>
zd5(0RFNo(j;~ah!jH5>7;TweGjnQHD^)wEq_QzE*W09To#{nHo7%W~bjHOECk$p2Y
zI`YU!Ci^@}PHEGK@^yc5r%HxX)TzVBYSnV2YLytVSBE)LXICn3CKjeNmPggA<;WH5
zIfB!TBXq2pNY<<7qE)&%aOHB2TeqDfcilNs?dth;6uWa4>h&G*eg#Ipb}xwCSjGe_
z?S90HHb!B?X?;5ef*ldT-p~XuR&*gt9UaDwK1OBBq$Bs;KXQNhdDnQ-OMSl6eehtM
zZ`LVHjFJy=ac*|8Xk5N?H7!gOHg3=NU8fjuv=yhCzoh@zZBIgu^?k!{BIQ)VER-uZ
zrg^nRphY?7v9N(k6_)KkCg$xvS+fX0GJ!zY_Vj@C%F8)Xjn$H(MAb4t9>mCg)4iN_
zArJ%LHrYrrC^vsZN994NWnWdei6FyvFt2CZXDZC;N3_dn7ZNeBW1+AGxCck3%X+C5
zG8y8u*7f~;lL{KjD??Kw#M2az2`W<DLo{!C-q)Vgy~mV5CYh<1KXgbh8~sr{x{&37
z4jt;ihJ{e|4y03kWRJ6)fy{SEaXNs3X6?s{vdJ+hG`xR_$yKJ%P-fzW>;{aNiE{jy
zIA{7I_mA>;U1(_24}WUhy(xF>PSYfQW6!!OMxi|#P7Muat`#DbH31;|l$ucXF|T}P
zuQ}b|Gq??~H9B{02FdhCvccpbotq>xAhPD5mY1KTn7#3z*^<fveedZvoA33Jc9co7
zh2^)t0lR++sPEpZX9D-TZSeD1|MdBOq^(^Vf8LaZ?8n!{(DT(s@u1*0(!HH#rsUH^
zDYIXjqELtrp=a7Gtu5MZxk2>9Jxk*AmV%6WV(?m-QGVVVJfA(S7|{8m_qGop*NRS|
z<$nWNQ&j%zO<yHqG(p5KSkV-8@fsQ*=ZVV>%*cOfUpCM|wm*uK-H~67#XkD~nZk`Q
zSmenXgbzWlld93F;>c!%8#!8^^k5slQlk&AC6F;%Z=_Yb($=K8m60v$WRMg7lbMk3
z_B$h@f1BjDnz#s>+Yn!^Y2gD>(|>7NcQ@6UCfwsRgEL>Z`K2f>w_NMSbT{|l@5*%P
zPz`^zZ16OxGyT7D8)(g7AxABxKk+3DdZ}oku|K{lpE!f})uiCQe^Ys1SCetfMy+2~
zKWkBkRzr09#gbh|%6@w7%@*12_yqfqu=|xwIQjk__R-&IXwvZ3I|16y9`qYU;XkvM
z31R58OdZ_t-b~K^o6vJi_0}^2BHz~j%S3;<{U|G++&L}=un0^b5P?7h0uTs?KPVOV
zb7fWEG~0RSeFOhm?&is>?gS(d2tXhLfd~X35P?8a_h}_!6XGN?HwY7ctCG(O`}?^I
zKJ53lh`LaU%tu@lxMYr$ksOIjPz?W?On53vTY)M_45E(^rlr`^*o^EGxhfhA$sK>K
zcp8+*n*J@b?@%a><|)kVo1n<>k4s)F`%v%BQu<JPi8d648{5gr5tNZs=^F!Q`p5p-
z<x*#x=%;v(P%Zho6+IO#dKdS669|Q?<Dx|#MRT!r;v9TbQlnYMJI8&aqRV}q{vWu5
z!oL5PwL+|LE5HgdLG4;n1&<6jU;2My<9;^$e$i`J2T<}@tv|$Q<2taCzsYr%_SE(*
z61DiU{6nAf>Yfk%uIc0K|1bhaK5VliAE6gCl`S4J#{IucYzH)BGdaXCIY1x+fd~X3
z5P?7h0uTs5AOeB(2LJ#900001000080000e0002`XaE2J0001B5&!@I000pH0Du4h
P0000000000000001quZ|

diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp
index 529577f799..cee944b197 100644
--- a/samples/menu/menu.cpp
+++ b/samples/menu/menu.cpp
@@ -47,7 +47,9 @@ class MyFrame: public wxFrame
 public:
     MyFrame();
 
-    virtual ~MyFrame() { delete m_menu; }
+    virtual ~MyFrame();
+
+    void LogMenuEvent(const wxCommandEvent& event);
 
     void OnQuit(wxCommandEvent& event);
     void OnAbout(wxCommandEvent& event);
@@ -88,6 +90,25 @@ private:
     DECLARE_EVENT_TABLE()
 };
 
+// A small helper class which intercepts all menu events and logs them
+class MyEvtHandler : public wxEvtHandler
+{
+public:
+    MyEvtHandler(MyFrame *frame) { m_frame = frame; }
+
+    void OnMenuEvent(wxCommandEvent& event)
+    {
+        m_frame->LogMenuEvent(event);
+
+        event.Skip();
+    }
+
+private:
+    MyFrame *m_frame;
+
+    DECLARE_EVENT_TABLE()
+};
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -164,6 +185,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_RIGHT_DOWN(MyFrame::OnRightDown)
 END_EVENT_TABLE()
 
+BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
+    EVT_MENU(-1, MyEvtHandler::OnMenuEvent)
+END_EVENT_TABLE()
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -202,7 +227,7 @@ MyFrame::MyFrame()
     m_menu = NULL;
     m_countDummy = 0;
 
-    CreateStatusBar();
+    CreateStatusBar(2);
 
     // create the menubar
     wxMenu *fileMenu = new wxMenu;
@@ -267,6 +292,17 @@ MyFrame::MyFrame()
 
     // associate the menu bar with the frame
     SetMenuBar(menuBar);
+
+    // intercept all menu events and log them in this custom event handler
+    PushEventHandler(new MyEvtHandler(this));
+}
+
+MyFrame::~MyFrame()
+{
+    delete m_menu;
+
+    // delete the event handler installed in ctor
+    PopEventHandler(TRUE);
 }
 
 wxMenu *MyFrame::CreateDummyMenu(wxString *title)
@@ -302,6 +338,23 @@ wxMenuItem *MyFrame::GetLastMenuItem() const
     }
 }
 
+void MyFrame::LogMenuEvent(const wxCommandEvent& event)
+{
+    int id = event.GetId();
+    wxString msg = wxString::Format("Menu command %d", id);
+    if ( GetMenuBar()->FindItem(id)->IsCheckable() )
+    {
+        msg += wxString::Format(" (the item is currently %schecked)",
+                                event.IsChecked() ? "" : "not ");
+    }
+
+    SetStatusText(msg, 1);
+}
+
+// ----------------------------------------------------------------------------
+// menu callbacks
+// ----------------------------------------------------------------------------
+
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
     Close(TRUE);
diff --git a/src/common/base.rc b/src/common/base.rc
new file mode 100644
index 0000000000..1fdf32aa0b
--- /dev/null
+++ b/src/common/base.rc
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/base/base.rc
+// Purpose:     contains version info resource for wxBase DLL build
+// Author:      Vadim Zeitlin
+// Modified by:
+// Created:     09.07.00
+// RCS-ID:      $Id$
+// Copyright:   (c) 2000 Vadim Zeitlin
+// Licence:     wxWindows license
+///////////////////////////////////////////////////////////////////////////////
+
+#include "wx/version.h"
+
+#ifdef _DEBUG
+    #define DLL_FLAGS 0x1L
+    #define DLL_SUFFIX "d"
+#else
+    #define DLL_FLAGS 0x0L
+    #define DLL_SUFFIX ""
+#endif
+
+1 VERSIONINFO
+ FILEVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ PRODUCTVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS DLL_FLAGS
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "Comments", "wxBase (part of Windows) cross-platform framework\0"
+            VALUE "CompanyName", "wxWindows development team\0"
+            VALUE "FileDescription", "wxBase is a non GUI part of wxWindows\0"
+            VALUE "FileVersion", "2.2.1\0"
+            VALUE "InternalName", "wxBase\0"
+            VALUE "LegalCopyright", "Copyright © 1993, 2000 wxWindows development team\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "wxbase221" DLL_SUFFIX ".dll\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "wxWindows\0"
+            VALUE "ProductVersion", "2.2.1\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+END
diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp
index c0afcdaab2..5c212e190e 100644
--- a/src/common/datetime.cpp
+++ b/src/common/datetime.cpp
@@ -3044,6 +3044,11 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
         }
     }
 
+    // We try to guess what we have here: for each new (numeric) token, we
+    // determine if it can be a month, day or a year. Of course, there is an
+    // ambiguity as some numbers may be days as well as months, so we also
+    // have the ability to back track.
+
     // what do we have?
     bool haveDay = FALSE,       // the months day?
          haveWDay = FALSE,      // the day of week?
@@ -3063,6 +3068,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
     while ( tok.HasMoreTokens() )
     {
         wxString token = tok.GetNextToken();
+        if ( !token )
+            continue;
 
         // is it a number?
         unsigned long val;
@@ -3072,110 +3079,53 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
 
             bool isDay = FALSE,
                  isMonth = FALSE,
-                 // only years are counted from 0
-                 isYear = (val == 0) || (val > 31);
-            if ( !isYear )
+                 isYear = FALSE;
+
+            if ( !haveMon && val > 0 && val <= 12 )
             {
-                // may be the month or month day or the year, assume the
-                // month day by default and fallback to month if the range
-                // allow it or to the year if our assumption doesn't work
-                if ( haveDay )
+                // assume it is month
+                isMonth = TRUE;
+            }
+            else // not the month
+            {
+                wxDateTime_t maxDays = haveMon
+                    ? GetNumOfDaysInMonth(haveYear ? year : Inv_Year, mon)
+                    : 31;
+
+                // can it be day?
+                if ( (val == 0) || (val > maxDays) )
                 {
-                    // we already have the day, so may only be a month or year
-                    if ( val > 12 )
-                    {
-                        isYear = TRUE;
-                    }
-                    else
-                    {
-                        isMonth = TRUE;
-                    }
+                    isYear = TRUE;
                 }
-                else // it may be day
+                else
                 {
                     isDay = TRUE;
-
-                    // check the range
-                    if ( haveMon )
-                    {
-                        if ( val > GetNumOfDaysInMonth(haveYear ? year
-                                                                : Inv_Year,
-                                                       mon) )
-                        {
-                            // oops, it can't be a day finally
-                            isDay = FALSE;
-
-                            if ( val > 12 )
-                            {
-                                isYear = TRUE;
-                            }
-                            else
-                            {
-                                isMonth = TRUE;
-                            }
-                        }
-                    }
                 }
             }
 
-            // remember that we have this and stop the scan if it's the second
-            // time we find this, except for the day logic (see there)
             if ( isYear )
             {
                 if ( haveYear )
-                {
                     break;
-                }
 
                 haveYear = TRUE;
 
-                // no roll over - 99 means 99, not 1999 for us
                 year = (wxDateTime_t)val;
             }
-            else if ( isMonth )
+            else if ( isDay )
             {
-                if ( haveMon )
-                {
+                if ( haveDay )
                     break;
-                }
 
-                haveMon = TRUE;
+                haveDay = TRUE;
 
-                // month 1 is Jan
-                mon = (wxDateTime::Month)(val - 1);
+                day = (wxDateTime_t)val;
             }
-            else
+            else if ( isMonth )
             {
-                wxASSERT_MSG( isDay, _T("logic error") );
-
-                if ( haveDay )
-                {
-                    // may be were mistaken when we found it for the first
-                    // time? may be it was a month or year instead?
-                    //
-                    // this ability to "backtrack" allows us to correctly parse
-                    // both things like 01/13 and 13/01 - but, of course, we
-                    // still can't resolve the ambiguity in 01/02 (it will be
-                    // Feb 1 for us, not Jan 2 as americans might expect!)
-                    if ( (day <= 12) && !haveMon )
-                    {
-                        // exchange day and month
-                        mon = (wxDateTime::Month)(day - 1);
-
-                        haveMon = TRUE;
-                    }
-                    else if ( !haveYear )
-                    {
-                        // exchange day and year
-                        year = day;
-
-                        haveYear = TRUE;
-                    }
-                }
-
-                haveDay = TRUE;
+                haveMon = TRUE;
 
-                day = (wxDateTime_t)val;
+                mon = (Month)(val - 1);
             }
         }
         else // not a number
diff --git a/src/common/db.cpp b/src/common/db.cpp
index cd146b9004..fb6aaab436 100644
--- a/src/common/db.cpp
+++ b/src/common/db.cpp
@@ -5,6 +5,8 @@
 //              source such as opening and closing the data source.
 // Author:      Doug Card
 // Modified by: George Tasker
+//              Bart Jourquin
+//              Mark Johnson
 // Mods:        Dec, 1998:
 //                -Added support for SQL statement logging and database cataloging
 // Mods:        April, 1999
@@ -43,7 +45,7 @@
 
 #if wxMAJOR_VERSION == 2
     #ifdef __GNUG__
-    #pragma implementation "db.h"
+        #pragma implementation "db.h"
     #endif
 #endif
 
@@ -108,7 +110,8 @@ char const *SQL_CATALOG_FILENAME     = "catalog.txt";
 wxDbSqlLogState SQLLOGstate = sqlLogOFF;
 
 //char SQLLOGfn[wxDB_PATH_MAX+1] = SQL_LOG_FILENAME;
-wxChar *SQLLOGfn         = (wxChar*) SQL_LOG_FILENAME;
+//wxChar *SQLLOGfn         = (wxChar*) SQL_LOG_FILENAME;
+static wxString SQLLOGfn = SQL_LOG_FILENAME;
 
 // The wxDb::errorList is copied to this variable when the wxDb object
 // is closed.  This way, the error list is still available after the
@@ -116,23 +119,41 @@ wxChar *SQLLOGfn         = (wxChar*) SQL_LOG_FILENAME;
 // connection fails so the calling application can show the operator
 // why the connection failed.  Note: as each wxDb object is closed, it
 // will overwrite the errors of the previously destroyed wxDb object in
-// this variable.
+// this variable.  NOTE: This occurs during a CLOSE, not a FREEing of the
+// connection
 char DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN];
 
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+// This type defines the return row-struct form 
+// SQLTablePrivileges, and is used by wxDB::TablePrivileges.
+typedef struct 
+{
+   char        tableQual[129];
+   char        tableOwner[129];
+   char        tableName[129];
+   char        grantor[129];
+   char        grantee[129];
+   char        privilege[129];
+   char        grantable[4];
+} wxDbTablePrivilegeInfo;
+#endif
+
 
 /********** wxDbColFor Constructor **********/
 wxDbColFor::wxDbColFor()
 {
-    i_Nation = 0;                // 0=EU, 1=UK, 2=International, 3=US
-    s_Field  = "";
+    s_Field = "";
     int i;
     for (i=0;i<7;i++)
     {
         s_Format[i] = "";
-        s_Menge[i]  = "";
-        i_Menge[i]  = 0;
+        s_Amount[i] = "";
+        i_Amount[i] = 0;
     }
-    Format(1,DB_DATA_TYPE_VARCHAR,0,0,0);      // the Function that does the work
+    i_Nation      = 0;                     // 0=EU, 1=UK, 2=International, 3=US
+    i_dbDataType  = 0;
+    i_sqlDataType = 0;
+    Format(1,DB_DATA_TYPE_VARCHAR,0,0,0);  // the Function that does the work
 }  // wxDbColFor::wxDbColFor()
 
 
@@ -141,25 +162,100 @@ wxDbColFor::~wxDbColFor()
 }  // wxDbColFor::~wxDbColFor()
 
 
+/********** wxDbColInf Con / Destructor **********/
+wxDbColInf::wxDbColInf()
+{
+    catalog[0]      = 0;
+    schema[0]       = 0;
+    tableName[0]    = 0;
+    colName[0]      = 0;
+    sqlDataType     = 0;
+    typeName[0]     = 0;
+    columnSize      = 0;
+    bufferLength    = 0;
+    decimalDigits   = 0;
+    numPrecRadix    = 0;
+    nullable        = 0;
+    remarks[0]      = 0;
+    dbDataType      = 0;
+    PkCol           = 0;
+    PkTableName[0]  = 0;
+    FkCol           = 0;
+    FkTableName[0]  = 0;
+    pColFor         = NULL;
+}  // wxDbColInf::wxDbColFor()
+
+
+wxDbColInf::~wxDbColInf()
+{
+    if (pColFor)
+        delete pColFor;
+    pColFor = NULL;
+}  // wxDbColInf::~wxDbColInf()
+
+
+/********** wxDbTableInf Constructor ********/
+wxDbTableInf::wxDbTableInf()
+{
+    tableName[0]    = 0;
+    tableType[0]    = 0;
+    tableRemarks[0] = 0;
+    numCols         = 0;
+    pColInf         = NULL;
+}  // wxDbTableInf::wxDbTableFor()
+
+
+/********** wxDbTableInf Constructor ********/
+wxDbTableInf::~wxDbTableInf()
+{
+    if (pColInf)
+        delete [] pColInf;
+    pColInf = NULL;
+}  // wxDbTableInf::~wxDbTableInf()
+
+
+/********** wxDbInf Constructor *************/
+wxDbInf::wxDbInf()
+{
+    catalog[0]      = 0; 
+    schema[0]       = 0;
+    numTables       = 0;
+    pTableInf       = NULL;
+}  // wxDbInf::wxDbFor()
+
+
+/********** wxDbInf Destructor *************/
+wxDbInf::~wxDbInf()
+{
+	if (pTableInf)
+		delete [] pTableInf;
+	pTableInf = NULL;
+}  // wxDbInf::~wxDbInf()
+
+
+/*************************************************/
+
+
 int wxDbColFor::Format(int Nation,int dbDataType,SWORD sqlDataType,short columnSize,short decimalDigits)
 {
     // ----------------------------------------------------------------------------------------
     // -- 19991224 : mj10777@gmx.net : Create
     // There is still a lot of work to do here, but it is a start
     // It handles all the basic data-types that I have run into up to now
-    // The main work will have be with Dates and float Formatting (US 1,000.00 ; EU 1.000,00)
-    // There are wxWindow plans for locale support and the new wxDateTime.
-    // - if they define some constants (wxEUROPEAN) that can be gloably used,
+    // The main work will have be with Dates and float Formatting 
+    //    (US 1,000.00 ; EU 1.000,00)
+    // There are wxWindow plans for locale support and the new wxDateTime.  If
+    //    they define some constants (wxEUROPEAN) that can be gloably used,
     //    they should be used here.
     // ----------------------------------------------------------------------------------------
-    // There should also be a Function to scan in a string to fill the variable
+    // There should also be a function to scan in a string to fill the variable
     // ----------------------------------------------------------------------------------------
     wxString Temp0;
-    i_Nation      = Nation;                                 // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
+    i_Nation      = Nation;                                       // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
     i_dbDataType  = dbDataType;
     i_sqlDataType = sqlDataType;
-    s_Field.Printf(wxT("%s%d"),s_Menge[1].c_str(),i_Menge[1]);   // OK for VARCHAR, INTEGER and FLOAT
-    if (i_dbDataType == 0)                                  // Filter unsupported dbDataTypes
+    s_Field.Printf(wxT("%s%d"),s_Amount[1].c_str(),i_Amount[1]);  // OK for VARCHAR, INTEGER and FLOAT
+    if (i_dbDataType == 0)                                        // Filter unsupported dbDataTypes
     {
         if ((i_sqlDataType == SQL_VARCHAR) || (i_sqlDataType == SQL_LONGVARCHAR))
             i_dbDataType = DB_DATA_TYPE_VARCHAR;
@@ -179,17 +275,17 @@ int wxDbColFor::Format(int Nation,int dbDataType,SWORD sqlDataType,short columnS
     switch(i_dbDataType)     // -A-> Still a lot of proper formatting to do
     {
         case DB_DATA_TYPE_VARCHAR:
-            s_Field = "%s";        //
+            s_Field = "%s";
             break;
         case DB_DATA_TYPE_INTEGER:
-            s_Field = "%d";        //
+            s_Field = "%d";
             break;
         case DB_DATA_TYPE_FLOAT:
             if (decimalDigits == 0)
                 decimalDigits = 2;
             Temp0 = "%";
             Temp0.Printf(wxT("%s%d.%d"),Temp0.c_str(),columnSize,decimalDigits);
-            s_Field.Printf(wxT("%sf"),Temp0.c_str());        //
+            s_Field.Printf(wxT("%sf"),Temp0.c_str());
             break;
         case DB_DATA_TYPE_DATE:
             if (i_Nation == 0)      // timestamp       YYYY-MM-DD HH:MM:SS.SSS (tested for SYBASE)
@@ -214,7 +310,7 @@ int wxDbColFor::Format(int Nation,int dbDataType,SWORD sqlDataType,short columnS
             }
             break;
         default:
-            s_Field.Printf(wxT("-E-> unknown Format(%d)-sql(%d)"),dbDataType,sqlDataType);        //
+            s_Field.Printf(wxT("Unknown Format(%d)-SQL(%d)"),dbDataType,sqlDataType);        //
             break;
     };
     return TRUE;
@@ -380,8 +476,8 @@ bool wxDb::Open(char *Dsn, char *Uid, char *AuthStr)
     // SQL_INTEGER            type name = 'LONG', Precision = 10
 
     // VARCHAR = Variable length character string
-    if (! getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
-        if (! getDataTypeInfo(SQL_CHAR, typeInfVarchar))
+    if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar))
+        if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar))
             return(FALSE);
         else
             typeInfVarchar.FsqlType = SQL_CHAR;
@@ -389,12 +485,12 @@ bool wxDb::Open(char *Dsn, char *Uid, char *AuthStr)
         typeInfVarchar.FsqlType = SQL_VARCHAR;
 
     // Float
-    if (! getDataTypeInfo(SQL_DOUBLE, typeInfFloat))
+    if (!getDataTypeInfo(SQL_DOUBLE,typeInfFloat))
 
-        if (! getDataTypeInfo(SQL_REAL, typeInfFloat))
-            if (! getDataTypeInfo(SQL_FLOAT, typeInfFloat))
-                if (! getDataTypeInfo(SQL_DECIMAL, typeInfFloat))
-                    if (! getDataTypeInfo(SQL_NUMERIC, typeInfFloat))
+        if (!getDataTypeInfo(SQL_REAL,typeInfFloat))
+            if (!getDataTypeInfo(SQL_FLOAT,typeInfFloat))
+                if (!getDataTypeInfo(SQL_DECIMAL,typeInfFloat))
+                    if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat))
                         return(FALSE);
                     else
                         typeInfFloat.FsqlType = SQL_NUMERIC;
@@ -409,27 +505,29 @@ bool wxDb::Open(char *Dsn, char *Uid, char *AuthStr)
 
 
     // Integer
-    if (! getDataTypeInfo(SQL_INTEGER, typeInfInteger))     
-	  // If SQL_INTEGER is not supported, use the floating point
-	  // data type to store integers as well as floats
-	  if (! getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
+    if (!getDataTypeInfo(SQL_INTEGER, typeInfInteger))     
+    {
+        // If SQL_INTEGER is not supported, use the floating point
+        // data type to store integers as well as floats
+        if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger))
             return(FALSE);
         else
             typeInfInteger.FsqlType = typeInfFloat.FsqlType;
+    }
     else
         typeInfInteger.FsqlType = SQL_INTEGER;
 
     // Date/Time
     if (Dbms() != dbmsDBASE)
-   {
-        if (! getDataTypeInfo(SQL_TIMESTAMP, typeInfDate))
+    {
+        if (! getDataTypeInfo(SQL_TIMESTAMP,typeInfDate))
             return(FALSE);
         else
             typeInfDate.FsqlType = SQL_TIMESTAMP;
     }
     else
     {
-        if (! getDataTypeInfo(SQL_DATE, typeInfDate))
+        if (!getDataTypeInfo(SQL_DATE,typeInfDate))
             return(FALSE);
         else
             typeInfDate.FsqlType = SQL_DATE;
@@ -553,7 +651,10 @@ bool wxDb::getDbInfo(void)
 
     if (SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, 2, &cb) != SQL_SUCCESS)
         return(DispAllErrors(henv, hdbc));
-
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+    if (SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, 2, &cb) != SQL_SUCCESS)
+        return(DispAllErrors(henv, hdbc));
+#endif
     if (SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb) != SQL_SUCCESS)
         return(DispAllErrors(henv, hdbc));
 
@@ -625,16 +726,18 @@ bool wxDb::getDbInfo(void)
     cout << "SQL Conf. Level: ";
     switch(dbInf.sqlConfLvl)
     {
-        case SQL_OSC_MINIMUM:     cout << "Minimum Grammer";     break;
-        case SQL_OSC_CORE:        cout << "Core Grammer";        break;
-        case SQL_OSC_EXTENDED:    cout << "Extended Grammer";    break;
+        case SQL_OSC_MINIMUM:     cout << "Minimum Grammar";     break;
+        case SQL_OSC_CORE:        cout << "Core Grammar";        break;
+        case SQL_OSC_EXTENDED:    cout << "Extended Grammar";    break;
     }
     cout << endl;
 
     cout << "Max. Connections: "       << dbInf.maxConnections   << endl;
     cout << "Outer Joins: "            << dbInf.outerJoins       << endl;
     cout << "Support for Procedures: " << dbInf.procedureSupport << endl;
-
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+    cout << "All tables accessible : " << dbInf.accessibleTables << endl;
+#endif
     cout << "Cursor COMMIT Behavior: ";
     switch(dbInf.cursorCommitBehavior)
     {
@@ -817,15 +920,15 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo)
         return(DispAllErrors(henv, hdbc, hstmt));
     // Fetch the record
     if ((retcode = SQLFetch(hstmt)) != SQL_SUCCESS)
-      {
+    {
 #ifdef DBDEBUG_CONSOLE
-	if (retcode == SQL_NO_DATA_FOUND)
-	  cout << "SQL_NO_DATA_FOUND fetching inf. about data type." << endl;
+        if (retcode == SQL_NO_DATA_FOUND)
+            cout << "SQL_NO_DATA_FOUND fetching inf. about data type." << endl;
 #endif
-	DispAllErrors(henv, hdbc, hstmt);
-	SQLFreeStmt(hstmt, SQL_CLOSE);
-	return(FALSE);
-      }
+        DispAllErrors(henv, hdbc, hstmt);
+        SQLFreeStmt(hstmt, SQL_CLOSE);
+        return(FALSE);
+    }
     // Obtain columns from the record
     if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) structSQLTypeInfo.TypeName, DB_TYPE_NAME_LEN, &cbRet) != SQL_SUCCESS)
         return(DispAllErrors(henv, hdbc, hstmt));
@@ -835,19 +938,22 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo)
 #if  OLD_GETCOLUMNS
     // BJO 991209
     if (Dbms() == dbmsMY_SQL)
-      {
+    {
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint");
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint unsigned")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint unsigned");
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "integer")) wxStrcpy(structSQLTypeInfo.TypeName, "int");
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "integer unsigned")) wxStrcpy(structSQLTypeInfo.TypeName, "int unsigned");
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "middleint")) wxStrcpy(structSQLTypeInfo.TypeName, "mediumint");
         if (!wxStrcmp(structSQLTypeInfo.TypeName, "varchar")) wxStrcpy(structSQLTypeInfo.TypeName, "char");
-      }
+    }
     
     // BJO 20000427 : OpenLink driver 
     if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
-	!wxStrncmp(dbInf.driverName, "OLOD", 4))    
-      if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision")) wxStrcpy(structSQLTypeInfo.TypeName, "real");
+        !wxStrncmp(dbInf.driverName, "OLOD", 4))    
+    {
+        if (!wxStrcmp(structSQLTypeInfo.TypeName, "double precision"))
+            wxStrcpy(structSQLTypeInfo.TypeName, "real");
+    }
 #endif
 
     if (SQLGetData(hstmt, 3, SQL_C_LONG, (UCHAR*) &structSQLTypeInfo.Precision, 0, &cbRet) != SQL_SUCCESS)
@@ -1000,7 +1106,6 @@ bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
 /********** wxDb::DispNextError() **********/
 void wxDb::DispNextError(void)
 {
-//    char odbcErrMsg[DB_MAX_ERROR_MSG_LEN];
     wxString odbcErrMsg;
 
     odbcErrMsg.sprintf("SQL State = %s\nNative Error Code = %li\nError Message = %s\n", sqlState, nativeError, errorMsg);
@@ -1020,7 +1125,6 @@ void wxDb::DispNextError(void)
     wxLogDebug(odbcErrMsg,wxT("ODBC DEBUG MESSAGE"));
 #endif  // __WXDEBUG__
 
-
 } // wxDb::DispNextError()
 
 
@@ -1243,7 +1347,6 @@ int wxDb::TranslateSqlState(const wxChar *SQLState)
 /**********  wxDb::Grant() **********/
 bool wxDb::Grant(int privileges, const char *tableName, const char *userList)
 {
-//    char sqlStmt[DB_MAX_STATEMENT_LEN];
     wxString sqlStmt;
 
     // Build the grant statement
@@ -1297,7 +1400,6 @@ bool wxDb::Grant(int privileges, const char *tableName, const char *userList)
 /********** wxDb::CreateView() **********/
 bool wxDb::CreateView(const char *viewName, const char *colList, const char *pSqlStmt, bool attemptDrop)
 {
-//    char sqlStmt[DB_MAX_STATEMENT_LEN];
     wxString sqlStmt;
 
     // Drop the view first
@@ -1470,8 +1572,8 @@ int wxDb::GetKeyFields(char *tableName, wxDbColInf* colInf, int noCols)
             for (i=0;i<noCols;i++)                          // Find the Column name
                 if (!wxStrcmp(colInf[i].colName,szPkCol))   // We have found the Column
                     colInf[i].PkCol = iKeySeq;              // Which Primary Key is this (first, second usw.) ?
-        }   // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
-    }    // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+        }  // if
+    }  // while
     SQLFreeStmt(hstmt, SQL_CLOSE);  /* Close the cursor (the hstmt is still allocated).      */
 
     /*---------------------------------------------------------------------*/
@@ -1502,15 +1604,17 @@ int wxDb::GetKeyFields(char *tableName, wxDbColInf* colInf, int noCols)
             GetData( 7, SQL_C_CHAR,   szFkTable,   DB_MAX_TABLE_NAME_LEN+1,  &cb);
             GetData( 8, SQL_C_CHAR,   szFkCol,     DB_MAX_COLUMN_NAME_LEN+1, &cb);
             Temp0.Printf(wxT("%s[%s] "),Temp0.c_str(),szFkTable);  // [ ] in case there is a blank in the Table name
-        }  // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
-    }   // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+        }  // if
+    }  // while
     Temp0.Trim();     // Get rid of any unneeded blanks
     if (Temp0 != wxT(""))
     {
-        for (i=0;i<noCols;i++)                          // Find the Column name
-            if (!wxStrcmp(colInf[i].colName,szPkCol))   // We have found the Column, store the Information
-                wxStrcpy(colInf[i].PkTableName,Temp0.c_str());    // Name of the Tables where this Primary Key is used as a Foreign Key
-    }  // if (Temp0 != "")
+        for (i=0;i<noCols;i++)
+        {   // Find the Column name
+            if (!wxStrcmp(colInf[i].colName,szPkCol))           // We have found the Column, store the Information
+                wxStrcpy(colInf[i].PkTableName,Temp0.c_str());  // Name of the Tables where this Primary Key is used as a Foreign Key
+        }
+    }  // if
     SQLFreeStmt(hstmt, SQL_CLOSE);  /* Close the cursor (the hstmt is still allocated). */
 
     /*---------------------------------------------------------------------*/
@@ -1544,15 +1648,15 @@ int wxDb::GetKeyFields(char *tableName, wxDbColInf* colInf, int noCols)
                 if (!wxStrcmp(colInf[i].colName,szFkCol))       // We have found the (Foreign Key) Column
                 {
                     colInf[i].FkCol = iKeySeq;                  // Which Foreign Key is this (first, second usw.) ?
-                    wxStrcpy(colInf[i].FkTableName,szPkTable);    // Name of the Table where this Foriegn is the Primary Key
-                } // if (!wxStrcmp(colInf[i].colName,szFkCol))
-            }  // for (i=0;i<noCols;i++)
-        }   // if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
-    }    // while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO))
+                    wxStrcpy(colInf[i].FkTableName,szPkTable);  // Name of the Table where this Foriegn is the Primary Key
+                } // if
+            }  // for
+        }  // if
+    }  // while
     SQLFreeStmt(hstmt, SQL_CLOSE);  /* Close the cursor (the hstmt is still allocated). */
 
-    /*---------------------------------------------------------------------*/
     return TRUE;
+
 }  // wxDb::GetKeyFields()
 
 
@@ -1696,7 +1800,7 @@ wxDbColInf *wxDb::GetColumns(char *tableName[], const char *userID)
                         GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0,                        &cb);
                         GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable,     0,                        &cb);
                         GetData(12, SQL_C_CHAR,   (UCHAR*)  colInf[colNo].remarks,      254+1,                    &cb);
-		
+        
                         // Determine the wxDb data type that is used to represent the native data type of this data source
                         colInf[colNo].dbDataType = 0;
                         if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
@@ -1871,47 +1975,47 @@ wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
                     colInf[colNo].FkCol = 0;           // Foreign key column   0=No; 1= First Key, 2 = Second Key etc.
                     colInf[colNo].FkTableName[0] = 0;  // Foreign key table name
 
-		    // BJO 20000428 : Virtuoso returns type names with upper cases!
-		    if (Dbms() == dbmsVIRTUOSO)
-		      {
-			wxString s =  colInf[colNo].typeName;
-			s = s.MakeLower();
-			wxStrcmp(colInf[colNo].typeName, s.c_str());		
-		      }
-		    		   
-		    // Determine the wxDb data type that is used to represent the native data type of this data source
-		    colInf[colNo].dbDataType = 0;
-		    if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
-		      {
-			if (colInf[colNo].columnSize < 1)
-			  {
-				// IODBC does not return a correct columnSize, so we set
-				// columnSize = bufferLength if no column size was returned
-			    colInf[colNo].columnSize = colInf[colNo].bufferLength;
-			  }
-			colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
-		      }
-		    else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
-		      colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
-		    else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
-		      colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
-		    else if (!wxStricmp(typeInfDate.TypeName,colInf[colNo].typeName))
-		      colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;		
-		    
+                    // BJO 20000428 : Virtuoso returns type names with upper cases!
+                    if (Dbms() == dbmsVIRTUOSO)
+                    {
+                        wxString s =  colInf[colNo].typeName;
+                        s = s.MakeLower();
+                        wxStrcmp(colInf[colNo].typeName, s.c_str());        
+                    }
+                       
+                    // Determine the wxDb data type that is used to represent the native data type of this data source
+                    colInf[colNo].dbDataType = 0;
+                    if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
+                    {
+                        if (colInf[colNo].columnSize < 1)
+                        {
+                            // IODBC does not return a correct columnSize, so we set
+                            // columnSize = bufferLength if no column size was returned
+                            colInf[colNo].columnSize = colInf[colNo].bufferLength;
+                        }
+                        colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
+                    }
+                    else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
+                        colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
+                    else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
+                        colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;
+                    else if (!wxStricmp(typeInfDate.TypeName,colInf[colNo].typeName))
+                        colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;     
+            
                     colNo++;
                 }
             }
         }
         if (retcode != SQL_NO_DATA_FOUND)
-	  {  // Error occured, abort
+        {  // Error occured, abort
             DispAllErrors(henv, hdbc, hstmt);
             if (colInf)
-	      delete [] colInf;
+                delete [] colInf;
             SQLFreeStmt(hstmt, SQL_CLOSE);
             if (numCols)
-	      *numCols = 0;
+                *numCols = 0;
             return(0);
-	  }
+        }
     }
 
     SQLFreeStmt(hstmt, SQL_CLOSE);
@@ -1925,184 +2029,188 @@ wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
 
 }  // wxDb::GetColumns()
 
-#else  // New GetColumns
 
+#else  // New GetColumns
 
 
 /*
-
-BJO 20000503
-
-These are tentative new GetColumns members:
-
-- The first one (wxDbColInf *wxDb::GetColumns(char *tableName[], const char* userID)) calls
-  the second implementation for each separate table before merging the results. This makes the
-  code easier to maintain as only one member (the second) makes the real work
-- wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID) is a little bit improved
-     - It doesn't anymore rely on the type-name to find out which database-type each column has
-     - It ends by sorting the columns, so that they are returned in the same order they were created
-
+    BJO 20000503
+    These are tentative new GetColumns members which should be more database
+    independant and which always returns the columns in the order they were 
+    created.
+
+    - The first one (wxDbColInf *wxDb::GetColumns(char *tableName[], const 
+      char* userID)) calls the second implementation for each separate table
+      before merging the results. This makes the code easier to maintain as 
+      only one member (the second) makes the real work
+    - wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const 
+      char *userID) is a little bit improved 
+    - It doesn't anymore rely on the type-name to find out which database-type 
+      each column has
+    - It ends by sorting the columns, so that they are returned in the same 
+      order they were created
 */
 
 typedef struct
 {
-  int noCols;
-  wxDbColInf *colInf;
+    int noCols;
+    wxDbColInf *colInf;
 } _TableColumns;
 
+
 wxDbColInf *wxDb::GetColumns(char *tableName[], const char* userID)
 {
-  int i, j;
-  // The last array element of the tableName[] argument must be zero (null).
-  // This is how the end of the array is detected.
-
-  int noCols = 0;
-
-  // How many tables ?
-  int tbl;
-  for (tbl = 0 ;  tableName[tbl]; tbl++); 
-
-  // Create a table to maintain the columns for each separate table
-  _TableColumns *TableColumns = new _TableColumns[tbl];
-  
-  // Fill the table
-  for (i = 0 ; i < tbl ; i++)
-
-    {
-      TableColumns[i].colInf = GetColumns(tableName[i], &TableColumns[i].noCols, userID);    
-      if (TableColumns[i].colInf == NULL) return NULL;
-      noCols += TableColumns[i].noCols;
-    }
-  
-  // Now merge all the separate table infos
-  wxDbColInf *colInf = new wxDbColInf[noCols+1];
-  
-  // Mark the end of the array
-  wxStrcpy(colInf[noCols].tableName, wxT(""));
-  wxStrcpy(colInf[noCols].colName, wxT(""));
-  colInf[noCols].sqlDataType = 0;
-  
-  // Merge ...
-  int offset = 0;
-
-  for (i = 0 ; i < tbl ; i++)
-  {
-    for (j = 0 ; j < TableColumns[i].noCols ; j++)
-	 {
-	   colInf[offset++] = TableColumns[i].colInf[j];	    
-	 }
-  }
-
-  delete [] TableColumns;
-  
-  return colInf;
-}
+    int i, j;
+    // The last array element of the tableName[] argument must be zero (null).
+    // This is how the end of the array is detected.
+
+    int noCols = 0;
+
+    // How many tables ?
+    int tbl;
+    for (tbl = 0 ; tableName[tbl]; tbl++); 
+    
+    // Create a table to maintain the columns for each separate table
+    _TableColumns *TableColumns = new _TableColumns[tbl];
+    
+    // Fill the table
+    for (i = 0 ; i < tbl ; i++)
+        
+    {
+        TableColumns[i].colInf = GetColumns(tableName[i], &TableColumns[i].noCols, userID);
+        if (TableColumns[i].colInf == NULL) 
+            return NULL;
+        noCols += TableColumns[i].noCols;
+    }
+    
+    // Now merge all the separate table infos
+    wxDbColInf *colInf = new wxDbColInf[noCols+1];
+    
+    // Mark the end of the array
+    wxStrcpy(colInf[noCols].tableName, wxT(""));
+    wxStrcpy(colInf[noCols].colName, wxT(""));
+    colInf[noCols].sqlDataType = 0;
+    
+    // Merge ...
+    int offset = 0;
+    
+    for (i = 0 ; i < tbl ; i++)
+    {
+        for (j = 0 ; j < TableColumns[i].noCols ; j++)
+        {
+            colInf[offset++] = TableColumns[i].colInf[j];        
+        }
+    }
+    
+    delete [] TableColumns;
+    
+    return colInf;
+}  // wxDb::GetColumns()  -- NEW
 
 
 wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
-  //
-  // Same as the above GetColumns() function except this one gets columns
-  // only for a single table, and if 'numCols' is not NULL, the number of
-  // columns stored in the returned wxDbColInf is set in '*numCols'
-  //
-  // userID is evaluated in the following manner:
-  //        userID == NULL  ... UserID is ignored
-  //        userID == ""    ... UserID set equal to 'this->uid'
-  //        userID != ""    ... UserID set equal to 'userID'
-  //
-  // NOTE: ALL column bindings associated with this wxDb instance are unbound
-  //       by this function.  This function should use its own wxDb instance
-  //       to avoid undesired unbinding of columns.
-  
+//
+// Same as the above GetColumns() function except this one gets columns
+// only for a single table, and if 'numCols' is not NULL, the number of
+// columns stored in the returned wxDbColInf is set in '*numCols'
+//
+// userID is evaluated in the following manner:
+//        userID == NULL  ... UserID is ignored
+//        userID == ""    ... UserID set equal to 'this->uid'
+//        userID != ""    ... UserID set equal to 'userID'
+//
+// NOTE: ALL column bindings associated with this wxDb instance are unbound
+//       by this function.  This function should use its own wxDb instance
+//       to avoid undesired unbinding of columns.
 {
-  SWORD      noCols = 0;
-  int       colNo  = 0;
-  wxDbColInf *colInf = 0;
-  
-  RETCODE  retcode;
-  SDWORD   cb;
-  
-  wxString UserID;
-  wxString TableName;
-  
-  if (userID)
-    {
-      if (!wxStrlen(userID))
-	UserID = uid;
-      else
-	UserID = userID;
-    }
-  else
-    UserID = "";
-  
-  // dBase does not use user names, and some drivers fail if you try to pass one
-  if (Dbms() == dbmsDBASE)
-    UserID = "";
-  
-  // Oracle user names may only be in uppercase, so force
-  // the name to uppercase
-  if (Dbms() == dbmsORACLE)
-    UserID = UserID.Upper();
-  
-  // Pass 1 - Determine how many columns there are.
-  // Pass 2 - Allocate the wxDbColInf array and fill in
-  //                the array with the column information.
-  int pass;
-  for (pass = 1; pass <= 2; pass++)
-    {
-      if (pass == 2)
+    SWORD       noCols = 0;
+    int         colNo  = 0;
+    wxDbColInf *colInf = 0;
+    
+    RETCODE  retcode;
+    SDWORD   cb;
+    
+    wxString UserID;
+    wxString TableName;
+    
+    if (userID)
+    {
+        if (!wxStrlen(userID))
+            UserID = uid;
+        else
+            UserID = userID;
+    }
+    else
+        UserID = "";
+    
+    // dBase does not use user names, and some drivers fail if you try to pass one
+    if (Dbms() == dbmsDBASE)
+        UserID = "";
+    
+    // Oracle user names may only be in uppercase, so force
+    // the name to uppercase
+    if (Dbms() == dbmsORACLE)
+        UserID = UserID.Upper();
+    
+    // Pass 1 - Determine how many columns there are.
+    // Pass 2 - Allocate the wxDbColInf array and fill in
+    //                the array with the column information.
+    int pass;
+    for (pass = 1; pass <= 2; pass++)
+    {
+        if (pass == 2)
         {
-	  if (noCols == 0)  // Probably a bogus table name(s)
-	    break;
-	  // Allocate n wxDbColInf objects to hold the column information
-	  colInf = new wxDbColInf[noCols+1];
-	  if (!colInf)
-	    break;
-	  // Mark the end of the array
-	  wxStrcpy(colInf[noCols].tableName, wxT(""));
-	  wxStrcpy(colInf[noCols].colName, wxT(""));
-	  colInf[noCols].sqlDataType = 0;
+            if (noCols == 0)  // Probably a bogus table name(s)
+                break;
+            // Allocate n wxDbColInf objects to hold the column information
+            colInf = new wxDbColInf[noCols+1];
+            if (!colInf)
+                break;
+            // Mark the end of the array
+            wxStrcpy(colInf[noCols].tableName, wxT(""));
+            wxStrcpy(colInf[noCols].colName, wxT(""));
+            colInf[noCols].sqlDataType = 0;
         }
-      
-      TableName = tableName;
-      // Oracle table names are uppercase only, so force
-      // the name to uppercase just in case programmer forgot to do this
-      if (Dbms() == dbmsORACLE)
-	TableName = TableName.Upper();
-      
-      SQLFreeStmt(hstmt, SQL_CLOSE);
-      
-      // MySQL and Access cannot accept a user name when looking up column names, so we
-      // use the call below that leaves out the user name
-      if (wxStrcmp(UserID.c_str(),wxT("")) &&
-	  Dbms() != dbmsMY_SQL &&
-	  Dbms() != dbmsACCESS)
+        
+        TableName = tableName;
+        // Oracle table names are uppercase only, so force
+        // the name to uppercase just in case programmer forgot to do this
+        if (Dbms() == dbmsORACLE)
+            TableName = TableName.Upper();
+        
+        SQLFreeStmt(hstmt, SQL_CLOSE);
+        
+        // MySQL and Access cannot accept a user name when looking up column names, so we
+        // use the call below that leaves out the user name
+        if (wxStrcmp(UserID.c_str(),wxT("")) &&
+            Dbms() != dbmsMY_SQL &&
+            Dbms() != dbmsACCESS)
         {
-	  retcode = SQLColumns(hstmt,
-			       NULL, 0,                                // All qualifiers
-			       (UCHAR *) UserID.c_str(), SQL_NTS,    // Owner
-			       (UCHAR *) TableName.c_str(), SQL_NTS,
-			       NULL, 0);                               // All columns
+            retcode = SQLColumns(hstmt,
+                                 NULL, 0,                              // All qualifiers
+                                 (UCHAR *) UserID.c_str(), SQL_NTS,    // Owner
+                                 (UCHAR *) TableName.c_str(), SQL_NTS,
+                                 NULL, 0);                             // All columns
         }
-      else
+        else
         {
-	  retcode = SQLColumns(hstmt,
-			       NULL, 0,                                 // All qualifiers
-			       NULL, 0,                                 // Owner
-			       (UCHAR *) TableName.c_str(), SQL_NTS,
-			       NULL, 0);                                // All columns
+            retcode = SQLColumns(hstmt,
+                                 NULL, 0,                              // All qualifiers
+                                 NULL, 0,                              // Owner
+                                 (UCHAR *) TableName.c_str(), SQL_NTS,
+                                 NULL, 0);                             // All columns
         }
-      if (retcode != SQL_SUCCESS)
+        if (retcode != SQL_SUCCESS)
         {  // Error occured, abort
-	  DispAllErrors(henv, hdbc, hstmt);
-	  if (colInf)
-	    delete [] colInf;
-	  SQLFreeStmt(hstmt, SQL_CLOSE);
-	  if (numCols)
-	    *numCols = 0;
-	  return(0);
+            DispAllErrors(henv, hdbc, hstmt);
+            if (colInf)
+                delete [] colInf;
+            SQLFreeStmt(hstmt, SQL_CLOSE);
+            if (numCols)
+                *numCols = 0;
+            return(0);
         }
-
+        
         while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS)
         {
             if (pass == 1)  // First pass, just add up the number of columns
@@ -2129,151 +2237,141 @@ wxDbColInf *wxDb::GetColumns(char *tableName, int *numCols, const char *userID)
                     colInf[colNo].PkTableName[0] = 0;  // Tablenames where Primary Key is used as a Foreign Key
                     colInf[colNo].FkCol = 0;           // Foreign key column   0=No; 1= First Key, 2 = Second Key etc.
                     colInf[colNo].FkTableName[0] = 0;  // Foreign key table name
-		    
-#ifdef _IODBC_		    
-		    // IODBC returns the columnSize in bufferLength.. (bug)
-		    colInf[colNo].columnSize = colInf[colNo].bufferLength;		    
+                    
+#ifdef _IODBC_          
+                    // IODBC returns the columnSize in bufferLength.. (bug)
+                    colInf[colNo].columnSize = colInf[colNo].bufferLength;          
 #endif
-		    
-		    // Determine the wxDb data type that is used to represent the native data type of this data source
-		    colInf[colNo].dbDataType = 0;
-		    // Get the intern datatype
-		    switch (colInf[colNo].sqlDataType)
-		      {
-		      case SQL_VARCHAR:
-		      case SQL_CHAR:
-			colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;			 
-			break;
-			
-		      case SQL_TINYINT:
-		      case SQL_SMALLINT:
-		      case SQL_INTEGER:
-			colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;	 
-			break;
-		      case SQL_DOUBLE:
-		      case SQL_DECIMAL:
-		      case SQL_NUMERIC:
-		      case SQL_FLOAT:
-		      case SQL_REAL:
-			colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;	 
-			break;
-		      case SQL_DATE:
-			colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;	
-			break;
-			
-		      
+                    
+                    // Determine the wxDb data type that is used to represent the native data type of this data source
+                    colInf[colNo].dbDataType = 0;
+                    // Get the intern datatype
+                    switch (colInf[colNo].sqlDataType)
+                    {
+                        case SQL_VARCHAR:
+                        case SQL_CHAR:
+                            colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;             
+                        break;
+                        
+                        case SQL_TINYINT:
+                        case SQL_SMALLINT:
+                        case SQL_INTEGER:
+                            colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;     
+                            break;
+                        case SQL_DOUBLE:
+                        case SQL_DECIMAL:
+                        case SQL_NUMERIC:
+                        case SQL_FLOAT:
+                        case SQL_REAL:
+                            colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT;   
+                            break;
+                        case SQL_DATE:
+                            colInf[colNo].dbDataType = DB_DATA_TYPE_DATE;   
+                            break;
 #ifdef __WXDEBUG__
-		      default:
-			wxString errMsg;
-			errMsg.sprintf("SQL Data type %d currently not supported by wxWindows", colInf[colNo].sqlDataType);
-			wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE"));
-#endif	 	 		
-		      }
-		    
-		    
-		    
+                        default:
+                            wxString errMsg;
+                            errMsg.sprintf("SQL Data type %d currently not supported by wxWindows", colInf[colNo].sqlDataType);
+                            wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE"));
+#endif              
+                    }
                     colNo++;
                 }
             }
         }
         if (retcode != SQL_NO_DATA_FOUND)
-	  {  // Error occured, abort
+        {  // Error occured, abort
             DispAllErrors(henv, hdbc, hstmt);
             if (colInf)
-	      delete [] colInf;
+                delete [] colInf;
             SQLFreeStmt(hstmt, SQL_CLOSE);
             if (numCols)
-	      *numCols = 0;
+                *numCols = 0;
             return(0);
-	  }
-    }
-  
-  SQLFreeStmt(hstmt, SQL_CLOSE);
-  
-  // Store Primary and Foreign Keys
-  GetKeyFields(tableName,colInf,noCols);
-  
-  
-  
-  ///////////////////////////////////////////////////////////////////////////
-  // Now sort the the columns in order to make them appear in the right order
-  ///////////////////////////////////////////////////////////////////////////
-  
-  // Build a generic SELECT statement which returns 0 rows
-  wxString Stmt;
-  
-  Stmt.sprintf("select * from %s where 0=1", tableName);
-  
-  // Execute query  
-  if (SQLExecDirect(hstmt, (UCHAR FAR *) Stmt.c_str(), SQL_NTS) != SQL_SUCCESS)
-    {
-      DispAllErrors(henv, hdbc, hstmt);
-      return NULL;
+        }
+    }
+    
+    SQLFreeStmt(hstmt, SQL_CLOSE);
+    
+    // Store Primary and Foreign Keys
+    GetKeyFields(tableName,colInf,noCols);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Now sort the the columns in order to make them appear in the right order
+    ///////////////////////////////////////////////////////////////////////////
+    
+    // Build a generic SELECT statement which returns 0 rows
+    wxString Stmt;
+    
+    Stmt.sprintf("select * from %s where 0=1", tableName);
+    
+    // Execute query  
+    if (SQLExecDirect(hstmt, (UCHAR FAR *) Stmt.c_str(), SQL_NTS) != SQL_SUCCESS)
+    {
+        DispAllErrors(henv, hdbc, hstmt);
+        return NULL;
     } 
-  
-  // Get the number of result columns
-  if (SQLNumResultCols (hstmt, &noCols) != SQL_SUCCESS)
-    {
-      DispAllErrors(henv, hdbc, hstmt);
-      return NULL;
-    }
-  
-  if (noCols == 0) // Probably a bogus table name
-    return NULL;
-
-  //  Get the name 
-  int i;
-  short colNum;
-  UCHAR name[100];
-  SWORD Sword;
-  SDWORD Sdword;
-  for (colNum = 0; colNum < noCols; colNum++)
+    
+    // Get the number of result columns
+    if (SQLNumResultCols (hstmt, &noCols) != SQL_SUCCESS)
+    {
+        DispAllErrors(henv, hdbc, hstmt);
+        return NULL;
+    }
+    
+    if (noCols == 0) // Probably a bogus table name
+        return NULL;
+    
+    //  Get the name 
+    int i;
+    short colNum;
+    UCHAR name[100];
+    SWORD Sword;
+    SDWORD Sdword;
+    for (colNum = 0; colNum < noCols; colNum++)
     { 
-      if (SQLColAttributes(hstmt,colNum+1, SQL_COLUMN_NAME, 
-			   name, sizeof(name), 
-			   &Sword, &Sdword) != SQL_SUCCESS)
-	{
-	  DispAllErrors(henv, hdbc, hstmt);
-	  return NULL;
-	} 
-
-      wxString Name1 = name;
-      Name1 = Name1.Upper();
-
-      // Where is this name in the array ?
-      for (i = colNum ; i < noCols ; i++)
-	{
-	  wxString Name2 =  colInf[i].colName;
-	  Name2 = Name2.Upper();
-	  if (Name2 == Name1)
-	    {
-	      if (colNum != i) // swap to sort
-		{
-		  wxDbColInf tmpColInf = colInf[colNum];
-		  colInf[colNum] =  colInf[i];
-		  colInf[i] = tmpColInf;
-		}
-	      break;
-	    } 
-	}     
+        if (SQLColAttributes(hstmt,colNum+1, SQL_COLUMN_NAME, 
+            name, sizeof(name), 
+            &Sword, &Sdword) != SQL_SUCCESS)
+        {
+            DispAllErrors(henv, hdbc, hstmt);
+            return NULL;
+        } 
+        
+        wxString Name1 = name;
+        Name1 = Name1.Upper();
+        
+        // Where is this name in the array ?
+        for (i = colNum ; i < noCols ; i++)
+        {
+            wxString Name2 =  colInf[i].colName;
+            Name2 = Name2.Upper();
+            if (Name2 == Name1)
+            {
+                if (colNum != i) // swap to sort
+                {
+                    wxDbColInf tmpColInf = colInf[colNum];
+                    colInf[colNum] =  colInf[i];
+                    colInf[i] = tmpColInf;
+                }
+                break;
+            } 
+        }     
     } 
-  SQLFreeStmt(hstmt, SQL_CLOSE);
-
-  ///////////////////////////////////////////////////////////////////////////
-  // End sorting
-  ///////////////////////////////////////////////////////////////////////////
-
+    SQLFreeStmt(hstmt, SQL_CLOSE);
 
+    ///////////////////////////////////////////////////////////////////////////
+    // End sorting
+    ///////////////////////////////////////////////////////////////////////////
 
-  
-  if (numCols)
-    *numCols = noCols;
-  return colInf;
-  
+    if (numCols)
+        *numCols = noCols;
+    return colInf;
+    
 }  // wxDb::GetColumns()
 
 
-#endif
+#endif  // #else OLD_GETCOLUMNS
 
 
 /********** wxDb::GetColumnCount() **********/
@@ -2338,7 +2436,7 @@ int wxDb::GetColumnCount(char *tableName, const char *userID)
             {
                 retcode = SQLColumns(hstmt,
                                      NULL, 0,                                // All qualifiers
-                                     (UCHAR *) UserID.c_str(), SQL_NTS,    // Owner
+                                     (UCHAR *) UserID.c_str(), SQL_NTS,      // Owner
                                      (UCHAR *) TableName.c_str(), SQL_NTS,
                                      NULL, 0);                               // All columns
             }
@@ -2405,7 +2503,6 @@ wxDbInf *wxDb::GetCatalog(char *userID)
     int      pass;
     RETCODE  retcode;
     SDWORD   cb;
-//    char     tblNameSave[DB_MAX_TABLE_NAME_LEN+1];
     wxString tblNameSave;
 
     wxString UserID;
@@ -2431,10 +2528,6 @@ wxDbInf *wxDb::GetCatalog(char *userID)
 
     //-------------------------------------------------------------
     pDbInf = new wxDbInf;          // Create the Database Arrray
-    pDbInf->catalog[0]     = 0;
-    pDbInf->schema[0]      = 0;
-    pDbInf->numTables      = 0;    // Counter for Tables
-    pDbInf->pTableInf      = NULL; // Array of Tables
     //-------------------------------------------------------------
     // Table Information
     // Pass 1 - Determine how many Tables there are.
@@ -2442,26 +2535,23 @@ wxDbInf *wxDb::GetCatalog(char *userID)
     //        - Create the Cols array = NULL
     //-------------------------------------------------------------
 
-    
     for (pass = 1; pass <= 2; pass++)
     {
         SQLFreeStmt(hstmt, SQL_CLOSE);   // Close if Open
         tblNameSave = wxT("");
 
         if (wxStrcmp(UserID.c_str(),wxT("")) &&
-             Dbms() != dbmsMY_SQL &&
-             Dbms() != dbmsACCESS)
+            Dbms() != dbmsMY_SQL &&
+            Dbms() != dbmsACCESS)
         {
-
             retcode = SQLTables(hstmt,
                                 NULL, 0,                             // All qualifiers
-                                (UCHAR *) UserID.c_str(), SQL_NTS, // User specified
+                                (UCHAR *) UserID.c_str(), SQL_NTS,   // User specified
                                 NULL, 0,                             // All tables
                                 NULL, 0);                            // All columns
         }
         else
         {
-
             retcode = SQLTables(hstmt,
                                 NULL, 0,           // All qualifiers
                                 NULL, 0,           // User specified
@@ -2471,16 +2561,14 @@ wxDbInf *wxDb::GetCatalog(char *userID)
 
         if (retcode != SQL_SUCCESS)
         {
-	  
             DispAllErrors(henv, hdbc, hstmt);
             pDbInf = NULL;
             SQLFreeStmt(hstmt, SQL_CLOSE);
             return pDbInf;
         }
-	
+    
         while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS)   // Table Information
         {
-	 
             if (pass == 1)  // First pass, just count the Tables
             {
                 if (pDbInf->numTables == 0)
@@ -2495,25 +2583,17 @@ wxDbInf *wxDb::GetCatalog(char *userID)
                 if (pDbInf->pTableInf == NULL)   // Has the Table Array been created
                 {  // no, then create the Array
                     pDbInf->pTableInf = new wxDbTableInf[pDbInf->numTables];
-                    for (noTab=0;noTab<pDbInf->numTables;noTab++)
-                    {
-                        (pDbInf->pTableInf+noTab)->tableName[0]    = 0;
-                        (pDbInf->pTableInf+noTab)->tableType[0]    = 0;
-                        (pDbInf->pTableInf+noTab)->tableRemarks[0] = 0;
-                        (pDbInf->pTableInf+noTab)->numCols         = 0;
-                        (pDbInf->pTableInf+noTab)->pColInf         = NULL;
-                    }
                     noTab = 0;
-                } // if (pDbInf->pTableInf == NULL)   // Has the Table Array been created	
+                } // if (pDbInf->pTableInf == NULL)   // Has the Table Array been created   
 
                 GetData( 3, SQL_C_CHAR,   (UCHAR*)  (pDbInf->pTableInf+noTab)->tableName,    DB_MAX_TABLE_NAME_LEN+1, &cb);
                 GetData( 4, SQL_C_CHAR,   (UCHAR*)  (pDbInf->pTableInf+noTab)->tableType,    30+1,                    &cb);
                 GetData( 5, SQL_C_CHAR,   (UCHAR*)  (pDbInf->pTableInf+noTab)->tableRemarks, 254+1,                   &cb);
-		
+
                 noTab++;
-            }  // if (pass == 2)  We now know the amount of Tables
-        }   // while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS)
-    }    // for (pass = 1; pass <= 2; pass++)
+            }  // if
+        }  // while
+    }  // for
     SQLFreeStmt(hstmt, SQL_CLOSE);
 
     // Query how many columns are in each table
@@ -2521,7 +2601,9 @@ wxDbInf *wxDb::GetCatalog(char *userID)
     {
         (pDbInf->pTableInf+noTab)->numCols = GetColumnCount((pDbInf->pTableInf+noTab)->tableName,UserID);
     }
+
     return pDbInf;
+
 }  // wxDb::GetCatalog()
 
 
@@ -2586,7 +2668,7 @@ bool wxDb::Catalog(const char *userID, const char *fileName)
     {
         retcode = SQLColumns(hstmt,
                              NULL, 0,                                // All qualifiers
-                             (UCHAR *) UserID.c_str(), SQL_NTS,    // User specified
+                             (UCHAR *) UserID.c_str(), SQL_NTS,      // User specified
                              NULL, 0,                                // All tables
                              NULL, 0);                               // All columns
     }
@@ -2675,23 +2757,22 @@ bool wxDb::TableExists(const char *tableName, const char *userID, const char *ta
 {
     wxString UserID;
     wxString TableName;
-
+    
     assert(tableName && wxStrlen(tableName));
-
+    
     if (Dbms() == dbmsDBASE) 
     {
-    
-      wxString dbName;
-      if (tablePath && wxStrlen(tablePath))
- 	dbName.sprintf("%s\\%s.dbf",tablePath,tableName);      
-      else
- 	dbName.sprintf("%s.dbf",tableName);
-	  
-      bool exists;
-      exists = wxFileExists(dbName.c_str());    
-      return exists;
+        wxString dbName;
+        if (tablePath && wxStrlen(tablePath))
+            dbName.sprintf("%s\\%s.dbf",tablePath,tableName);      
+        else
+            dbName.sprintf("%s.dbf",tableName);
+        
+        bool exists;
+        exists = wxFileExists(dbName.c_str());    
+        return exists;
     }
-
+    
     if (userID)
     {
         if (!wxStrlen(userID))
@@ -2701,57 +2782,150 @@ bool wxDb::TableExists(const char *tableName, const char *userID, const char *ta
     }
     else
         UserID = "";
-
+    
     // Oracle user names may only be in uppercase, so force
     // the name to uppercase
     if (Dbms() == dbmsORACLE)
         UserID = UserID.Upper();
-
+    
     TableName = tableName;
     // Oracle table names are uppercase only, so force
     // the name to uppercase just in case programmer forgot to do this
     if (Dbms() == dbmsORACLE)
         TableName = TableName.Upper();
-
+    
     SQLFreeStmt(hstmt, SQL_CLOSE);
     RETCODE retcode;
-
+    
     // MySQL and Access cannot accept a user name when looking up table names, so we
     // use the call below that leaves out the user name
     if (wxStrcmp(UserID,"") &&
-         Dbms() != dbmsMY_SQL &&
-         Dbms() != dbmsACCESS)
+        Dbms() != dbmsMY_SQL &&
+        Dbms() != dbmsACCESS)
     {
         retcode = SQLTables(hstmt,
-                            NULL, 0,                                    // All qualifiers
+                            NULL, 0,                                  // All qualifiers
                             (UCHAR *) UserID.c_str(), SQL_NTS,        // All owners
                             (UCHAR FAR *)TableName.c_str(), SQL_NTS,
-                            NULL, 0);                                   // All table types
+                            NULL, 0);                                 // All table types
     }
     else
     {
         retcode = SQLTables(hstmt,
-                            NULL, 0,                                    // All qualifiers
-                            NULL, 0,                                    // All owners
+                            NULL, 0,                                  // All qualifiers
+                            NULL, 0,                                  // All owners
                             (UCHAR FAR *)TableName.c_str(), SQL_NTS,
-                            NULL, 0);                                   // All table types
+                            NULL, 0);                                 // All table types
     }
     if (retcode != SQL_SUCCESS)
         return(DispAllErrors(henv, hdbc, hstmt));
-
+    
     retcode = SQLFetch(hstmt);
     if (retcode  != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
     {
         SQLFreeStmt(hstmt, SQL_CLOSE);
         return(DispAllErrors(henv, hdbc, hstmt));
     }
-
+    
     SQLFreeStmt(hstmt, SQL_CLOSE);
-    return(TRUE);
 
+    return(TRUE);
+    
 }  // wxDb::TableExists()
 
 
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
+/********** wxDB::TablePrivileges() **********/
+bool wxDB::TablePrivileges(const char *tableName, const char* priv,
+                      const char *userID, const char *tablePath)
+{
+    wxDbTablePrivilegeInfo  result;
+    SDWORD  cbRetVal;
+    RETCODE retcode;
+    
+    //We probably need to be able to dynamically set this based on 
+    //the driver type, and state.
+    char curRole[]="public";
+    
+    //Prologue here similar to db::TableExists()
+    wxString UserID;
+    wxString TableName;
+    
+    assert(tableName && wxStrlen(tableName));
+    
+    if (userID)
+    {
+        if (!wxStrlen(userID))
+            UserID = uid;
+        else
+            UserID = userID;
+    }
+    else
+        UserID = "";
+    
+    // Oracle user names may only be in uppercase, so force 
+    // the name to uppercase
+    if (Dbms() == dbmsORACLE)
+        UserID = UserID.Upper();
+    
+    TableName = tableName;
+    // Oracle table names are uppercase only, so force 
+    // the name to uppercase just in case programmer forgot to do this
+    if (Dbms() == dbmsORACLE)
+        TableName = TableName.Upper();
+    
+    SQLFreeStmt(hstmt, SQL_CLOSE);
+    
+    retcode = SQLTablePrivileges(hstmt,
+                                 NULL, 0,                                    // All qualifiers
+                                 NULL, 0,                                    // All owners
+                                 (UCHAR FAR *)TableName.GetData(), SQL_NTS);  
+    
+#ifdef DBDEBUG_CONSOLE 
+    fprintf(stderr ,"SQLTablePrivileges() returned %i \n",retcode);
+#endif
+    retcode = SQLBindCol (hstmt, 1, SQL_C_CHAR , &result.tableQual, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 2, SQL_C_CHAR , &result.tableOwner, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 3, SQL_C_CHAR , &result.tableName, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 4, SQL_C_CHAR , &result.grantor, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 5, SQL_C_CHAR , &result.grantee, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 6, SQL_C_CHAR , &result.privilege, 128, &cbRetVal);
+    
+    retcode = SQLBindCol (hstmt, 7, SQL_C_CHAR , &result.grantable, 3, &cbRetVal);
+    
+    retcode = SQLFetch(hstmt);
+    while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) 
+    {
+#ifdef DBDEBUG_CONSOLE
+        fprintf(stderr,"Scanning %s privilege  on table %s.%s  granted by %s to %s\n",
+                result.privilege,result.tabowner,result.tabname,
+                result.grantor, result.grantee);
+#endif 
+        if (UserID.IsSameAs(result.tableOwner,false) )
+            return TRUE;
+        
+        if (UserID.IsSameAs(result.grantee,false) &&
+            !strcmp(result.privilege,priv))
+            return TRUE;
+        
+        if (!strcmp(result.grantee,curRole) &&
+            !strcmp(result.privilege,priv))
+            return TRUE;
+        
+        retcode = SQLFetch(hstmt);
+    } 
+    
+    return FALSE;
+
+}  // wxDB::TablePrivileges
+#endif
+
+
 /********** wxDb::SetSqlLogging() **********/
 bool wxDb::SetSqlLogging(wxDbSqlLogState state, const char *filename, bool append)
 {
@@ -2835,19 +3009,25 @@ wxDBMS wxDb::Dbms(void)
  *
  * SYBASE (Enterprise)
  *        - If a column is part of the Primary Key, the column cannot be NULL
+ *        - Maximum row size is somewhere in the neighborhood of 1920 bytes
  *
  * MY_SQL
  *        - If a column is part of the Primary Key, the column cannot be NULL
  *        - Cannot support selecting for update [::CanSelectForUpdate()].  Always returns FALSE
+ *        - Columns that are part of primary or secondary keys must be defined as being NOT NULL
+ *            when they are created.  Some code is added in ::CreateIndex to try to adjust the
+ *            column definition if it is not defined correctly, but it is experimental
+ *        - Does not support sub-queries in SQL statements
  *
  * POSTGRES
  *        - Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0
- *
+ *        - Does not support sub-queries in SQL statements
  *
  */
 {
     wxChar baseName[25+1];
     wxStrncpy(baseName,dbInf.dbmsName,25);
+    baseName[25] = 0;
 
     // BJO 20000428 : add support for Virtuoso
     if (!wxStricmp(dbInf.dbmsName,"OpenLink Virtuoso VDBMS"))
@@ -2860,12 +3040,13 @@ wxDBMS wxDb::Dbms(void)
     // BJO 20000427 : The "SQL Server" string is also returned by SQLServer when
     // connected through an OpenLink driver.
     // Is it also returned by Sybase Adapatitve server?    
-    // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix	
+    // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix 
     if (!wxStricmp(dbInf.dbmsName,"SQL Server"))       
+    {
       if (!wxStrncmp(dbInf.driverName, "oplodbc", 7) ||
           !wxStrncmp(dbInf.driverName, "OLOD", 4))
-	return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE;
-    
+            return dbmsMS_SQL_SERVER; else return dbmsSYBASE_ASE;
+    }
 
     if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server"))
         return(dbmsMS_SQL_SERVER);
@@ -2878,7 +3059,6 @@ wxDBMS wxDb::Dbms(void)
     if (!wxStricmp(baseName,"Informix"))
         return(dbmsINFORMIX);
 
-
     baseName[6] = 0;
     if (!wxStricmp(baseName,"Oracle"))
         return(dbmsORACLE);
@@ -2894,6 +3074,7 @@ wxDBMS wxDb::Dbms(void)
         return(dbmsDBASE);
 
     return(dbmsUNIDENTIFIED);
+
 }  // wxDb::Dbms()
 
 
@@ -2908,7 +3089,9 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso
     {
         // The database connection must be for the same datasource
         // name and must currently not be in use.
-        if (pList->Free && (! wxStrcmp(pDbConfig->Dsn, pList->Dsn)))  // Found a free connection
+        if (pList->Free &&
+            (pList->PtrDb->FwdOnlyCursors() == FwdOnlyCursors) &&
+            (!wxStrcmp(pDbConfig->Dsn, pList->Dsn)))  // Found a free connection
         {
             pList->Free = FALSE;
             return(pList->PtrDb);
@@ -2926,7 +3109,7 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso
         pList->PtrNext->PtrPrev = pList;
         pList = pList->PtrNext;
     }
-    else    // Empty list
+    else  // Empty list
     {
         // Create the first node on the list
         pList = PtrBegDbList = new wxDbList;
@@ -2969,8 +3152,8 @@ bool WXDLLEXPORT wxDbFreeConnection(wxDb *pDb)
     // Scan the linked list searching for the database connection
     for (pList = PtrBegDbList; pList; pList = pList->PtrNext)
     {
-        if (pList->PtrDb == pDb)        // Found it!!!
-            return(pList->Free = TRUE);
+        if (pList->PtrDb == pDb)  // Found it, now free it!!!
+            return (pList->Free = TRUE);
     }
 
     // Never found the database object, return failure
@@ -3032,14 +3215,14 @@ bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename)
     }
 
     SQLLOGstate = state;
-    wxStrcpy(SQLLOGfn,filename);
+    SQLLOGfn = filename;
 
     return(TRUE);
 
 }  // wxDbSqlLog()
 
 
-#if 0
+#if EXPERIMENTAL_WXDB_FUNCTIONS  // will be added in 2.4
 /********** wxDbCreateDataSource() **********/
 int wxDbCreateDataSource(const char *driverName, const char *dsn, const char *description,
                          bool sysDSN, const char *defDir, wxWindow *parent)
@@ -3107,7 +3290,7 @@ int wxDbCreateDataSource(const char *driverName, const char *dsn, const char *de
     else
        result = TRUE;
 
-#else  // __WXMSW__
+#else  // using iODBC, so this function is not supported
 #ifdef __WXDEBUG__
     wxLogDebug("wxDbCreateDataSource() not available except under MSW","DEBUG MESSAGE");
 #endif
diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp
index 9daf02fcb7..2e248698b6 100644
--- a/src/common/dbtable.cpp
+++ b/src/common/dbtable.cpp
@@ -3,11 +3,8 @@
 // Purpose:     Implementation of the wxDbTable class.
 // Author:      Doug Card
 // Modified by: George Tasker
-// Mods:             April 1999
-//                      -Dynamic cursor support - Only one predefined cursor, as many others as
-//                          you need may be created on demand
-//                      -Reduced number of active cursors significantly 
-//                      -Query-Only wxDbTable objects 
+//              Bart Jourquin
+//              Mark Johnson
 // Created:     9.96
 // RCS-ID:      $Id$
 // Copyright:   (c) 1996 Remstar International, Inc.
@@ -35,9 +32,9 @@
 #include "wx/version.h"
 
 #if wxMAJOR_VERSION == 2
-#   ifdef __GNUG__
-#   pragma implementation "dbtable.h"
-#   endif
+    #ifdef __GNUG__
+        #pragma implementation "dbtable.h"
+    #endif
 #endif
 
 #ifdef DBDEBUG_CONSOLE
@@ -134,21 +131,21 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const char *tblName, const int nCols,
     wxStrcpy(tableName, tblName);               // Table Name
     if (tblPath)
         wxStrcpy(tablePath, tblPath);           // Table Path - used for dBase files
-
+    
     if (qryTblName)                             // Name of the table/view to query
         wxStrcpy(queryTableName, qryTblName);
     else
         wxStrcpy(queryTableName, tblName);
-
+    
     if (!pDb)
         return;
-
+    
     pDb->incrementTableCount();
-
+    
     wxString s;
     tableID = ++lastTableID;
     s.sprintf("wxDbTable constructor (%-20s) tableID:[%6lu] pDb:[%p]", tblName,tableID,pDb);
-
+    
 #ifdef __WXDEBUG__
     wxTablesInUse *tableInUse;
     tableInUse            = new wxTablesInUse();
@@ -157,17 +154,17 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const char *tblName, const int nCols,
     tableInUse->pDb       = pDb;
     TablesInUse.Append(tableInUse);
 #endif
-
+    
     pDb->WriteSqlLog(s.c_str());
-
+    
     // Grab the HENV and HDBC from the wxDb object
     henv = pDb->GetHENV();
     hdbc = pDb->GetHDBC();
-
+    
     // Allocate space for column definitions
     if (noCols)
         colDefs = new wxDbColDef[noCols];  // Points to the first column defintion
-
+    
     // Allocate statement handles for the table
     if (!queryOnly)
     {
@@ -184,62 +181,64 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const char *tblName, const int nCols,
     // Allocate a separate statement handle for internal use
     if (SQLAllocStmt(hdbc, &hstmtInternal) != SQL_SUCCESS)
         pDb->DispAllErrors(henv, hdbc);
-
+    
     // Set the cursor type for the statement handles
     cursorType = SQL_CURSOR_STATIC;
-   
+    
     if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
-      {	
+    { 
         // Check to see if cursor type is supported
         pDb->GetNextError(henv, hdbc, hstmtInternal);
         if (! wxStrcmp(pDb->sqlState, "01S02"))  // Option Value Changed
-	  {
-	    
+        {
             // Datasource does not support static cursors.  Driver
             // will substitute a cursor type.  Call SQLGetStmtOption()
             // to determine which cursor type was selected.
             if (SQLGetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, &cursorType) != SQL_SUCCESS)
-	      pDb->DispAllErrors(henv, hdbc, hstmtInternal);
+                pDb->DispAllErrors(henv, hdbc, hstmtInternal);
 #ifdef DBDEBUG_CONSOLE
             cout << "Static cursor changed to: ";
             switch(cursorType)
-	      {
-	      case SQL_CURSOR_FORWARD_ONLY:
-                cout << "Forward Only";     break;
-	      case SQL_CURSOR_STATIC:
-                cout << "Static";           break;
-	      case SQL_CURSOR_KEYSET_DRIVEN:
-                cout << "Keyset Driven";    break;
-	      case SQL_CURSOR_DYNAMIC:
-                cout << "Dynamic";          break;
-	      }
+            {
+            case SQL_CURSOR_FORWARD_ONLY:
+                cout << "Forward Only";
+                break;
+            case SQL_CURSOR_STATIC:
+                cout << "Static";
+                break;
+            case SQL_CURSOR_KEYSET_DRIVEN:
+                cout << "Keyset Driven";
+                break;
+            case SQL_CURSOR_DYNAMIC:
+                cout << "Dynamic";
+                break;
+            }
             cout << endl << endl;
 #endif
-
-	    // BJO20000425
-	    if (pDb->FwdOnlyCursors() && cursorType != SQL_CURSOR_FORWARD_ONLY)
-	      {
-		// Force the use of a forward only cursor...
-		cursorType = SQL_CURSOR_FORWARD_ONLY;
-		if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
-		  {
-		    // Should never happen
-		    pDb->GetNextError(henv, hdbc, hstmtInternal);
-		    return;
-		  }
-	      }
-	  }
-	else
-	  {
+            // BJO20000425
+            if (pDb->FwdOnlyCursors() && cursorType != SQL_CURSOR_FORWARD_ONLY)
+            {
+                // Force the use of a forward only cursor...
+                cursorType = SQL_CURSOR_FORWARD_ONLY;
+                if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS)
+                {
+                    // Should never happen
+                    pDb->GetNextError(henv, hdbc, hstmtInternal);
+                    return;
+                }
+            }
+        }
+        else
+        {
             pDb->DispNextError();
             pDb->DispAllErrors(henv, hdbc, hstmtInternal);
-	  }
+        }
     }
 #ifdef DBDEBUG_CONSOLE
     else
         cout << "Cursor Type set to STATIC" << endl << endl;
 #endif
-
+    
     if (!queryOnly)
     {
         // Set the cursor type for the INSERT statement handle
@@ -252,12 +251,12 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const char *tblName, const int nCols,
         if (SQLSetStmtOption(hstmtUpdate, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY) != SQL_SUCCESS)
             pDb->DispAllErrors(henv, hdbc, hstmtUpdate);
     }
-
+    
     // Make the default cursor the active cursor
     hstmtDefault = GetNewCursor(FALSE,FALSE);
     assert(hstmtDefault);
     hstmt = *hstmtDefault;
-
+    
 }  // wxDbTable::wxDbTable()
 
 
@@ -320,8 +319,8 @@ wxDbTable::~wxDbTable()
         if (hstmtUpdate)
             if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
                 pDb->DispAllErrors(henv, hdbc);
-
     }
+
     if (hstmtInternal)
         if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
             pDb->DispAllErrors(henv, hdbc);
@@ -333,7 +332,6 @@ wxDbTable::~wxDbTable()
     if (hstmtCount)
         DeleteCursor(hstmtCount);
 
-
 }  // wxDbTable::~wxDbTable()
 
 
@@ -361,36 +359,35 @@ bool wxDbTable::bindInsertParams(void)
             continue;
         switch(colDefs[i].DbDataType)
         {
-	 
-        case DB_DATA_TYPE_VARCHAR:
-            fSqlType = pDb->GetTypeInfVarchar().FsqlType;	   
-            precision = colDefs[i].SzDataObj;
-            scale = 0;
-            colDefs[i].CbValue = SQL_NTS;
-            break;
-        case DB_DATA_TYPE_INTEGER:
-            fSqlType = pDb->GetTypeInfInteger().FsqlType;
-            precision = pDb->GetTypeInfInteger().Precision;
-            scale = 0;
-            colDefs[i].CbValue = 0;
-            break;
-        case DB_DATA_TYPE_FLOAT:
-            fSqlType = pDb->GetTypeInfFloat().FsqlType;
-            precision = pDb->GetTypeInfFloat().Precision;
-            scale = pDb->GetTypeInfFloat().MaximumScale;
-            // SQL Sybase Anywhere v5.5 returned a negative number for the
-            // MaxScale.  This caused ODBC to kick out an error on ibscale.
-            // I check for this here and set the scale = precision.
-            //if (scale < 0)
-            //  scale = (short) precision;
-            colDefs[i].CbValue = 0;
-            break;
-        case DB_DATA_TYPE_DATE:
-            fSqlType = pDb->GetTypeInfDate().FsqlType;
-            precision = pDb->GetTypeInfDate().Precision;
-            scale = 0;
-            colDefs[i].CbValue = 0;
-            break;
+            case DB_DATA_TYPE_VARCHAR:
+                fSqlType = pDb->GetTypeInfVarchar().FsqlType;      
+                precision = colDefs[i].SzDataObj;
+                scale = 0;
+                colDefs[i].CbValue = SQL_NTS;
+                break;
+            case DB_DATA_TYPE_INTEGER:
+                fSqlType = pDb->GetTypeInfInteger().FsqlType;
+                precision = pDb->GetTypeInfInteger().Precision;
+                scale = 0;
+                colDefs[i].CbValue = 0;
+                break;
+            case DB_DATA_TYPE_FLOAT:
+                fSqlType = pDb->GetTypeInfFloat().FsqlType;
+                precision = pDb->GetTypeInfFloat().Precision;
+                scale = pDb->GetTypeInfFloat().MaximumScale;
+                // SQL Sybase Anywhere v5.5 returned a negative number for the
+                // MaxScale.  This caused ODBC to kick out an error on ibscale.
+                // I check for this here and set the scale = precision.
+                //if (scale < 0)
+                //  scale = (short) precision;
+                colDefs[i].CbValue = 0;
+                break;
+            case DB_DATA_TYPE_DATE:
+                fSqlType = pDb->GetTypeInfDate().FsqlType;
+                precision = pDb->GetTypeInfDate().Precision;
+                scale = 0;
+                colDefs[i].CbValue = 0;
+                break;
         }
         // Null values
         if (colDefs[i].Null)
@@ -399,10 +396,12 @@ bool wxDbTable::bindInsertParams(void)
             colDefs[i].Null = FALSE;
         }
 
-	if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
-			     fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, 
-			     precision+1,&colDefs[i].CbValue) != SQL_SUCCESS)
- 	  return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
+        if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
+                             fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, 
+                             precision+1,&colDefs[i].CbValue) != SQL_SUCCESS)
+        {
+            return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
+        }
     }
 
     // Completed successfully
@@ -417,7 +416,7 @@ bool wxDbTable::bindUpdateParams(void)
     assert(!queryOnly);
     if (queryOnly)
         return(FALSE);
-
+    
     SWORD   fSqlType    = 0;
     UDWORD  precision   = 0;
     SWORD   scale       = 0;
@@ -430,43 +429,45 @@ bool wxDbTable::bindUpdateParams(void)
             continue;
         switch(colDefs[i].DbDataType)
         {
-        case DB_DATA_TYPE_VARCHAR:
-            fSqlType = pDb->GetTypeInfVarchar().FsqlType;
-            precision = colDefs[i].SzDataObj;
-            scale = 0;
-            colDefs[i].CbValue = SQL_NTS;
-            break;
-        case DB_DATA_TYPE_INTEGER:
-            fSqlType = pDb->GetTypeInfInteger().FsqlType;
-            precision = pDb->GetTypeInfInteger().Precision;
-            scale = 0;
-            colDefs[i].CbValue = 0;
-            break;
-        case DB_DATA_TYPE_FLOAT:
-            fSqlType = pDb->GetTypeInfFloat().FsqlType;
-            precision = pDb->GetTypeInfFloat().Precision;
-            scale = pDb->GetTypeInfFloat().MaximumScale;	   
-            // SQL Sybase Anywhere v5.5 returned a negative number for the
-            // MaxScale.  This caused ODBC to kick out an error on ibscale.
-            // I check for this here and set the scale = precision.
-            //if (scale < 0)
-            // scale = (short) precision;
-            colDefs[i].CbValue = 0;
-            break;
-        case DB_DATA_TYPE_DATE:
-            fSqlType = pDb->GetTypeInfDate().FsqlType;
-            precision = pDb->GetTypeInfDate().Precision;
-            scale = 0;
-            colDefs[i].CbValue = 0;
-            break;
+            case DB_DATA_TYPE_VARCHAR:
+                fSqlType = pDb->GetTypeInfVarchar().FsqlType;
+                precision = colDefs[i].SzDataObj;
+                scale = 0;
+                colDefs[i].CbValue = SQL_NTS;
+                break;
+            case DB_DATA_TYPE_INTEGER:
+                fSqlType = pDb->GetTypeInfInteger().FsqlType;
+                precision = pDb->GetTypeInfInteger().Precision;
+                scale = 0;
+                colDefs[i].CbValue = 0;
+                break;
+            case DB_DATA_TYPE_FLOAT:
+                fSqlType = pDb->GetTypeInfFloat().FsqlType;
+                precision = pDb->GetTypeInfFloat().Precision;
+                scale = pDb->GetTypeInfFloat().MaximumScale;       
+                // SQL Sybase Anywhere v5.5 returned a negative number for the
+                // MaxScale.  This caused ODBC to kick out an error on ibscale.
+                // I check for this here and set the scale = precision.
+                //if (scale < 0)
+                // scale = (short) precision;
+                colDefs[i].CbValue = 0;
+                break;
+            case DB_DATA_TYPE_DATE:
+                fSqlType = pDb->GetTypeInfDate().FsqlType;
+                precision = pDb->GetTypeInfDate().Precision;
+                scale = 0;
+                colDefs[i].CbValue = 0;
+                break;
+        }
+        
+        if (SQLBindParameter(hstmtUpdate, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
+                             fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, 
+                             precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
+        {
+            return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate));
         }
-	
-	if (SQLBindParameter(hstmtUpdate, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
-			     fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, 
-			     precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
-	  return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate));
     }
-
+    
     // Completed successfully
     return(TRUE);
 
@@ -481,11 +482,13 @@ bool wxDbTable::bindCols(HSTMT cursor)
     // Bind each column of the table to a memory address for fetching data
     int i;
     for (i = 0; i < noCols; i++)
-      {
-	if (SQLBindCol(cursor, i+1, colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj,
-		       colDefs[i].SzDataObj, &cb) != SQL_SUCCESS)     
-	  return (pDb->DispAllErrors(henv, hdbc, cursor));
-      }
+    {
+        if (SQLBindCol(cursor, i+1, colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj,
+                       colDefs[i].SzDataObj, &cb) != SQL_SUCCESS)     
+        {
+          return (pDb->DispAllErrors(henv, hdbc, cursor));
+        }
+    }
 
     // Completed successfully
     return(TRUE);
@@ -506,10 +509,12 @@ bool wxDbTable::getRec(UWORD fetchType)
 
         retcode = SQLExtendedFetch(hstmt, fetchType, 0, &cRowsFetched, &rowStatus);
         if (retcode  != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
+        {
             if (retcode == SQL_NO_DATA_FOUND)
                 return(FALSE);
             else
                 return(pDb->DispAllErrors(henv, hdbc, hstmt));
+        }
     }
     else
     {
@@ -559,20 +564,6 @@ bool wxDbTable::execUpdate(const char *pSqlStmt)
 /********** wxDbTable::query() **********/
 bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const char *pSqlStmt)
 {
-
-
-
-/*  SQLFreeStmt(hstmt, SQL_CLOSE);
-  if (SQLExecDirect(hstmt, (UCHAR FAR *) pSqlStmt, SQL_NTS) == SQL_SUCCESS)
-    return(TRUE);
-  else
-    {
-      pDb->DispAllErrors(henv, hdbc, hstmt);
-      return(FALSE);
-    }
-*/
-
-
     char sqlStmt[DB_MAX_STATEMENT_LEN];
 
     // Set the selectForUpdate member variable
@@ -584,29 +575,31 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const char *
 
     // Set the SQL SELECT string
     if (queryType != DB_SELECT_STATEMENT)               // A select statement was not passed in,
-    {                                                               // so generate a select statement.
+    {                                                   // so generate a select statement.
         BuildSelectStmt(sqlStmt, queryType, distinct);
         pDb->WriteSqlLog(sqlStmt);
-    } else wxStrcpy(sqlStmt, pSqlStmt);
+    }
+    else 
+        wxStrcpy(sqlStmt, pSqlStmt);
 
     SQLFreeStmt(hstmt, SQL_CLOSE);
     if (SQLExecDirect(hstmt, (UCHAR FAR *) sqlStmt, SQL_NTS) == SQL_SUCCESS)
-      return(TRUE);
+        return(TRUE);
     else
-      {
+    {
         pDb->DispAllErrors(henv, hdbc, hstmt);
         return(FALSE);
-      }
+    }
 
     // Make sure the cursor is closed first
     if (! CloseCursor(hstmt))
-      return(FALSE);
+        return(FALSE);
 
     // Execute the SQL SELECT statement
     int retcode;     
     retcode = SQLExecDirect(hstmt, (UCHAR FAR *) (queryType == DB_SELECT_STATEMENT ? pSqlStmt : sqlStmt), SQL_NTS);      
     if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
-      return(pDb->DispAllErrors(henv, hdbc, hstmt));
+        return(pDb->DispAllErrors(henv, hdbc, hstmt));
 
     // Completed successfully
     return(TRUE);
@@ -622,6 +615,7 @@ bool wxDbTable::Open(void)
 {
     if (!pDb)
         return FALSE;   
+
     int i;
     wxString sqlStmt;
 
@@ -645,20 +639,19 @@ bool wxDbTable::Open(void)
     // the wxDbTable object and the ODBC record.
     if (!queryOnly)
     {
-
         if (!bindInsertParams())                    // Inserts
             return(FALSE);
        
         if (!bindUpdateParams())                    // Updates
             return(FALSE);
-	
     }
+
     if (!bindCols(*hstmtDefault))                   // Selects
         return(FALSE);
-	
+    
     if (!bindCols(hstmtInternal))                   // Internal use only
         return(FALSE);
-	
+    
     /*
      * Do NOT bind the hstmtCount cursor!!!
      */
@@ -680,7 +673,7 @@ bool wxDbTable::Open(void)
         needComma = FALSE;
         sqlStmt += ") VALUES (";
 
-		  int insertableCount = 0;
+        int insertableCount = 0;
 
         for (i = 0; i < noCols; i++)
         {
@@ -690,19 +683,17 @@ bool wxDbTable::Open(void)
                 sqlStmt += ",";
             sqlStmt += "?";
             needComma = TRUE;
-		      insertableCount++;
+            insertableCount++;
         }
         sqlStmt += ")";
-
-//      pDb->WriteSqlLog(sqlStmt);
-
+        
         // Prepare the insert statement for execution
         if (insertableCount)  
-		  {
+        {
             if (SQLPrepare(hstmtInsert, (UCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS)
                 return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
         }
-		  else 
+        else 
             insertable= FALSE;
     }
     
@@ -759,6 +750,7 @@ bool wxDbTable::GetPrev(void)
     }
     else
         return(getRec(SQL_FETCH_PRIOR));
+
 }  // wxDbTable::GetPrev()
 
 
@@ -772,6 +764,7 @@ bool wxDbTable::operator--(int)
     }
     else
         return(getRec(SQL_FETCH_PRIOR));
+
 }  // wxDbTable::operator--
 
 
@@ -785,6 +778,7 @@ bool wxDbTable::GetFirst(void)
     }
     else
         return(getRec(SQL_FETCH_FIRST));
+
 }  // wxDbTable::GetFirst()
 
 
@@ -798,6 +792,7 @@ bool wxDbTable::GetLast(void)
     }
     else 
         return(getRec(SQL_FETCH_LAST));
+
 }  // wxDbTable::GetLast()
 
 
@@ -875,40 +870,40 @@ void wxDbTable::BuildSelectStmt(char *pSqlStmt, int typeOfSelect, bool distinct)
     // or build a where clause.  The typeOfSelect determines this.
     switch(typeOfSelect)
     {
-    case DB_SELECT_WHERE:
+        case DB_SELECT_WHERE:
 #if wxODBC_BACKWARD_COMPATABILITY
-        if (where && wxStrlen(where))   // May not want a where clause!!!
+            if (where && wxStrlen(where))   // May not want a where clause!!!
 #else
-        if (where.Length())   // May not want a where clause!!!
+            if (where.Length())   // May not want a where clause!!!
 #endif
-        {
-            wxStrcat(pSqlStmt, " WHERE ");
-            wxStrcat(pSqlStmt, where);
-        }
-        break;
-    case DB_SELECT_KEYFIELDS:
-        BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
-        if (wxStrlen(whereClause))
-        {
-            wxStrcat(pSqlStmt, " WHERE ");
-            wxStrcat(pSqlStmt, whereClause);
-        }
-        break;
-    case DB_SELECT_MATCHING:
-        BuildWhereClause(whereClause, DB_WHERE_MATCHING);
-        if (wxStrlen(whereClause))
-        {
-            wxStrcat(pSqlStmt, " WHERE ");
-            wxStrcat(pSqlStmt, whereClause);
-        }
-        break;
+            {
+                wxStrcat(pSqlStmt, " WHERE ");
+                wxStrcat(pSqlStmt, where);
+            }
+            break;
+        case DB_SELECT_KEYFIELDS:
+            BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+            if (wxStrlen(whereClause))
+            {
+                wxStrcat(pSqlStmt, " WHERE ");
+                wxStrcat(pSqlStmt, whereClause);
+            }
+            break;
+        case DB_SELECT_MATCHING:
+            BuildWhereClause(whereClause, DB_WHERE_MATCHING);
+            if (wxStrlen(whereClause))
+            {
+                wxStrcat(pSqlStmt, " WHERE ");
+                wxStrcat(pSqlStmt, whereClause);
+            }
+            break;
     }
 
     // Append the ORDER BY clause
 #if wxODBC_BACKWARD_COMPATABILITY
     if (orderBy && wxStrlen(orderBy))
 #else
-	 if (orderBy.Length())
+    if (orderBy.Length())
 #endif
     {
         wxStrcat(pSqlStmt, " ORDER BY ");
@@ -960,7 +955,6 @@ bool wxDbTable::CreateTable(bool attemptDrop)
         return FALSE;
 
     int i, j;
-//    char sqlStmt[DB_MAX_STATEMENT_LEN];
     wxString sqlStmt;
 
 #ifdef DBDEBUG_CONSOLE
@@ -1009,7 +1003,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
             continue;
         // Comma Delimiter
         if (needComma)
-           sqlStmt += ",";
+            sqlStmt += ",";
         // Column Name
         sqlStmt += colDefs[i].ColName;
         sqlStmt += " ";
@@ -1017,13 +1011,17 @@ bool wxDbTable::CreateTable(bool attemptDrop)
         switch(colDefs[i].DbDataType)
         {
             case DB_DATA_TYPE_VARCHAR:
-                sqlStmt += pDb->GetTypeInfVarchar().TypeName; break;
+                sqlStmt += pDb->GetTypeInfVarchar().TypeName;
+                break;
             case DB_DATA_TYPE_INTEGER:
-                sqlStmt += pDb->GetTypeInfInteger().TypeName; break;
+                sqlStmt += pDb->GetTypeInfInteger().TypeName;
+                break;
             case DB_DATA_TYPE_FLOAT:
-                sqlStmt += pDb->GetTypeInfFloat().TypeName; break;
+                sqlStmt += pDb->GetTypeInfFloat().TypeName;
+                break;
             case DB_DATA_TYPE_DATE:
-                sqlStmt += pDb->GetTypeInfDate().TypeName; break;
+                sqlStmt += pDb->GetTypeInfDate().TypeName;
+                break;
         }
         // For varchars, append the size of the string
         if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)
@@ -1101,9 +1099,9 @@ bool wxDbTable::CreateTable(bool attemptDrop)
     }
 
     // Commit the transaction and close the cursor
-    if (! pDb->CommitTrans())
+    if (!pDb->CommitTrans())
         return(FALSE);
-    if (! CloseCursor(hstmt))
+    if (!CloseCursor(hstmt))
         return(FALSE);
 
     // Database table created successfully
@@ -1133,13 +1131,13 @@ bool wxDbTable::DropTable()
     if (SQLExecDirect(hstmt, (UCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS)
     {
         // Check for "Base table not found" error and ignore
-        pDb->GetNextError(henv, hdbc, hstmt);	
+        pDb->GetNextError(henv, hdbc, hstmt);   
         if (wxStrcmp(pDb->sqlState,"S0002") && wxStrcmp(pDb->sqlState, "S1000"))  // "Base table not found" 
-        {	 
+        {    
             // Check for product specific error codes
-            if (!((pDb->Dbms() == dbmsSYBASE_ASA    && !wxStrcmp(pDb->sqlState,"42000"))   ||  // 5.x (and lower?)
-		  (pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"37000"))   ||	
-                  (pDb->Dbms() == dbmsPOSTGRES      && !wxStrcmp(pDb->sqlState,"08S01"))))     
+            if (!((pDb->Dbms() == dbmsSYBASE_ASA  && !wxStrcmp(pDb->sqlState,"42000"))   ||  // 5.x (and lower?)
+                (pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"37000"))   ||   
+                (pDb->Dbms() == dbmsPOSTGRES      && !wxStrcmp(pDb->sqlState,"08S01"))))     
             {
                 pDb->DispNextError();
                 pDb->DispAllErrors(henv, hdbc, hstmt);
@@ -1163,24 +1161,104 @@ bool wxDbTable::DropTable()
 /********** wxDbTable::CreateIndex() **********/
 bool wxDbTable::CreateIndex(const char * idxName, bool unique, int noIdxCols, wxDbIdxDef *pIdxDefs, bool attemptDrop)
 {
-//    char sqlStmt[DB_MAX_STATEMENT_LEN];
     wxString sqlStmt;
 
     // Drop the index first
     if (attemptDrop && !DropIndex(idxName))
         return (FALSE);
 
+    // MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions
+    // of an index have the columns defined as "NOT NULL".  During initial table creation though,
+    // it may not be known which columns are necessarily going to be part of an index (e.g. the
+    // table was created, then months later you determine that an additional index while
+    // give better performance, so you want to add an index).
+    //
+    // The following block of code will modify the column definition to make the column be
+    // defined with the "NOT NULL" qualifier.
+    if (pDb->Dbms() == dbmsMY_SQL)
+    {
+        wxString sqlStmt;
+        int i;
+        bool ok = TRUE;
+        for (i = 0; i < noIdxCols && ok; i++)
+        {
+            int   j = 0;
+            bool  found = FALSE;
+            // Find the column definition that has the ColName that matches the
+            // index column name.  We need to do this to get the DB_DATA_TYPE of
+            // the index column, as MySQL's syntax for the ALTER column requires
+            // this information
+            while (!found && (j < this->noCols))
+            {
+                if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0)
+                    found = TRUE;
+                if (!found)
+                    j++;
+            }
+            
+            if (found)
+            {
+                wxString typeNameAndSize;
+                
+                switch(colDefs[j].DbDataType)
+                {
+                    case DB_DATA_TYPE_VARCHAR:
+                        typeNameAndSize = pDb->GetTypeInfVarchar().TypeName;
+                        break;
+                    case DB_DATA_TYPE_INTEGER:
+                        typeNameAndSize = pDb->GetTypeInfInteger().TypeName;
+                        break;
+                    case DB_DATA_TYPE_FLOAT:
+                        typeNameAndSize = pDb->GetTypeInfFloat().TypeName;
+                        break;
+                    case DB_DATA_TYPE_DATE:
+                        typeNameAndSize = pDb->GetTypeInfDate().TypeName;
+                        break;
+                }
+                
+                // For varchars, append the size of the string
+                if (colDefs[j].DbDataType == DB_DATA_TYPE_VARCHAR)
+                {
+                    wxString s;
+                    s.sprintf("(%d)", colDefs[i].SzDataObj);
+                    typeNameAndSize += s.c_str();
+                }
+                
+                sqlStmt.sprintf("ALTER TABLE %s MODIFY %s %s NOT NULL",tableName,pIdxDefs[i].ColName,typeNameAndSize.c_str());
+                ok = pDb->ExecSql(sqlStmt.c_str());
+                
+                if (!ok)
+                {
+                    wxODBC_ERRORS retcode;
+                    // Oracle returns a DB_ERR_GENERAL_ERROR if the column is already
+                    // defined to be NOT NULL, but reportedly MySQL doesn't mind.
+                    // This line is just here for debug checking of the value
+                    retcode = (wxODBC_ERRORS)pDb->DB_STATUS;
+                }
+            }
+            else
+                ok = FALSE;
+        }
+        if (ok)
+            pDb->CommitTrans();
+        else
+        {
+            pDb->RollbackTrans();
+            return(FALSE);
+        }
+    }
+    
     // Build a CREATE INDEX statement
     sqlStmt = "CREATE ";
     if (unique)
         sqlStmt += "UNIQUE ";
-
+    
     sqlStmt += "INDEX ";
     sqlStmt += idxName;
     sqlStmt += " ON ";
     sqlStmt += tableName;
     sqlStmt += " (";
-
+    
     // Append list of columns making up index
     int i;
     for (i = 0; i < noIdxCols; i++)
@@ -1239,7 +1317,7 @@ bool wxDbTable::DropIndex(const char * idxName)
 
     wxString sqlStmt;
 
-    if (pDb->Dbms() == dbmsACCESS)
+    if (pDb->Dbms() == dbmsACCESS || pDb->Dbms() == dbmsMY_SQL)
         sqlStmt.sprintf("DROP INDEX %s ON %s",idxName,tableName);
     else if (pDb->Dbms() == dbmsSYBASE_ASE)
         sqlStmt.sprintf("DROP INDEX %s.%s",tableName,idxName);
@@ -1259,13 +1337,13 @@ bool wxDbTable::DropIndex(const char * idxName)
         if (wxStrcmp(pDb->sqlState,"S0012"))  // "Index not found"
         {
             // Check for product specific error codes
-	  if (!((pDb->Dbms() == dbmsSYBASE_ASA    && !wxStrcmp(pDb->sqlState,"42000")) ||  // v5.x (and lower?)
-		(pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"37000"))   ||
-		(pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,"S1000"))   ||
-		(pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"S0002")) ||  // Base table not found
-		(pDb->Dbms() == dbmsMY_SQL        && !wxStrcmp(pDb->sqlState,"42S02")) ||    // untested
-		(pDb->Dbms() == dbmsPOSTGRES      && !wxStrcmp(pDb->sqlState,"08S01"))
-		))
+            if (!((pDb->Dbms() == dbmsSYBASE_ASA    && !wxStrcmp(pDb->sqlState,"42000")) ||  // v5.x (and lower?)
+                  (pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"37000")) ||
+                  (pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,"S1000")) ||
+                  (pDb->Dbms() == dbmsSYBASE_ASE    && !wxStrcmp(pDb->sqlState,"S0002")) ||  // Base table not found
+                  (pDb->Dbms() == dbmsMY_SQL        && !wxStrcmp(pDb->sqlState,"42S12")) ||  // tested by Christopher Ludwik Marino-Cebulski using v3.23.21beta
+                  (pDb->Dbms() == dbmsPOSTGRES      && !wxStrcmp(pDb->sqlState,"08S01"))
+               ))
             {
                 pDb->DispNextError();
                 pDb->DispAllErrors(henv, hdbc, hstmt);
@@ -1473,34 +1551,34 @@ void wxDbTable::BuildUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWher
     wxStrcat(pSqlStmt, " WHERE ");
     switch(typeOfUpd)
     {
-    case DB_UPD_KEYFIELDS:
-        // If the datasource supports the ROWID column, build
-        // the where on ROWID for efficiency purposes.
-        // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333'
-        if (CanUpdByROWID())
-        {
-            SDWORD cb;
-            char   rowid[wxDB_ROWID_LEN];
-
-            // Get the ROWID value.  If not successful retreiving the ROWID,
-            // simply fall down through the code and build the WHERE clause
-            // based on the key fields.
-            if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+        case DB_UPD_KEYFIELDS:
+            // If the datasource supports the ROWID column, build
+            // the where on ROWID for efficiency purposes.
+            // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333'
+            if (CanUpdByROWID())
             {
-                wxStrcat(pSqlStmt, "ROWID = '");
-                wxStrcat(pSqlStmt, rowid);
-                wxStrcat(pSqlStmt, "'");
-                break;
+                SDWORD cb;
+                char   rowid[wxDB_ROWID_LEN];
+
+                // Get the ROWID value.  If not successful retreiving the ROWID,
+                // simply fall down through the code and build the WHERE clause
+                // based on the key fields.
+                if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+                {
+                    wxStrcat(pSqlStmt, "ROWID = '");
+                    wxStrcat(pSqlStmt, rowid);
+                    wxStrcat(pSqlStmt, "'");
+                    break;
+                }
             }
-        }
-        // Unable to delete by ROWID, so build a WHERE
-        // clause based on the keyfields.
-        BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
-        wxStrcat(pSqlStmt, whereClause);
-        break;
-    case DB_UPD_WHERE:
-        wxStrcat(pSqlStmt, pWhereClause);
-        break;
+            // Unable to delete by ROWID, so build a WHERE
+            // clause based on the keyfields.
+            BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+            wxStrcat(pSqlStmt, whereClause);
+            break;
+        case DB_UPD_WHERE:
+            wxStrcat(pSqlStmt, pWhereClause);
+            break;
     }
 }  // BuildUpdateStmt()
 
@@ -1529,38 +1607,38 @@ void wxDbTable::BuildDeleteStmt(char *pSqlStmt, int typeOfDel, const char *pWher
     // Append the WHERE clause to the SQL DELETE statement
     switch(typeOfDel)
     {
-    case DB_DEL_KEYFIELDS:
-        // If the datasource supports the ROWID column, build
-        // the where on ROWID for efficiency purposes.
-        // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333'
-        if (CanUpdByROWID())
-        {
-            SDWORD cb;
-            char   rowid[wxDB_ROWID_LEN];
-
-            // Get the ROWID value.  If not successful retreiving the ROWID,
-            // simply fall down through the code and build the WHERE clause
-            // based on the key fields.
-            if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+        case DB_DEL_KEYFIELDS:
+            // If the datasource supports the ROWID column, build
+            // the where on ROWID for efficiency purposes.
+            // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333'
+            if (CanUpdByROWID())
             {
-                wxStrcat(pSqlStmt, "ROWID = '");
-                wxStrcat(pSqlStmt, rowid);
-                wxStrcat(pSqlStmt, "'");
-                break;
+                SDWORD cb;
+                char   rowid[wxDB_ROWID_LEN];
+
+                // Get the ROWID value.  If not successful retreiving the ROWID,
+                // simply fall down through the code and build the WHERE clause
+                // based on the key fields.
+                if (SQLGetData(hstmt, noCols+1, SQL_C_CHAR, (UCHAR*) rowid, wxDB_ROWID_LEN, &cb) == SQL_SUCCESS)
+                {
+                    wxStrcat(pSqlStmt, "ROWID = '");
+                    wxStrcat(pSqlStmt, rowid);
+                    wxStrcat(pSqlStmt, "'");
+                    break;
+                }
             }
-        }
-        // Unable to delete by ROWID, so build a WHERE
-        // clause based on the keyfields.
-        BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
-        wxStrcat(pSqlStmt, whereClause);
-        break;
-    case DB_DEL_WHERE:
-        wxStrcat(pSqlStmt, pWhereClause);
-        break;
-    case DB_DEL_MATCHING:
-        BuildWhereClause(whereClause, DB_WHERE_MATCHING);
-        wxStrcat(pSqlStmt, whereClause);
-        break;
+            // Unable to delete by ROWID, so build a WHERE
+            // clause based on the keyfields.
+            BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
+            wxStrcat(pSqlStmt, whereClause);
+            break;
+        case DB_DEL_WHERE:
+            wxStrcat(pSqlStmt, pWhereClause);
+            break;
+        case DB_DEL_MATCHING:
+            BuildWhereClause(whereClause, DB_WHERE_MATCHING);
+            wxStrcat(pSqlStmt, whereClause);
+            break;
     }
 
 }  // BuildDeleteStmt()
@@ -1606,27 +1684,27 @@ void wxDbTable::BuildWhereClause(char *pWhereClause, int typeOfWhere,
                 wxStrcat(pWhereClause, " = ");
             switch(colDefs[i].SqlCtype)
             {
-            case SQL_C_CHAR:
-                sprintf(colValue, "'%s'", (UCHAR FAR *) colDefs[i].PtrDataObj);
-                break;
-            case SQL_C_SSHORT:
-                sprintf(colValue, "%hi", *((SWORD *) colDefs[i].PtrDataObj));
-                break;
-            case SQL_C_USHORT:
-                sprintf(colValue, "%hu", *((UWORD *) colDefs[i].PtrDataObj));
-                break;
-            case SQL_C_SLONG:
-                sprintf(colValue, "%li", *((SDWORD *) colDefs[i].PtrDataObj));
-                break;
-            case SQL_C_ULONG:
-                sprintf(colValue, "%lu", *((UDWORD *) colDefs[i].PtrDataObj));
-                break;
-            case SQL_C_FLOAT:
-                sprintf(colValue, "%.6f", *((SFLOAT *) colDefs[i].PtrDataObj));
-                break;
-            case SQL_C_DOUBLE:
-                sprintf(colValue, "%.6f", *((SDOUBLE *) colDefs[i].PtrDataObj));
-                break;
+                case SQL_C_CHAR:
+                    sprintf(colValue, "'%s'", (UCHAR FAR *) colDefs[i].PtrDataObj);
+                    break;
+                case SQL_C_SSHORT:
+                    sprintf(colValue, "%hi", *((SWORD *) colDefs[i].PtrDataObj));
+                    break;
+                case SQL_C_USHORT:
+                    sprintf(colValue, "%hu", *((UWORD *) colDefs[i].PtrDataObj));
+                    break;
+                case SQL_C_SLONG:
+                    sprintf(colValue, "%li", *((SDWORD *) colDefs[i].PtrDataObj));
+                    break;
+                case SQL_C_ULONG:
+                    sprintf(colValue, "%lu", *((UDWORD *) colDefs[i].PtrDataObj));
+                    break;
+                case SQL_C_FLOAT:
+                    sprintf(colValue, "%.6f", *((SFLOAT *) colDefs[i].PtrDataObj));
+                    break;
+                case SQL_C_DOUBLE:
+                    sprintf(colValue, "%.6f", *((SDOUBLE *) colDefs[i].PtrDataObj));
+                    break;
             }
             wxStrcat(pWhereClause, colValue);
         }
@@ -1639,29 +1717,29 @@ bool wxDbTable::IsColNull(int colNo)
 {
     switch(colDefs[colNo].SqlCtype)
     {
-    case SQL_C_CHAR:
-        return(((UCHAR FAR *) colDefs[colNo].PtrDataObj)[0] == 0);
-    case SQL_C_SSHORT:
-        return((  *((SWORD *) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_USHORT:
-        return((   *((UWORD*) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_SLONG:
-        return(( *((SDWORD *) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_ULONG:
-        return(( *((UDWORD *) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_FLOAT:
-        return(( *((SFLOAT *) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_DOUBLE:
-        return((*((SDOUBLE *) colDefs[colNo].PtrDataObj))   == 0);
-    case SQL_C_TIMESTAMP:
-        TIMESTAMP_STRUCT *pDt;
-        pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
-        if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
+        case SQL_C_CHAR:
+            return(((UCHAR FAR *) colDefs[colNo].PtrDataObj)[0] == 0);
+        case SQL_C_SSHORT:
+            return((  *((SWORD *) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_USHORT:
+            return((   *((UWORD*) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_SLONG:
+            return(( *((SDWORD *) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_ULONG:
+            return(( *((UDWORD *) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_FLOAT:
+            return(( *((SFLOAT *) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_DOUBLE:
+            return((*((SDOUBLE *) colDefs[colNo].PtrDataObj))   == 0);
+        case SQL_C_TIMESTAMP:
+            TIMESTAMP_STRUCT *pDt;
+            pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj;
+            if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0)
+                return(TRUE);
+            else
+                return(FALSE);
+        default:
             return(TRUE);
-        else
-            return(FALSE);
-    default:
-        return(TRUE);
     }
 }  // wxDbTable::IsColNull()
 
@@ -1717,39 +1795,38 @@ void wxDbTable::ClearMemberVars(void)
     {
         switch(colDefs[i].SqlCtype)
         {
-        case SQL_C_CHAR:
-            ((UCHAR FAR *) colDefs[i].PtrDataObj)[0]    = 0;
-            break;
-        case SQL_C_SSHORT:
-            *((SWORD *) colDefs[i].PtrDataObj)          = 0;
-            break;
-        case SQL_C_USHORT:
-            *((UWORD*) colDefs[i].PtrDataObj)           = 0;
-            break;
-        case SQL_C_SLONG:
-            *((SDWORD *) colDefs[i].PtrDataObj)         = 0;
-            break;
-        case SQL_C_ULONG:
-            *((UDWORD *) colDefs[i].PtrDataObj)         = 0;
-            break;
-        case SQL_C_FLOAT:
-            *((SFLOAT *) colDefs[i].PtrDataObj)         = 0.0f;
-            break;
-        case SQL_C_DOUBLE:
-            *((SDOUBLE *) colDefs[i].PtrDataObj)        = 0.0f;
-            break;
-        case SQL_C_TIMESTAMP:
-            TIMESTAMP_STRUCT *pDt;
-            pDt = (TIMESTAMP_STRUCT *) colDefs[i].PtrDataObj;
-            pDt->year = 0;
-            pDt->month = 0;
-            pDt->day = 0;
-            pDt->hour = 0;
-            pDt->minute = 0;
-            pDt->second = 0;
-            pDt->fraction = 0;
-            break;
-	
+            case SQL_C_CHAR:
+                ((UCHAR FAR *) colDefs[i].PtrDataObj)[0]    = 0;
+                break;
+            case SQL_C_SSHORT:
+                *((SWORD *) colDefs[i].PtrDataObj)          = 0;
+                break;
+            case SQL_C_USHORT:
+                *((UWORD*) colDefs[i].PtrDataObj)           = 0;
+                break;
+            case SQL_C_SLONG:
+                *((SDWORD *) colDefs[i].PtrDataObj)         = 0;
+                break;
+            case SQL_C_ULONG:
+                *((UDWORD *) colDefs[i].PtrDataObj)         = 0;
+                break;
+            case SQL_C_FLOAT:
+                *((SFLOAT *) colDefs[i].PtrDataObj)         = 0.0f;
+                break;
+            case SQL_C_DOUBLE:
+                *((SDOUBLE *) colDefs[i].PtrDataObj)        = 0.0f;
+                break;
+            case SQL_C_TIMESTAMP:
+                TIMESTAMP_STRUCT *pDt;
+                pDt = (TIMESTAMP_STRUCT *) colDefs[i].PtrDataObj;
+                pDt->year = 0;
+                pDt->month = 0;
+                pDt->day = 0;
+                pDt->hour = 0;
+                pDt->minute = 0;
+                pDt->second = 0;
+                pDt->fraction = 0;
+                break;
         }
     }
 
@@ -1776,8 +1853,8 @@ bool wxDbTable::SetQueryTimeout(UDWORD nSeconds)
 
 /********** wxDbTable::SetColDefs() **********/
 void wxDbTable::SetColDefs (int index, const char *fieldName, int dataType, void *pData,
-                                 int cType, int size, bool keyField, bool upd,
-                                 bool insAllow, bool derivedCol)
+                            int cType, int size, bool keyField, bool upd,
+                            bool insAllow, bool derivedCol)
 {
     if (!colDefs)  // May happen if the database connection fails
         return;
@@ -1822,7 +1899,6 @@ wxDbColDataPtr* wxDbTable::SetColDefs (wxDbColInf *pColInfs, ULONG numCols)
     if (pColInfs)
     {
         ULONG index;
-
        
         pColDataPtrs = new wxDbColDataPtr[numCols+1];
 
@@ -1832,14 +1908,11 @@ wxDbColDataPtr* wxDbTable::SetColDefs (wxDbColInf *pColInfs, ULONG numCols)
             switch (pColInfs[index].dbDataType)
             {
                 case DB_DATA_TYPE_VARCHAR:
-                {
                    pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
                    pColDataPtrs[index].SzDataObj  = pColInfs[index].columnSize;
                    pColDataPtrs[index].SqlCtype   = SQL_C_CHAR;
                    break;
-                }
                 case DB_DATA_TYPE_INTEGER:
-                {
                     // Can be long or short
                     if (pColInfs[index].bufferLength == sizeof(long))
                     {
@@ -1854,9 +1927,7 @@ wxDbColDataPtr* wxDbTable::SetColDefs (wxDbColInf *pColInfs, ULONG numCols)
                         pColDataPtrs[index].SqlCtype   = SQL_C_SSHORT;
                     }
                     break;
-                }
                 case DB_DATA_TYPE_FLOAT:
-                {
                     // Can be float or double
                     if (pColInfs[index].bufferLength == sizeof(float))
                     {
@@ -1871,20 +1942,18 @@ wxDbColDataPtr* wxDbTable::SetColDefs (wxDbColInf *pColInfs, ULONG numCols)
                         pColDataPtrs[index].SqlCtype   = SQL_C_DOUBLE;
                     }  
                     break;
-                }
                 case DB_DATA_TYPE_DATE:
-                {
                     pColDataPtrs[index].PtrDataObj = new TIMESTAMP_STRUCT;
                     pColDataPtrs[index].SzDataObj  = sizeof(TIMESTAMP_STRUCT);
                     pColDataPtrs[index].SqlCtype   = SQL_C_TIMESTAMP;
                     break;
-                }
             }
-
-         SetColDefs (index,pColInfs[index].colName,pColInfs[index].dbDataType, pColDataPtrs[index].PtrDataObj, pColDataPtrs[index].SqlCtype, pColDataPtrs[index].SzDataObj);
+            SetColDefs (index,pColInfs[index].colName,pColInfs[index].dbDataType, pColDataPtrs[index].PtrDataObj, pColDataPtrs[index].SqlCtype, pColDataPtrs[index].SzDataObj);
         }
     }
+
     return (pColDataPtrs);
+
 } // wxDbTable::SetColDef()
 
 
@@ -1902,7 +1971,7 @@ void wxDbTable::SetCursor(HSTMT *hstmtActivate)
 /********** wxDbTable::Count(const char *) **********/
 ULONG wxDbTable::Count(const char *args)
 {
-    ULONG l;
+    ULONG count;
     wxString sqlStmt;
     SDWORD cb;
 
@@ -1955,7 +2024,7 @@ ULONG wxDbTable::Count(const char *args)
     }
 
     // Obtain the result
-    if (SQLGetData(*hstmtCount, 1, SQL_C_ULONG, &l, sizeof(l), &cb) != SQL_SUCCESS)
+    if (SQLGetData(*hstmtCount, 1, SQL_C_ULONG, &count, sizeof(count), &cb) != SQL_SUCCESS)
     {
         pDb->DispAllErrors(henv, hdbc, *hstmtCount);
         return(0);
@@ -1966,7 +2035,7 @@ ULONG wxDbTable::Count(const char *args)
         pDb->DispAllErrors(henv, hdbc, *hstmtCount);
 
     // Return the record count
-    return(l);
+    return(count);
 
 }  // wxDbTable::Count()
 
diff --git a/src/common/docview.cpp b/src/common/docview.cpp
index 5e0d3c4aef..bcb467b60e 100644
--- a/src/common/docview.cpp
+++ b/src/common/docview.cpp
@@ -1114,8 +1114,8 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
         }
         return newDoc;
     }
-    else
-        return (wxDocument *) NULL;
+
+    return (wxDocument *) NULL;
 }
 
 wxView *wxDocManager::CreateView(wxDocument *doc, long flags)
@@ -1364,7 +1364,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
     wxString descrBuf = wxT("*.*");
 #endif
 
-    int FilterIndex = 0;
+    int FilterIndex = -1;
 
     wxWindow* parent = wxFindSuitableParent();
 
@@ -1376,6 +1376,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
                                         0,
                                         parent);
 
+    wxDocTemplate *theTemplate = (wxDocTemplate *)NULL;
     if (!pathTmp.IsEmpty())
     {
         if (!wxFileExists(pathTmp))
@@ -1396,21 +1397,20 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
 
         path = pathTmp;
 
-        // This is dodgy in that we're selecting the template on the
-        // basis of the file extension, which may not be a standard
-        // one. We really want to know exactly which template was
-        // chosen by using a more advanced file selector.
-        wxDocTemplate *theTemplate = FindTemplateForPath(path);
-        if ( !theTemplate )
+        // first choose the template using the extension, if this fails (i.e.
+        // wxFileSelectorEx() didn't fill it), then use the path
+        if ( FilterIndex != -1 )
             theTemplate = templates[FilterIndex];
-
-        return theTemplate;
+        if ( !theTemplate )
+            theTemplate = FindTemplateForPath(path);
     }
     else
     {
         path = wxT("");
-        return (wxDocTemplate *) NULL;
     }
+
+    return theTemplate;
+
 #if 0
     // In all other windowing systems, until we have more advanced
     // file selectors, we must select the document type (template) first, and
diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp
index cc41e9f693..3aa8cc8758 100644
--- a/src/common/dynlib.cpp
+++ b/src/common/dynlib.cpp
@@ -102,7 +102,6 @@ static wxString ConstructLibraryName(const wxString& basename)
     return fullname;
 }
 
-
 // ---------------------------------------------------------------------------
 // wxLibrary (one instance per dynamic library)
 // ---------------------------------------------------------------------------
diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp
index fe2909b43f..18a61b6768 100644
--- a/src/common/fontmap.cpp
+++ b/src/common/fontmap.cpp
@@ -54,7 +54,7 @@
 // ----------------------------------------------------------------------------
 
 // the config paths we use
-static const wxChar* FONTMAPPER_ROOT_PATH = wxT("wxWindows/FontMapper");
+static const wxChar* FONTMAPPER_ROOT_PATH = wxT("/wxWindows/FontMapper");
 static const wxChar* FONTMAPPER_CHARSET_PATH = wxT("Charsets");
 static const wxChar* FONTMAPPER_CHARSET_ALIAS_PATH = wxT("Aliases");
 #if wxUSE_GUI
@@ -403,6 +403,15 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
     // if didn't find it there, try to reckognise it ourselves
     if ( encoding == wxFONTENCODING_SYSTEM )
     {
+        // discard the optional quotes
+        if ( !!cs )
+        {
+            if ( cs[0u] == _T('"') && cs.Last() == _T('"') )
+            {
+                cs = wxString(cs.c_str(), cs.length() - 1);
+            }
+        }
+
         cs.MakeUpper();
 
         if ( !cs || cs == wxT("US-ASCII") )
@@ -699,10 +708,13 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
     // now try the default mappings:
     wxFontEncodingArray equiv = wxEncodingConverter::GetAllEquivalents(encoding);
     size_t count = equiv.GetCount();
-    for ( size_t i = (equiv[0] == encoding) ? 1 : 0; i < count; i++ )
+    if ( count )
     {
-        if ( TestAltEncoding(configEntry, equiv[i], info) )
-            return TRUE;
+        for ( size_t i = (equiv[0] == encoding) ? 1 : 0; i < count; i++ )
+        {
+            if ( TestAltEncoding(configEntry, equiv[i], info) )
+                return TRUE;
+        }
     }
 
     return FALSE;
@@ -729,8 +741,8 @@ bool wxFontMapper::IsEncodingAvailable(wxFontEncoding encoding,
         info.facename = facename;
         return wxTestFontEncoding(info);
     }
-    else
-        return FALSE;
+
+    return FALSE;
 }
 
 #endif // wxUSE_GUI
diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp
index 3d94d675e1..c7678d5b5f 100644
--- a/src/common/framecmn.cpp
+++ b/src/common/framecmn.cpp
@@ -196,15 +196,17 @@ bool wxFrameBase::ProcessCommand(int id)
     if ( !bar )
         return FALSE;
 
+    wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
+    commandEvent.SetEventObject(this);
+
     wxMenuItem *item = bar->FindItem(id);
     if ( item && item->IsCheckable() )
     {
         item->Toggle();
-    }
 
-    wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
-    commandEvent.SetInt(id);
-    commandEvent.SetEventObject(this);
+        // use the new value
+        commandEvent.SetInt(item->IsChecked());
+    }
 
     return GetEventHandler()->ProcessEvent(commandEvent);
 }
diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp
index 706cd05352..e78ce297a0 100644
--- a/src/common/fs_zip.cpp
+++ b/src/common/fs_zip.cpp
@@ -85,12 +85,9 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
                             GetAnchor(location),
                             wxDateTime(wxFileModificationTime(left)));
     }
-    else
-    {
-        if (s)
-            delete s;
-        return NULL;
-    }
+
+    delete s;
+    return NULL;
 }
 
 
diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp
index 5cec45e69b..a45cb5ab37 100644
--- a/src/common/gifdecod.cpp
+++ b/src/common/gifdecod.cpp
@@ -492,7 +492,7 @@ int wxGIFDecoder::ReadGIF()
     int           ncolors, bits, interl, transparent, disposal, i;
     long          size;
     long          delay;
-    unsigned char type;
+    unsigned char type = 0;
     unsigned char pal[768];
     unsigned char buf[16];
     GIFImage      **ppimg, *pimg, *pprev;
diff --git a/src/common/hash.cpp b/src/common/hash.cpp
index 5ec47a519b..f2a43cd10b 100644
--- a/src/common/hash.cpp
+++ b/src/common/hash.cpp
@@ -104,7 +104,7 @@ void wxHashTableBase::DeleteContents(bool flag)
 
 wxNodeBase *wxHashTableBase::GetNode(long key, long value) const
 {
-    size_t slot = (size_t)abs(key % (long)m_hashSize);
+    size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
 
     wxNodeBase *node;
     if ( m_hashTable[slot] )
@@ -161,7 +161,7 @@ void wxHashTableLong::Put(long key, long value)
 {
     wxCHECK_RET( m_hashSize, _T("must call Create() first") );
 
-    size_t slot = (size_t)abs(key % (long)m_hashSize);
+    size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
 
     if ( !m_keys[slot] )
     {
@@ -179,7 +179,7 @@ long wxHashTableLong::Get(long key) const
 {
     wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
 
-    size_t slot = (size_t)abs(key % (long)m_hashSize);
+    size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
 
     wxArrayLong *keys = m_keys[slot];
     if ( keys )
@@ -201,7 +201,7 @@ long wxHashTableLong::Delete(long key)
 {
     wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") );
 
-    size_t slot = (size_t)abs(key % (long)m_hashSize);
+    size_t slot = (size_t)abs((int)(key % (long)m_hashSize));
 
     wxArrayLong *keys = m_keys[slot];
     if ( keys )
diff --git a/src/common/image.cpp b/src/common/image.cpp
index 9e4921bd87..d8117cb9da 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -317,7 +317,7 @@ wxImage wxImage::Mirror( bool horizontally ) const
         for (long i = 0; i < height; i++)
         {
             target_data = data + 3*width*(height-1-i);
-            memcpy( target_data, source_data, 3*width );
+            memcpy( target_data, source_data, (size_t)3*width );
             source_data += 3*width;
         }
     }
@@ -739,9 +739,9 @@ bool wxImage::SaveFile( const wxString& filename, int type )
         wxBufferedOutputStream bstream( stream );
         return SaveFile(bstream, type);
     }
-    else
 #endif // wxUSE_STREAMS
-        return FALSE;
+
+    return FALSE;
 }
 
 bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
@@ -754,9 +754,9 @@ bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
         wxBufferedOutputStream bstream( stream );
         return SaveFile(bstream, mimetype);
     }
-    else
 #endif // wxUSE_STREAMS
-        return FALSE;
+
+    return FALSE;
 }
 
 bool wxImage::CanRead( const wxString &name )
diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp
index 8d64962940..f985604631 100644
--- a/src/common/imagjpeg.cpp
+++ b/src/common/imagjpeg.cpp
@@ -117,7 +117,7 @@ METHODDEF(void) my_term_source ( j_decompress_ptr cinfo )
     my_src_ptr src = (my_src_ptr) cinfo->src;
 
     if (src->pub.bytes_in_buffer > 0)
-        src->stream->SeekI(-src->pub.bytes_in_buffer, wxFromCurrent);
+        src->stream->SeekI(-(long)src->pub.bytes_in_buffer, wxFromCurrent);
     delete[] src->buffer;
 }
 
@@ -173,7 +173,11 @@ my_error_exit (j_common_ptr cinfo)
   longjmp(myerr->setjmp_buffer, 1);
 }
 
-
+// temporarily disable the warning C4611 (interaction between '_setjmp' and
+// C++ object destruction is non-portable) - I don't see any dtors here
+#ifdef __VISUALC__
+    #pragma warning(disable:4611)
+#endif /* VC++ */
 
 bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
 {
@@ -229,10 +233,6 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
     return TRUE;
 }
 
-
-
-
-
 typedef struct {
     struct jpeg_destination_mgr pub;
 
@@ -349,6 +349,9 @@ bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
     return TRUE;
 }
 
+#ifdef __VISUALC__
+    #pragma warning(default:4611)
+#endif /* VC++ */
 
 bool wxJPEGHandler::DoCanRead( wxInputStream& stream )
 {
diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp
index f869ffedee..8272a0d383 100644
--- a/src/common/imagpng.cpp
+++ b/src/common/imagpng.cpp
@@ -93,6 +93,12 @@ LINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp WX
 {
 }
 
+// temporarily disable the warning C4611 (interaction between '_setjmp' and
+// C++ object destruction is non-portable) - I don't see any dtors here
+#ifdef __VISUALC__
+    #pragma warning(disable:4611)
+#endif /* VC++ */
+
 bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
 {
     // VZ: as this function uses setjmp() the only fool proof error handling
@@ -267,7 +273,6 @@ bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
     return FALSE;
 }
 
-
 bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
 {
     {
@@ -346,6 +351,10 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
     return TRUE;
 }
 
+#ifdef __VISUALC__
+    #pragma warning(default:4611)
+#endif /* VC++ */
+
 bool wxPNGHandler::DoCanRead( wxInputStream& stream )
 {
     unsigned char hdr[4];
diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp
index 8659c70947..0802fea039 100644
--- a/src/common/sizer.cpp
+++ b/src/common/sizer.cpp
@@ -164,7 +164,7 @@ wxSize wxSizerItem::CalcMin()
 void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
 {
     m_pos = pos;
-    
+
     if (m_flag & wxWEST)
     {
         pos.x += m_border;
@@ -298,11 +298,11 @@ bool wxSizer::Remove( wxWindow *window )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetWindow() == window)
-	    {
+        if (item->GetWindow() == window)
+        {
             m_children.DeleteNode( node );
-	        return TRUE;
-	    }
+            return TRUE;
+        }
         node = node->Next();
     }
 
@@ -317,11 +317,11 @@ bool wxSizer::Remove( wxSizer *sizer )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetSizer() == sizer)
-	    {
+        if (item->GetSizer() == sizer)
+        {
             m_children.DeleteNode( node );
-	        return TRUE;
-	    }
+            return TRUE;
+        }
         node = node->Next();
     }
 
@@ -375,11 +375,11 @@ void wxSizer::SetDimension( int x, int y, int width, int height )
 }
 
 wxSize wxSizer::GetMinSize()
-{ 
+{
     wxSize ret( CalcMin() );
     if (ret.x < m_minSize.x) ret.x = m_minSize.x;
     if (ret.y < m_minSize.y) ret.y = m_minSize.y;
-    return ret; 
+    return ret;
 }
 
 void wxSizer::DoSetMinSize( int width, int height )
@@ -396,11 +396,11 @@ bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetWindow() == window)
-	    {
+        if (item->GetWindow() == window)
+        {
             item->SetInitSize( width, height );
-	        return TRUE;
-	    }
+            return TRUE;
+        }
         node = node->Next();
     }
 
@@ -408,15 +408,15 @@ bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetSizer())
-	    {
+        if (item->GetSizer())
+        {
             /* It's a sizer, so lets search recursively. */
             if (item->GetSizer()->DoSetItemMinSize( window, width, height ))
             {
                 /* A child sizer found the requested windw, exit. */
-	            return TRUE;
+                return TRUE;
             }
-	    }
+        }
         node = node->Next();
     }
 
@@ -431,11 +431,11 @@ bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetSizer() == sizer)
-	    {
+        if (item->GetSizer() == sizer)
+        {
             item->GetSizer()->DoSetMinSize( width, height );
-	        return TRUE;
-	    }
+            return TRUE;
+        }
         node = node->Next();
     }
 
@@ -443,15 +443,15 @@ bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height )
     while (node)
     {
         wxSizerItem *item = (wxSizerItem*)node->Data();
-	    if (item->GetSizer())
-	    {
+        if (item->GetSizer())
+        {
             /* It's a sizer, so lets search recursively. */
             if (item->GetSizer()->DoSetItemMinSize( sizer, width, height ))
             {
                 /* A child sizer found the requested windw, exit. */
-	            return TRUE;
+                return TRUE;
             }
-	    }
+        }
         node = node->Next();
     }
 
@@ -471,7 +471,7 @@ bool wxSizer::DoSetItemMinSize( int pos, int width, int height )
     }
     else
     {
-        /* ... whereas the minimal size of spacers and windows in stored 
+        /* ... whereas the minimal size of spacers and windows in stored
            in the item */
         item->SetInitSize( width, height );
     }
@@ -515,9 +515,9 @@ void wxGridSizer::RecalcSizes()
 
     wxSize sz( GetSize() );
     wxPoint pt( GetPosition() );
-    
-	int w = (sz.x - (ncols - 1) * m_hgap) / ncols;
-	int h = (sz.y - (nrows - 1) * m_vgap) / nrows;
+
+    int w = (sz.x - (ncols - 1) * m_hgap) / ncols;
+    int h = (sz.y - (nrows - 1) * m_vgap) / nrows;
 
     int x = pt.x;
     for (int c = 0; c < ncols; c++)
@@ -530,7 +530,7 @@ void wxGridSizer::RecalcSizes()
             {
                 wxNode *node = m_children.Nth( i );
                 wxASSERT( node );
-                
+
                 SetItemBounds( (wxSizerItem*) node->Data(), x, y, w, h);
             }
             y = y + h + m_vgap;
@@ -556,7 +556,7 @@ wxSize wxGridSizer::CalcMin()
     /* Find the max width and height for any component */
     int w = 0;
     int h = 0;
-    
+
     wxNode *node = m_children.First();
     while (node)
     {
@@ -564,10 +564,10 @@ wxSize wxGridSizer::CalcMin()
         wxSize sz( item->CalcMin() );
         w = wxMax( w, sz.x );
         h = wxMax( h, sz.y );
-        
+
         node = node->Next();
     }
-    
+
     return wxSize(ncols * w + (ncols-1) * m_hgap,
                   nrows * h + (nrows-1) * m_vgap);
 }
@@ -592,7 +592,7 @@ void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
         {
             pt.x = x + (w - sz.x);
         }
-        
+
         if (flag & wxALIGN_CENTER_VERTICAL)
         {
             pt.y = y + (h - sz.y) / 2;
@@ -602,7 +602,7 @@ void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
             pt.y = y + (h - sz.y);
         }
     }
-    
+
     item->SetDimension(pt, sz);
 }
 
@@ -612,18 +612,18 @@ void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
 
 wxFlexGridSizer::wxFlexGridSizer( int rows, int cols, int vgap, int hgap )
    : wxGridSizer( rows, cols, vgap, hgap )
-{ 
+{
     m_rowHeights = (int*) NULL;
     m_colWidths = (int*) NULL;
 }
 
 wxFlexGridSizer::wxFlexGridSizer( int cols, int vgap, int hgap )
-   : wxGridSizer( cols, vgap, hgap ) 
-{ 
+   : wxGridSizer( cols, vgap, hgap )
+{
     m_rowHeights = (int*) NULL;
     m_colWidths = (int*) NULL;
 }
-       
+
 wxFlexGridSizer::~wxFlexGridSizer()
 {
     if (m_rowHeights)
@@ -638,10 +638,10 @@ void wxFlexGridSizer::CreateArrays()
         delete[] m_rowHeights;
     if (m_colWidths)
         delete[] m_colWidths;
-        
+
     if (m_children.GetCount() == 0)
         return;
-        
+
     int nitems = m_children.GetCount();
     int nrows = m_rows;
     int ncols = m_cols;
@@ -653,7 +653,7 @@ void wxFlexGridSizer::CreateArrays()
 
     m_rowHeights = new int[nrows];
     m_colWidths = new int[ncols];
-    
+
     for (int col = 0; col < ncols; col++)
         m_colWidths[ col ] = 0;
     for (int row = 0; row < nrows; row++)
@@ -686,14 +686,14 @@ void wxFlexGridSizer::RecalcSizes()
         for (idx = 0; idx < m_growableRows.GetCount(); idx++)
             m_rowHeights[ m_growableRows[idx] ] += delta;
     }
-    
+
     if ((m_growableCols.GetCount() > 0) && (sz.x > minsz.x))
     {
         delta = (sz.x - minsz.x) / m_growableCols.GetCount();
         for (idx = 0; idx < m_growableCols.GetCount(); idx++)
             m_colWidths[ m_growableCols[idx] ] += delta;
     }
-    
+
     sz = wxSize( pt.x + sz.x, pt.y + sz.y );
 
     int x = pt.x;
@@ -707,10 +707,10 @@ void wxFlexGridSizer::RecalcSizes()
             {
                 wxNode *node = m_children.Nth( i );
                 wxASSERT( node );
-                
+
                 int w = wxMax( 0, wxMin( m_colWidths[c], sz.x - x ) );
                 int h = wxMax( 0, wxMin( m_rowHeights[r], sz.y - y ) );
-                
+
                 SetItemBounds( (wxSizerItem*) node->Data(), x, y, w, h);
             }
             y = y + m_rowHeights[r] + m_vgap;
@@ -734,10 +734,10 @@ wxSize wxFlexGridSizer::CalcMin()
         ncols = (nitems + nrows-1) / nrows;
 
     CreateArrays();
-    
+
     int col;
     int row;
-    
+
     int i = 0;
     wxNode *node = m_children.First();
     while (node)
@@ -748,19 +748,19 @@ wxSize wxFlexGridSizer::CalcMin()
         col = i % ncols;
         m_rowHeights[ row ] = wxMax( sz.y, m_rowHeights[ row ] );
         m_colWidths[ col ] = wxMax( sz.x, m_colWidths[ col ] );
-        
+
         node = node->Next();
         i++;
     }
-    
+
     int width = 0;
     for (col = 0; col < ncols; col++)
         width += m_colWidths[ col ];
-    
+
     int height = 0;
     for (row = 0; row < nrows; row++)
         height += m_rowHeights[ row ];
-    
+
     return wxSize( width +  (ncols-1) * m_hgap,
                    height + (nrows-1) * m_vgap);
 }
@@ -770,7 +770,7 @@ void wxFlexGridSizer::AddGrowableRow( size_t idx )
     m_growableRows.Add( idx );
 }
 
-void wxFlexGridSizer::RemoveGrowableRow( size_t idx )
+void wxFlexGridSizer::RemoveGrowableRow( size_t WXUNUSED(idx) )
 {
 }
 
@@ -779,7 +779,7 @@ void wxFlexGridSizer::AddGrowableCol( size_t idx )
     m_growableCols.Add( idx );
 }
 
-void wxFlexGridSizer::RemoveGrowableCol( size_t idx )
+void wxFlexGridSizer::RemoveGrowableCol( size_t WXUNUSED(idx) )
 {
 }
 
@@ -805,12 +805,12 @@ void wxBoxSizer::RecalcSizes()
         {
             delta = (m_size.x - m_fixedWidth) / m_stretchable;
             extra = (m_size.x - m_fixedWidth) % m_stretchable;
-	    }
-	    else
-	    { 
+        }
+        else
+        {
             delta = (m_size.y - m_fixedHeight) / m_stretchable;
             extra = (m_size.y - m_fixedHeight) % m_stretchable;
-	    }
+        }
     }
 
     wxPoint pt( m_position );
@@ -820,64 +820,64 @@ void wxBoxSizer::RecalcSizes()
     {
         wxSizerItem *item = (wxSizerItem*) node->Data();
 
-	    int weight = 1;
-	    if (item->GetOption())
-	        weight = item->GetOption();
-
-	    wxSize size( item->CalcMin() );
-
-	    if (m_orient == wxVERTICAL)
-	    {
-	        wxCoord height = size.y;
-	        if (item->GetOption())
-	        {
-	            height = (delta * weight) + extra;
-		        extra = 0; // only the first item will get the remainder as extra size
-	        }
-
-	        wxPoint child_pos( pt );
-	        wxSize  child_size( wxSize( size.x, height) );
-
-	        if (item->GetFlag() & (wxEXPAND | wxSHAPED))
-	            child_size.x = m_size.x;
-	        else if (item->GetFlag() & wxALIGN_RIGHT)
-	            child_pos.x += m_size.x - size.x;
-	        else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_HORIZONTAL))
-	        // XXX wxCENTER is added for backward compatibility;
-	        //     wxALIGN_CENTER should be used in new code
-	            child_pos.x += (m_size.x - size.x) / 2;
-
-	        item->SetDimension( child_pos, child_size );
-
-	        pt.y += height;
-	    }
-	    else
-	    {
-	        wxCoord width = size.x;
-	        if (item->GetOption())
-	        {  
-	            width = (delta * weight) + extra;
-		        extra = 0; // only the first item will get the remainder as extra size
-	        }
-
-	        wxPoint child_pos( pt );
-	        wxSize  child_size( wxSize(width, size.y) );
-
-	        if (item->GetFlag() & (wxEXPAND | wxSHAPED))
-	            child_size.y = m_size.y;
-	        else if (item->GetFlag() & wxALIGN_BOTTOM)
-	            child_pos.y += m_size.y - size.y;
-	        else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_VERTICAL))
-	        // XXX wxCENTER is added for backward compatibility;
-	        //     wxALIGN_CENTER should be used in new code
-	            child_pos.y += (m_size.y - size.y) / 2;
-
-	        item->SetDimension( child_pos, child_size );
-
-	        pt.x += width;
-	    }
-
-	    node = node->Next();
+        int weight = 1;
+        if (item->GetOption())
+            weight = item->GetOption();
+
+        wxSize size( item->CalcMin() );
+
+        if (m_orient == wxVERTICAL)
+        {
+            wxCoord height = size.y;
+            if (item->GetOption())
+            {
+                height = (delta * weight) + extra;
+                extra = 0; // only the first item will get the remainder as extra size
+            }
+
+            wxPoint child_pos( pt );
+            wxSize  child_size( wxSize( size.x, height) );
+
+            if (item->GetFlag() & (wxEXPAND | wxSHAPED))
+                child_size.x = m_size.x;
+            else if (item->GetFlag() & wxALIGN_RIGHT)
+                child_pos.x += m_size.x - size.x;
+            else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_HORIZONTAL))
+            // XXX wxCENTER is added for backward compatibility;
+            //     wxALIGN_CENTER should be used in new code
+                child_pos.x += (m_size.x - size.x) / 2;
+
+            item->SetDimension( child_pos, child_size );
+
+            pt.y += height;
+        }
+        else
+        {
+            wxCoord width = size.x;
+            if (item->GetOption())
+            {
+                width = (delta * weight) + extra;
+                extra = 0; // only the first item will get the remainder as extra size
+            }
+
+            wxPoint child_pos( pt );
+            wxSize  child_size( wxSize(width, size.y) );
+
+            if (item->GetFlag() & (wxEXPAND | wxSHAPED))
+                child_size.y = m_size.y;
+            else if (item->GetFlag() & wxALIGN_BOTTOM)
+                child_pos.y += m_size.y - size.y;
+            else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_VERTICAL))
+            // XXX wxCENTER is added for backward compatibility;
+            //     wxALIGN_CENTER should be used in new code
+                child_pos.y += (m_size.y - size.y) / 2;
+
+            item->SetDimension( child_pos, child_size );
+
+            pt.x += width;
+        }
+
+        node = node->Next();
     }
 }
 
@@ -897,42 +897,42 @@ wxSize wxBoxSizer::CalcMin()
     {
         wxSizerItem *item = (wxSizerItem*) node->Data();
 
-	    int weight = 1;
-	    if (item->GetOption())
-	        weight = item->GetOption();
-
-	    wxSize size( item->CalcMin() );
-
-	    if (m_orient == wxHORIZONTAL)
-	    {
-	        m_minWidth += (size.x * weight);
-	        m_minHeight = wxMax( m_minHeight, size.y );
-	    }
-	    else
-	    {
-	        m_minHeight += (size.y * weight);
-	        m_minWidth = wxMax( m_minWidth, size.x );
-	    }
-
-	    if (item->GetOption())
-	    {
-	        m_stretchable += weight;
-	    }
-	    else
-	    {
-	        if (m_orient == wxVERTICAL)
-	        {
-		        m_fixedHeight += size.y;
-		        m_fixedWidth = wxMax( m_fixedWidth, size.x );
-	        }
-	        else
-	        {
-		        m_fixedWidth += size.x;
-		        m_fixedHeight = wxMax( m_fixedHeight, size.y );
-	        }
-	    }
-
-	    node = node->Next();
+        int weight = 1;
+        if (item->GetOption())
+            weight = item->GetOption();
+
+        wxSize size( item->CalcMin() );
+
+        if (m_orient == wxHORIZONTAL)
+        {
+            m_minWidth += (size.x * weight);
+            m_minHeight = wxMax( m_minHeight, size.y );
+        }
+        else
+        {
+            m_minHeight += (size.y * weight);
+            m_minWidth = wxMax( m_minWidth, size.x );
+        }
+
+        if (item->GetOption())
+        {
+            m_stretchable += weight;
+        }
+        else
+        {
+            if (m_orient == wxVERTICAL)
+            {
+                m_fixedHeight += size.y;
+                m_fixedWidth = wxMax( m_fixedWidth, size.x );
+            }
+            else
+            {
+                m_fixedWidth += size.x;
+                m_fixedHeight = wxMax( m_fixedHeight, size.y );
+            }
+        }
+
+        node = node->Next();
     }
 
     return wxSize( m_minWidth, m_minHeight );
@@ -979,7 +979,7 @@ wxSize wxStaticBoxSizer::CalcMin()
     // This will have to be done platform by platform
     // as there is no way to guess the thickness of
     // a wxStaticBox border.
-    
+
     int top_border = 15;
     if (m_staticBox->GetLabel().IsEmpty()) top_border = 5;
     int other_border = 5;
@@ -1000,7 +1000,7 @@ wxSize wxStaticBoxSizer::CalcMin()
 wxNotebookSizer::wxNotebookSizer( wxNotebook *nb )
 {
     wxASSERT_MSG( nb, wxT("wxNotebookSizer needs a notebook") );
-    
+
     m_notebook = nb;
 }
 
@@ -1014,7 +1014,7 @@ wxSize wxNotebookSizer::CalcMin()
     // This will have to be done platform by platform
     // as there is no way to guess the thickness of
     // the wxNotebook tabs and border.
-    
+
     int borderX = 5;
     int borderY = 5;
     if ((m_notebook->HasFlag(wxNB_RIGHT)) ||
@@ -1026,7 +1026,7 @@ wxSize wxNotebookSizer::CalcMin()
     {
         borderY += 40; // improvements later..
     }
-    
+
     if (m_notebook->GetChildren().GetCount() == 0)
         return wxSize(borderX + 10, borderY + 10);
 
@@ -1037,17 +1037,17 @@ wxSize wxNotebookSizer::CalcMin()
     while (node)
     {
         wxWindow *item = node->GetData();
-	    wxSizer *itemsizer = item->GetSizer();
-	
-	    if (itemsizer)
-	    {
+        wxSizer *itemsizer = item->GetSizer();
+
+        if (itemsizer)
+        {
             wxSize subsize( itemsizer->CalcMin() );
-	
-	        if (subsize.x > maxX) maxX = subsize.x;
-	        if (subsize.y > maxY) maxY = subsize.y;
-	    }
 
-	    node = node->GetNext();
+            if (subsize.x > maxX) maxX = subsize.x;
+            if (subsize.y > maxY) maxY = subsize.y;
+        }
+
+        node = node->GetNext();
     }
 
     return wxSize( borderX + maxX, borderY + maxY );
diff --git a/src/common/unzip.c b/src/common/unzip.c
index d9b855ae5c..be48958cfb 100644
--- a/src/common/unzip.c
+++ b/src/common/unzip.c
@@ -149,6 +149,11 @@ typedef struct
 int unzlocal_CheckCurrentFileCoherencyHeader (unz_s*, uInt*, uLong*, uInt*);
 #endif
 
+/* disable warnings about K&R declarations until the end of file */
+#ifdef _MSC_VER
+#pragma warning(disable:4131)
+#endif /* VC++ */
+
 /* ===========================================================================
      Read a byte from a gz_stream; update next_in and avail_in. Return EOF
    for end of file.
diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp
index 5ddfb2442a..49c15f3284 100644
--- a/src/common/utilscmn.cpp
+++ b/src/common/utilscmn.cpp
@@ -498,20 +498,29 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
                     keyCode = WXK_F1 + n - 1;
                 }
                 else {
-#if 0 // this is not supported by GTK+, apparently
                     // several special cases
                     current.MakeUpper();
                     if ( current == wxT("DEL") ) {
-                        keyCode = VK_DELETE;
+                        keyCode = WXK_DELETE;
                     }
+                    else if ( current == wxT("DELETE") ) {
+                        keyCode = WXK_DELETE;
+                    }
+                    else if ( current == wxT("INS") ) {
+                        keyCode = WXK_INSERT;
+                    }
+                    else if ( current == wxT("INSERT") ) {
+                        keyCode = WXK_INSERT;
+                    }
+#if 0
                     else if ( current == wxT("PGUP") ) {
                         keyCode = VK_PRIOR;
                     }
                     else if ( current == wxT("PGDN") ) {
                         keyCode = VK_NEXT;
                     }
+#endif
                     else
-#endif // 0
                     {
                         wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
                                    current.c_str());
@@ -878,10 +887,13 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
             return wxYES;
         case wxID_NO:
             return wxNO;
-        default:
         case wxID_CANCEL:
             return wxCANCEL;
     }
+
+    wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") );
+
+    return wxCANCEL;
 }
 
 #if wxUSE_TEXTDLG
diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp
index 2c43f60648..5f687dd7ea 100644
--- a/src/common/valgen.cpp
+++ b/src/common/valgen.cpp
@@ -6,7 +6,7 @@
 // Created:     Jan 22 1999
 // RCS-ID:
 // Copyright:   (c) 1999 Kevin Smith
-// Licence:   	wxWindows licence
+// Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -113,21 +113,21 @@ bool wxGenericValidator::TransferToWindow(void)
     {
         wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
         if (m_pBool)
-	{
-	    pControl->SetValue(*m_pBool);
-	    return TRUE;
-	}
+        {
+            pControl->SetValue(*m_pBool);
+            return TRUE;
+        }
     } else
 #endif
 #if wxUSE_RADIOBTN
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
     {
         wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
-	if (m_pBool)
-	{
-	    pControl->SetValue(*m_pBool) ;
-	    return TRUE;
-	}
+        if (m_pBool)
+        {
+            pControl->SetValue(*m_pBool) ;
+            return TRUE;
+        }
     } else
 #endif
 
@@ -136,33 +136,33 @@ bool wxGenericValidator::TransferToWindow(void)
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
     {
         wxGauge* pControl = (wxGauge*) m_validatorWindow;
-	if (m_pInt)
-	{
-	    pControl->SetValue(*m_pInt);
-	    return TRUE;
-	}
+        if (m_pInt)
+        {
+            pControl->SetValue(*m_pInt);
+            return TRUE;
+        }
     } else
 #endif
 #if wxUSE_RADIOBOX
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
     {
         wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
-	if (m_pInt)
-	{
-	    pControl->SetSelection(*m_pInt) ;
-	    return TRUE;
-	}
+        if (m_pInt)
+        {
+            pControl->SetSelection(*m_pInt) ;
+            return TRUE;
+        }
     } else
 #endif
 #if wxUSE_SCROLLBAR
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
     {
         wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
-	if (m_pInt)
-	{
-	    pControl->SetThumbPosition(*m_pInt) ;
-	    return TRUE;
-	}
+        if (m_pInt)
+        {
+            pControl->SetThumbPosition(*m_pInt) ;
+            return TRUE;
+        }
     } else
 #endif
 #if wxUSE_SPINCTRL && !defined(__WIN16__) && !defined(__WXMOTIF__)
@@ -180,11 +180,11 @@ bool wxGenericValidator::TransferToWindow(void)
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
     {
         wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
-	if (m_pInt)
-	{
-	    pControl->SetValue(*m_pInt) ;
-	    return TRUE;
-	}
+        if (m_pInt)
+        {
+            pControl->SetValue(*m_pInt) ;
+            return TRUE;
+        }
     } else
 #endif
 #if wxUSE_SLIDER
@@ -193,21 +193,21 @@ bool wxGenericValidator::TransferToWindow(void)
         wxSlider* pControl = (wxSlider*) m_validatorWindow;
         if (m_pInt)
         {
-	    pControl->SetValue(*m_pInt) ;
-	    return TRUE;
-	}
+            pControl->SetValue(*m_pInt) ;
+            return TRUE;
+        }
     } else
 #endif
 
-  // string controls
+    // string controls
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
     {
         wxButton* pControl = (wxButton*) m_validatorWindow;
-	if (m_pString)
-	{
-	    pControl->SetLabel(*m_pString) ;
-	    return TRUE;
-	}
+        if (m_pString)
+        {
+            pControl->SetLabel(*m_pString) ;
+            return TRUE;
+        }
     } else
 #if wxUSE_COMBOBOX
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
@@ -255,7 +255,7 @@ bool wxGenericValidator::TransferToWindow(void)
             pControl->SetLabel(*m_pString) ;
             return TRUE;
         }
-    } else 
+    } else
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
     {
         wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
@@ -272,15 +272,14 @@ bool wxGenericValidator::TransferToWindow(void)
             return TRUE;
         }
     } else
-#if wxUSE_CHECKLISTBOX
-#ifndef __WIN16__
+#if wxUSE_CHECKLISTBOX && !defined(__WIN16__)
   // array controls
   // NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
   // MUST come first:
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
   {
     wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
-	if (m_pArrayInt)
+        if (m_pArrayInt)
     {
       // clear all selections
       int i;
@@ -292,32 +291,31 @@ bool wxGenericValidator::TransferToWindow(void)
         pControl->Check(m_pArrayInt->Item(u));
       return TRUE;
     }
-	else
-		return FALSE;
+        else
+                return FALSE;
   } else
 #endif
-#endif
 #if wxUSE_LISTBOX
     if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
     {
         wxListBox* pControl = (wxListBox*) m_validatorWindow;
-	if (m_pArrayInt)
-	{
-	    // clear all selections
-	    int i;
-	    for (i = 0 ; i < pControl->Number(); ++i)
-	        pControl->Deselect(i);
-	    // select each item in our array
-	    unsigned u;
-	    for (u = 0; u < m_pArrayInt->Count(); ++u)
-	        pControl->SetSelection(m_pArrayInt->Item(u));
-	    return TRUE;
-	}
+        if (m_pArrayInt)
+        {
+            // clear all selections
+            int i;
+            for (i = 0 ; i < pControl->Number(); ++i)
+                pControl->Deselect(i);
+            // select each item in our array
+            unsigned u;
+            for (u = 0; u < m_pArrayInt->Count(); ++u)
+                pControl->SetSelection(m_pArrayInt->Item(u));
+            return TRUE;
+        }
     } else
 #endif
+        ;   // to match the last 'else' above
 
   // unrecognized control, or bad pointer
-    return FALSE;
   return FALSE;
 }
 
@@ -332,7 +330,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
   {
     wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
-	if (m_pBool)
+        if (m_pBool)
     {
       *m_pBool = pControl->GetValue() ;
       return TRUE;
@@ -343,7 +341,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
   {
     wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
-	if (m_pBool)
+        if (m_pBool)
     {
       *m_pBool = pControl->GetValue() ;
       return TRUE;
@@ -355,7 +353,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
   {
     wxGauge* pControl = (wxGauge*) m_validatorWindow;
-	if (m_pInt)
+        if (m_pInt)
     {
       *m_pInt = pControl->GetValue() ;
       return TRUE;
@@ -366,7 +364,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
   {
     wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
-	if (m_pInt)
+        if (m_pInt)
     {
       *m_pInt = pControl->GetSelection() ;
       return TRUE;
@@ -377,7 +375,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
   {
     wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
-	if (m_pInt)
+        if (m_pInt)
     {
       *m_pInt = pControl->GetThumbPosition() ;
       return TRUE;
@@ -399,7 +397,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
   {
     wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
-	if (m_pInt)
+        if (m_pInt)
     {
       *m_pInt = pControl->GetValue() ;
       return TRUE;
@@ -421,7 +419,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
   {
     wxButton* pControl = (wxButton*) m_validatorWindow;
-	if (m_pString)
+        if (m_pString)
     {
       *m_pString = pControl->GetLabel() ;
       return TRUE;
@@ -432,9 +430,9 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
   {
     wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
-	if (m_pString)
+    if (m_pInt)
     {
-      *m_pString = pControl->GetValue() ;
+      *m_pInt = pControl->GetSelection() ;
       return TRUE;
     }
     else if (m_pString)
@@ -448,7 +446,7 @@ bool wxGenericValidator::TransferFromWindow(void)
  if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
   {
     wxChoice* pControl = (wxChoice*) m_validatorWindow;
-	if (m_pInt)
+        if (m_pInt)
     {
       *m_pInt = pControl->GetSelection() ;
       return TRUE;
@@ -463,7 +461,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
   {
     wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
-	if (m_pString)
+        if (m_pString)
     {
       *m_pString = pControl->GetLabel() ;
       return TRUE;
@@ -472,7 +470,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
   {
     wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
-	if (m_pString)
+        if (m_pString)
     {
       *m_pString = pControl->GetValue() ;
       return TRUE;
@@ -491,7 +489,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
   {
     wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
-	if (m_pArrayInt)
+        if (m_pArrayInt)
     {
       // clear our array
       m_pArrayInt->Clear();
@@ -502,8 +500,8 @@ bool wxGenericValidator::TransferFromWindow(void)
           m_pArrayInt->Add(i);
       return TRUE;
     }
-	else
-	  return FALSE;
+        else
+          return FALSE;
   } else
 #endif
 #endif
@@ -511,7 +509,7 @@ bool wxGenericValidator::TransferFromWindow(void)
   if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
   {
     wxListBox* pControl = (wxListBox*) m_validatorWindow;
-	if (m_pArrayInt)
+    if (m_pArrayInt)
     {
       // clear our array
       m_pArrayInt->Clear();
@@ -532,7 +530,6 @@ bool wxGenericValidator::TransferFromWindow(void)
 
 /*
   Called by constructors to initialize ALL data members
-	Last change:  JAC  21 Jul 100    5:00 pm
 */
 void wxGenericValidator::Initialize()
 {
diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp
index ec8857fa4d..f2c529666a 100644
--- a/src/generic/choicdgg.cpp
+++ b/src/generic/choicdgg.cpp
@@ -45,10 +45,11 @@ wxString wxGetSingleChoice( const wxString& message, const wxString& caption, in
                             int WXUNUSED(width), int WXUNUSED(height) )
 {
     wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+    wxString choice;
     if ( dialog.ShowModal() == wxID_OK )
-        return dialog.GetStringSelection();
-    else
-        return wxT("");
+        choice = dialog.GetStringSelection();
+
+    return choice;
 }
 
 // Overloaded for backward compatibility
@@ -75,10 +76,13 @@ int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, in
                 int WXUNUSED(width), int WXUNUSED(height) )
 {
     wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+    int choice;
     if ( dialog.ShowModal() == wxID_OK )
-        return dialog.GetSelection();
+        choice = dialog.GetSelection();
     else
-        return -1;
+        choice = -1;
+
+    return choice;
 }
 
 // Overloaded for backward compatibility
@@ -102,10 +106,13 @@ void *wxGetSingleChoiceData( const wxString& message, const wxString& caption, i
                    int WXUNUSED(width), int WXUNUSED(height) )
 {
     wxSingleChoiceDialog dialog(parent, message, caption, n, choices, (char **)client_data);
+    void *data;
     if ( dialog.ShowModal() == wxID_OK )
-        return dialog.GetSelectionClientData();
+        data = dialog.GetSelectionClientData();
     else
-        return NULL;
+        data = NULL;
+
+    return data;
 }
 
 // Overloaded for backward compatibility
diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp
index 08d6fb0223..fc57d30483 100644
--- a/src/generic/dcpsg.cpp
+++ b/src/generic/dcpsg.cpp
@@ -1046,7 +1046,7 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
         sprintf( buffer, "%f setlinewidth\n", XLOG2DEVREL(1000 * m_pen.GetWidth()) / 1000.0f );
         #endif
         for (int i = 0; i < 100; i++)
-            if (buffer[i] == ',') buffer[i] = '.'; 
+            if (buffer[i] == ',') buffer[i] = '.';
         fprintf( m_pstream, buffer );
     }
 
@@ -1109,13 +1109,13 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
         double redPS = (double)(red) / 255.0;
         double bluePS = (double)(blue) / 255.0;
         double greenPS = (double)(green) / 255.0;
-        
+
         char buffer[100];
         sprintf( buffer,
                 "%.8f %.8f %.8f setrgbcolor\n",
                 redPS, greenPS, bluePS );
         for (int i = 0; i < 100; i++)
-            if (buffer[i] == ',') buffer[i] = '.'; 
+            if (buffer[i] == ',') buffer[i] = '.';
         fprintf( m_pstream, buffer );
 
         m_currentRed = red;
@@ -1162,7 +1162,7 @@ void wxPostScriptDC::SetBrush( const wxBrush& brush )
                 "%.8f %.8f %.8f setrgbcolor\n",
                 redPS, greenPS, bluePS );
         for (int i = 0; i < 100; i++)
-            if (buffer[i] == ',') buffer[i] = '.'; 
+            if (buffer[i] == ',') buffer[i] = '.';
         fprintf( m_pstream, buffer );
 
         m_currentRed = red;
@@ -1212,7 +1212,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
                 "%.8f %.8f %.8f setrgbcolor\n",
                 redPS, greenPS, bluePS );
             for (int i = 0; i < 100; i++)
-                if (buffer[i] == ',') buffer[i] = '.'; 
+                if (buffer[i] == ',') buffer[i] = '.';
             fprintf( m_pstream, buffer );
 
             m_currentRed = red;
@@ -1277,7 +1277,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
                 m_underlineThickness,
                 XLOG2DEV(x + text_w), YLOG2DEV(uy) );
         for (i = 0; i < 100; i++)
-            if (buffer[i] == ',') buffer[i] = '.'; 
+            if (buffer[i] == ',') buffer[i] = '.';
         fprintf( m_pstream, buffer );
     }
 
@@ -1328,7 +1328,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
                 "%.8f %.8f %.8f setrgbcolor\n",
                 redPS, greenPS, bluePS );
             for (int i = 0; i < 100; i++)
-                if (buffer[i] == ',') buffer[i] = '.'; 
+                if (buffer[i] == ',') buffer[i] = '.';
             fprintf( m_pstream, buffer );
 
             m_currentRed = red;
@@ -1343,13 +1343,13 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
 
     // FIXME only correct for 90 degrees
     fprintf(m_pstream, "%d %d moveto\n",
-            XLOG2DEV((wxCoord)(x + size)), YLOG2DEV(by) );
-            
+            XLOG2DEV((wxCoord)(x + size)), YLOG2DEV((wxCoord)by) );
+
     char buffer[100];
     sprintf(buffer, "%.8f rotate\n", angle);
     int i;
     for (i = 0; i < 100; i++)
-        if (buffer[i] == ',') buffer[i] = '.'; 
+        if (buffer[i] == ',') buffer[i] = '.';
     fprintf(m_pstream, buffer);
 
     /* I don't know how to write char to a stream, so I use a mini string */
@@ -1382,10 +1382,10 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
     }
 
     fprintf( m_pstream, ") show\n" );
-    
+
     sprintf( buffer, "%.8f rotate\n", -angle );
     for (i = 0; i < 100; i++)
-        if (buffer[i] == ',') buffer[i] = '.'; 
+        if (buffer[i] == ',') buffer[i] = '.';
     fprintf( m_pstream, buffer );
 
     if (m_font.GetUnderlined())
@@ -1406,7 +1406,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
                  m_underlineThickness,
                  XLOG2DEV(x + w), YLOG2DEV(uy) );
         for (i = 0; i < 100; i++)
-            if (buffer[i] == ',') buffer[i] = '.'; 
+            if (buffer[i] == ',') buffer[i] = '.';
         fprintf( m_pstream, buffer );
     }
 
@@ -1819,7 +1819,7 @@ void wxPostScriptDC::StartPage()
     for (int i = 0; i < 100; i++)
         if (buffer[i] == ',') buffer[i] = '.';
     fprintf( m_pstream, buffer );
-    
+
     fprintf( m_pstream, "%d %d translate\n", translate_x, translate_y );
 }
 
@@ -2141,9 +2141,9 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         // VS: dirty, but is there any better solution?
         double *pt;
         pt = (double*) &m_underlinePosition;
-        *pt = YLOG2DEVREL(UnderlinePosition * fontToUse->GetPointSize()) / 1000.0f;
+        *pt = YLOG2DEVREL((wxCoord)(UnderlinePosition * fontToUse->GetPointSize())) / 1000.0f;
         pt = (double*) &m_underlineThickness;
-        *pt = YLOG2DEVREL(UnderlineThickness * fontToUse->GetPointSize()) / 1000.0f;
+        *pt = YLOG2DEVREL((wxCoord)(UnderlineThickness * fontToUse->GetPointSize())) / 1000.0f;
 
     }
 
@@ -2510,7 +2510,8 @@ void wxPrintSetupData::operator=(const wxPrintData& data)
     SetPrinterCommand(data.GetPrinterCommand());
     SetPrintPreviewCommand(data.GetPreviewCommand());
     SetPrinterOptions(data.GetPrinterOptions());
-    SetPrinterTranslation(data.GetPrinterTranslateX(), data.GetPrinterTranslateY());
+    SetPrinterTranslation((wxCoord)data.GetPrinterTranslateX(),
+                          (wxCoord)data.GetPrinterTranslateY());
     SetPrinterScaling(data.GetPrinterScaleX(), data.GetPrinterScaleY());
     SetPrinterOrientation(data.GetOrientation());
     SetPrinterMode((int) data.GetPrintMode());
diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index d643c0ff7c..baed28017d 100644
--- a/src/generic/grid.cpp
+++ b/src/generic/grid.cpp
@@ -3825,8 +3825,9 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
             wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
             if (attrProvider) {
                 attrProvider->UpdateAttrRows( pos, -((int)numRows) );
-// ifdef'd out following patch from Paul Gammans
-#if 0
+// ifdef'd out following patch from Paul Gammans                
+#if 0                
+                // No need to touch column attributes, unless we
                 // removed _all_ rows, in this case, we remove
                 // all column attributes.
                 // I hate to do this here, but the
@@ -3961,7 +3962,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
             if (attrProvider) {
                 attrProvider->UpdateAttrCols( pos, -((int)numCols) );
 // ifdef'd out following patch from Paul Gammans                
-#if 0
+#if 0                
                 // No need to touch row attributes, unless we
                 // removed _all_ columns, in this case, we remove
                 // all row attributes.
@@ -5595,7 +5596,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
         HideCellEditControl();
         DisableCellEditControl();
 
-        if ( IsVisible( m_currentCellCoords, FALSE ) )  // zzz
+        if ( IsVisible( m_currentCellCoords, FALSE ) )
         {
             wxRect r;
             r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
@@ -6417,7 +6418,7 @@ void wxGrid::ShowCellEditControl()
     {
         if ( !IsVisible( m_currentCellCoords ) )
         {
-            m_cellEditCtrlEnabled = false;        
+            m_cellEditCtrlEnabled = FALSE;
             return;
         }
         else
diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp
index 3fc7d41a6a..607477e3eb 100644
--- a/src/generic/listctrl.cpp
+++ b/src/generic/listctrl.cpp
@@ -1297,12 +1297,12 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
 {
     // we want to work with logical coords
 #if wxUSE_GENERIC_LIST_EXTENSIONS
-    int x, y;
-    m_owner->CalcUnscrolledPosition(event.GetX(), event.GetY(), &x, &y);
+    int x;
+    m_owner->CalcUnscrolledPosition(event.GetX(), 0, &x, NULL);
 #else // !wxUSE_GENERIC_LIST_EXTENSIONS
     int x = event.GetX();
-    int y = event.GetY();
 #endif // wxUSE_GENERIC_LIST_EXTENSIONS
+    int y = event.GetY();
 
     if (m_isDragging)
     {
@@ -2880,7 +2880,7 @@ long wxListMainWindow::FindItem(long start, const wxString& str, bool WXUNUSED(p
     long pos = start;
     wxString tmp = str;
     if (pos < 0) pos = 0;
-    for (size_t i = pos; i < m_lines.GetCount(); i++)
+    for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
     {
         wxListLineData *line = &m_lines[i];
         wxString s = "";
@@ -2895,7 +2895,7 @@ long wxListMainWindow::FindItem(long start, long data)
 {
     long pos = start;
     if (pos < 0) pos = 0;
-    for (size_t i = pos; i < m_lines.GetCount(); i++)
+    for (size_t i = (size_t)pos; i < m_lines.GetCount(); i++)
     {
         wxListLineData *line = &m_lines[i];
         wxListItem item;
diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp
index fe859bb2ee..023caa971e 100644
--- a/src/gtk/combobox.cpp
+++ b/src/gtk/combobox.cpp
@@ -111,7 +111,11 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     m_widget = gtk_combo_new();
 
     // make it more useable
-    gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
+    gtk_combo_set_use_arrows_always( GTK_COMBO(m_widget), TRUE );
+    
+    // and case-sensitive
+    gtk_combo_set_case_sensitive( GTK_COMBO(m_widget), TRUE );
+
 
     GtkWidget *list = GTK_COMBO(m_widget)->list;
 
diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp
index cae82754f9..0cad4913f8 100644
--- a/src/gtk/dcclient.cpp
+++ b/src/gtk/dcclient.cpp
@@ -43,6 +43,10 @@
 #include "cross.xbm"
 #define  num_hatches 6
 
+#define IS_15_PIX_HATCH(s) ((s)==wxCROSSDIAG_HATCH || (s)==wxHORIZONTAL_HATCH || (s)==wxVERTICAL_HATCH)
+#define IS_16_PIX_HATCH(s) ((s)!=wxCROSSDIAG_HATCH && (s)!=wxHORIZONTAL_HATCH && (s)!=wxVERTICAL_HATCH)
+
+
 static GdkPixmap  *hatches[num_hatches];
 static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
 
@@ -491,6 +495,18 @@ void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
                 gdk_draw_arc( m_window, m_textGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -541,6 +557,18 @@ void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, start, end );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -624,6 +652,18 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
                 gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -681,8 +721,20 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
                                       m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
                 gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -762,8 +814,30 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -789,10 +863,10 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
 
         if (m_pen.GetStyle() != wxTRANSPARENT)
         {
-            gdk_draw_line( m_window, m_penGC, xx+rr, yy, xx+ww-rr, yy );
-            gdk_draw_line( m_window, m_penGC, xx+rr, yy+hh, xx+ww-rr, yy+hh );
-            gdk_draw_line( m_window, m_penGC, xx, yy+rr, xx, yy+hh-rr );
-            gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr, xx+ww, yy+hh-rr );
+            gdk_draw_line( m_window, m_penGC, xx+rr+1, yy, xx+ww-rr, yy );
+            gdk_draw_line( m_window, m_penGC, xx+rr+1, yy+hh, xx+ww-rr, yy+hh );
+            gdk_draw_line( m_window, m_penGC, xx, yy+rr+1, xx, yy+hh-rr );
+            gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr+1, xx+ww, yy+hh-rr );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, dd, dd, 90*64, 90*64 );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
@@ -829,8 +903,20 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
                                       m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp
index 1149f81f86..b3b73c34f5 100644
--- a/src/gtk/menu.cpp
+++ b/src/gtk/menu.cpp
@@ -567,7 +567,8 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
 
     wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
     event.SetEventObject( menu );
-    event.SetInt(id );
+    if (item->IsCheckable())
+        event.SetInt( item->IsChecked() );
 
 #if wxUSE_MENU_CALLBACK
     if (menu->GetCallback())
@@ -948,8 +949,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         // due to an apparent bug in GTK+, we have to use a static buffer here -
         // otherwise GTK+ 1.2.2 manages to override the memory we pass to it
         // somehow! (VZ)
-        static char s_accel[32]; // must be big enough for <control><alt><shift>F12
-        strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
+        static char s_accel[50]; // must be big enougg
+        wxString tmp( GetHotKey(*mitem) );
+        strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
         entry.accelerator = s_accel;
 #else // !wxUSE_ACCEL
         entry.accelerator = (char*) NULL;
@@ -1090,6 +1092,20 @@ static wxString GetHotKey( const wxMenuItem& item )
             case WXK_F12:
                 hotkey << wxT('F') << code - WXK_F1 + 1;
                 break;
+                
+                // GTK seems to use XStringToKeySym here
+            case WXK_NUMPAD_INSERT:
+                hotkey << wxT("KP_Insert" );
+                break;
+            case WXK_NUMPAD_DELETE:
+                hotkey << wxT("KP_Delete" );
+                break;
+            case WXK_INSERT:
+                hotkey << wxT("Insert" );
+                break;
+            case WXK_DELETE:
+                hotkey << wxT("Delete" );
+                break;
 
                 // if there are any other keys wxGetAccelFromString() may return,
                 // we should process them here
diff --git a/src/gtk/statline.cpp b/src/gtk/statline.cpp
index 60970765ed..4e8f0787cb 100644
--- a/src/gtk/statline.cpp
+++ b/src/gtk/statline.cpp
@@ -45,28 +45,28 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxStaticLine creation failed") );
-	return FALSE;
+        return FALSE;
     }
 
     if ( IsVertical() )
     {
         m_widget = gtk_vseparator_new();
-	if (size.x == -1)
-	{
-	    wxSize new_size( size );
-	    new_size.x = 4;
-	    SetSize( new_size );
-	}
+        if (size.x == -1)
+        {
+            wxSize new_size( size );
+            new_size.x = 4;
+            SetSize( new_size );
+        }
     }
     else
     {
         m_widget = gtk_hseparator_new();
-	if (size.y == -1)
-	{
-	    wxSize new_size( size );
-	    new_size.y = 4;
-	    SetSize( new_size );
-	}
+        if (size.y == -1)
+        {
+            wxSize new_size( size );
+            new_size.y = 4;
+            SetSize( new_size );
+        }
     }
 
     m_parent->DoAddChild( this );
diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp
index 92360ca742..29437adb90 100644
--- a/src/gtk/textctrl.cpp
+++ b/src/gtk/textctrl.cpp
@@ -98,6 +98,8 @@ END_EVENT_TABLE()
 wxTextCtrl::wxTextCtrl()
 {
     m_modified = FALSE;
+    m_text =
+    m_vScrollbar = (GtkWidget *)NULL;
 }
 
 wxTextCtrl::wxTextCtrl( wxWindow *parent,
diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c
index fa8fbbf5c3..b578c9288d 100644
--- a/src/gtk/win_gtk.c
+++ b/src/gtk/win_gtk.c
@@ -77,13 +77,13 @@ static void     gtk_pizza_adjust_allocations         (GtkPizza  *pizza,
                                                       gint       dy);
 
 
+/* unused */
+#if 0
 static void     gtk_pizza_expose_area        (GtkPizza       *pizza,
                                               gint            x,
                                               gint            y,
                                               gint            width,
                                               gint            height);
-/* unused */
-#if 0
 static void     gtk_pizza_adjustment_changed (GtkAdjustment  *adjustment,
                                               GtkPizza       *pizza);
 #endif
@@ -981,6 +981,8 @@ gtk_pizza_adjust_allocations (GtkPizza *pizza,
 
 /* Callbacks */
 
+/* unused */
+#if 0
 /* Send a synthetic expose event to the widget
  */
 static void
@@ -1006,6 +1008,7 @@ gtk_pizza_expose_area (GtkPizza    *pizza,
         gdk_window_unref (event.window);
     }
 }
+#endif /* unused */
 
 /* This function is used to find events to process while scrolling
  */
diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp
index fe859bb2ee..023caa971e 100644
--- a/src/gtk1/combobox.cpp
+++ b/src/gtk1/combobox.cpp
@@ -111,7 +111,11 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     m_widget = gtk_combo_new();
 
     // make it more useable
-    gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
+    gtk_combo_set_use_arrows_always( GTK_COMBO(m_widget), TRUE );
+    
+    // and case-sensitive
+    gtk_combo_set_case_sensitive( GTK_COMBO(m_widget), TRUE );
+
 
     GtkWidget *list = GTK_COMBO(m_widget)->list;
 
diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp
index cae82754f9..0cad4913f8 100644
--- a/src/gtk1/dcclient.cpp
+++ b/src/gtk1/dcclient.cpp
@@ -43,6 +43,10 @@
 #include "cross.xbm"
 #define  num_hatches 6
 
+#define IS_15_PIX_HATCH(s) ((s)==wxCROSSDIAG_HATCH || (s)==wxHORIZONTAL_HATCH || (s)==wxVERTICAL_HATCH)
+#define IS_16_PIX_HATCH(s) ((s)!=wxCROSSDIAG_HATCH && (s)!=wxHORIZONTAL_HATCH && (s)!=wxVERTICAL_HATCH)
+
+
 static GdkPixmap  *hatches[num_hatches];
 static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
 
@@ -491,6 +495,18 @@ void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
                 gdk_draw_arc( m_window, m_textGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -541,6 +557,18 @@ void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, start, end );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -624,6 +652,18 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
                 gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
             } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
             if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
@@ -681,8 +721,20 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
                                       m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
                 gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -762,8 +814,30 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
+                gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -789,10 +863,10 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
 
         if (m_pen.GetStyle() != wxTRANSPARENT)
         {
-            gdk_draw_line( m_window, m_penGC, xx+rr, yy, xx+ww-rr, yy );
-            gdk_draw_line( m_window, m_penGC, xx+rr, yy+hh, xx+ww-rr, yy+hh );
-            gdk_draw_line( m_window, m_penGC, xx, yy+rr, xx, yy+hh-rr );
-            gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr, xx+ww, yy+hh-rr );
+            gdk_draw_line( m_window, m_penGC, xx+rr+1, yy, xx+ww-rr, yy );
+            gdk_draw_line( m_window, m_penGC, xx+rr+1, yy+hh, xx+ww-rr, yy+hh );
+            gdk_draw_line( m_window, m_penGC, xx, yy+rr+1, xx, yy+hh-rr );
+            gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr+1, xx+ww, yy+hh-rr );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, dd, dd, 90*64, 90*64 );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
             gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
@@ -829,8 +903,20 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
                                       m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
                 gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
                 gdk_gc_set_ts_origin( m_textGC, 0, 0 );
-            }
-            else if (m_brush.GetStyle() == wxSTIPPLE)
+            } else
+            if (IS_15_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (IS_16_PIX_HATCH(m_brush.GetStyle()))
+            {
+                gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
+                gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
+                gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
+            } else
+            if (m_brush.GetStyle() == wxSTIPPLE)
             {
                 gdk_gc_set_ts_origin( m_brushGC,
                                       m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp
index 1149f81f86..b3b73c34f5 100644
--- a/src/gtk1/menu.cpp
+++ b/src/gtk1/menu.cpp
@@ -567,7 +567,8 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
 
     wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
     event.SetEventObject( menu );
-    event.SetInt(id );
+    if (item->IsCheckable())
+        event.SetInt( item->IsChecked() );
 
 #if wxUSE_MENU_CALLBACK
     if (menu->GetCallback())
@@ -948,8 +949,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
         // due to an apparent bug in GTK+, we have to use a static buffer here -
         // otherwise GTK+ 1.2.2 manages to override the memory we pass to it
         // somehow! (VZ)
-        static char s_accel[32]; // must be big enough for <control><alt><shift>F12
-        strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
+        static char s_accel[50]; // must be big enougg
+        wxString tmp( GetHotKey(*mitem) );
+        strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
         entry.accelerator = s_accel;
 #else // !wxUSE_ACCEL
         entry.accelerator = (char*) NULL;
@@ -1090,6 +1092,20 @@ static wxString GetHotKey( const wxMenuItem& item )
             case WXK_F12:
                 hotkey << wxT('F') << code - WXK_F1 + 1;
                 break;
+                
+                // GTK seems to use XStringToKeySym here
+            case WXK_NUMPAD_INSERT:
+                hotkey << wxT("KP_Insert" );
+                break;
+            case WXK_NUMPAD_DELETE:
+                hotkey << wxT("KP_Delete" );
+                break;
+            case WXK_INSERT:
+                hotkey << wxT("Insert" );
+                break;
+            case WXK_DELETE:
+                hotkey << wxT("Delete" );
+                break;
 
                 // if there are any other keys wxGetAccelFromString() may return,
                 // we should process them here
diff --git a/src/gtk1/statline.cpp b/src/gtk1/statline.cpp
index 60970765ed..4e8f0787cb 100644
--- a/src/gtk1/statline.cpp
+++ b/src/gtk1/statline.cpp
@@ -45,28 +45,28 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxStaticLine creation failed") );
-	return FALSE;
+        return FALSE;
     }
 
     if ( IsVertical() )
     {
         m_widget = gtk_vseparator_new();
-	if (size.x == -1)
-	{
-	    wxSize new_size( size );
-	    new_size.x = 4;
-	    SetSize( new_size );
-	}
+        if (size.x == -1)
+        {
+            wxSize new_size( size );
+            new_size.x = 4;
+            SetSize( new_size );
+        }
     }
     else
     {
         m_widget = gtk_hseparator_new();
-	if (size.y == -1)
-	{
-	    wxSize new_size( size );
-	    new_size.y = 4;
-	    SetSize( new_size );
-	}
+        if (size.y == -1)
+        {
+            wxSize new_size( size );
+            new_size.y = 4;
+            SetSize( new_size );
+        }
     }
 
     m_parent->DoAddChild( this );
diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp
index 92360ca742..29437adb90 100644
--- a/src/gtk1/textctrl.cpp
+++ b/src/gtk1/textctrl.cpp
@@ -98,6 +98,8 @@ END_EVENT_TABLE()
 wxTextCtrl::wxTextCtrl()
 {
     m_modified = FALSE;
+    m_text =
+    m_vScrollbar = (GtkWidget *)NULL;
 }
 
 wxTextCtrl::wxTextCtrl( wxWindow *parent,
diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c
index fa8fbbf5c3..b578c9288d 100644
--- a/src/gtk1/win_gtk.c
+++ b/src/gtk1/win_gtk.c
@@ -77,13 +77,13 @@ static void     gtk_pizza_adjust_allocations         (GtkPizza  *pizza,
                                                       gint       dy);
 
 
+/* unused */
+#if 0
 static void     gtk_pizza_expose_area        (GtkPizza       *pizza,
                                               gint            x,
                                               gint            y,
                                               gint            width,
                                               gint            height);
-/* unused */
-#if 0
 static void     gtk_pizza_adjustment_changed (GtkAdjustment  *adjustment,
                                               GtkPizza       *pizza);
 #endif
@@ -981,6 +981,8 @@ gtk_pizza_adjust_allocations (GtkPizza *pizza,
 
 /* Callbacks */
 
+/* unused */
+#if 0
 /* Send a synthetic expose event to the widget
  */
 static void
@@ -1006,6 +1008,7 @@ gtk_pizza_expose_area (GtkPizza    *pizza,
         gdk_window_unref (event.window);
     }
 }
+#endif /* unused */
 
 /* This function is used to find events to process while scrolling
  */
diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp
index 639ea7272a..874ccaf991 100644
--- a/src/html/htmlfilt.cpp
+++ b/src/html/htmlfilt.cpp
@@ -160,7 +160,7 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
         return s;
     }
 
-    else return doc;
+    return doc;
 }
 
 
diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp
index 82f3e09fce..df55a076eb 100644
--- a/src/html/htmprint.cpp
+++ b/src/html/htmprint.cpp
@@ -485,16 +485,14 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr
         delete preview;
         return FALSE;
     }
-    
-    else {
-        wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame, 
-                                                   m_Name + _(" Preview"), 
-                                                   wxPoint(100, 100), wxSize(650, 500));
-        frame -> Centre(wxBOTH);
-        frame -> Initialize();
-        frame -> Show(TRUE);
-        return TRUE;
-    }
+
+    wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame, 
+                                               m_Name + _(" Preview"), 
+                                               wxPoint(100, 100), wxSize(650, 500));
+    frame -> Centre(wxBOTH);
+    frame -> Initialize();
+    frame -> Show(TRUE);
+    return TRUE;
 }
 
 
@@ -508,11 +506,9 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout)
     {
         return FALSE;
     }
-    else
-    {
-        (*m_PrintData) = printer.GetPrintDialogData().GetPrintData();
-        return TRUE;
-    }
+
+    (*m_PrintData) = printer.GetPrintDialogData().GetPrintData();
+    return TRUE;
 }
 
 
diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp
index c81dfcdf52..cf25db47e6 100644
--- a/src/msw/filedlg.cpp
+++ b/src/msw/filedlg.cpp
@@ -151,13 +151,13 @@ wxString wxFileSelector(const wxChar *title,
         fileDialog.SetFilterIndex(filterFind);
     }
 
+    wxString filename;
     if ( fileDialog.ShowModal() == wxID_OK )
     {
-        wxStrcpy(wxBuffer, (const wxChar *)fileDialog.GetPath());
-        return wxBuffer;
+        filename = fileDialog.GetPath();
     }
-    else
-        return wxGetEmptyString();
+
+    return filename;
 }
 
 
@@ -172,17 +172,23 @@ wxString wxFileSelectorEx(const wxChar *title,
                        int       y)
 
 {
-    wxFileDialog fileDialog(parent, title ? title : wxT(""), defaultDir ? defaultDir : wxT(""),
-        defaultFileName ? defaultFileName : wxT(""), filter ? filter : wxT(""), flags, wxPoint(x, y));
+    wxFileDialog fileDialog(parent,
+                            title ? title : wxT(""),
+                            defaultDir ? defaultDir : wxT(""),
+                            defaultFileName ? defaultFileName : wxT(""),
+                            filter ? filter : wxT(""),
+                            flags, wxPoint(x, y));
 
+    wxString filename;
     if ( fileDialog.ShowModal() == wxID_OK )
     {
-        *defaultFilterIndex = fileDialog.GetFilterIndex();
-        wxStrcpy(wxBuffer, (const wxChar *)fileDialog.GetPath());
-        return wxBuffer;
+        if ( defaultFilterIndex )
+            *defaultFilterIndex = fileDialog.GetFilterIndex();
+
+        filename = fileDialog.GetPath();
     }
-    else
-        return wxGetEmptyString();
+
+    return filename;
 }
 
 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
diff --git a/src/msw/font.cpp b/src/msw/font.cpp
index 071d8b0bd9..472b616884 100644
--- a/src/msw/font.cpp
+++ b/src/msw/font.cpp
@@ -41,6 +41,13 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// the default font size in points
+static const int wxDEFAULT_FONT_SIZE = 12;
+
 // ----------------------------------------------------------------------------
 // wxFontRefData - the internal description of the font
 // ----------------------------------------------------------------------------
@@ -52,7 +59,7 @@ friend class WXDLLEXPORT wxFont;
 public:
     wxFontRefData()
     {
-        Init(12, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
+        Init(wxDEFAULT_FONT_SIZE, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
              "", wxFONTENCODING_DEFAULT);
     }
 
@@ -170,6 +177,12 @@ bool wxFont::Create(int pointSize,
                     wxFontEncoding encoding)
 {
     UnRef();
+
+    // wxDEFAULT is a valid value for the font size too so we must treat it
+    // specially here (otherwise the size would be 70 == wxDEFAULT value)
+    if ( pointSize == wxDEFAULT )
+        pointSize = wxDEFAULT_FONT_SIZE;
+
     m_refData = new wxFontRefData(pointSize, family, style, weight,
                                   underlined, faceName, encoding);
 
diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp
index 9a324b1042..5b46e6c7c6 100644
--- a/src/msw/frame.cpp
+++ b/src/msw/frame.cpp
@@ -620,10 +620,17 @@ bool wxFrame::MSWCreate(int id, wxWindow *parent, const wxChar *wclass, wxWindow
   // could be the culprit. But without it, you can get a lot of flicker.
 
   DWORD msflags = 0;
-  if ((style & wxCAPTION) == wxCAPTION)
-    msflags = WS_OVERLAPPED;
+  if ( style & wxCAPTION )
+  {
+    if ( style & wxFRAME_TOOL_WINDOW )
+        msflags |= WS_POPUPWINDOW;
+    else
+        msflags |= WS_OVERLAPPED;
+  }
   else
-    msflags = WS_POPUP;
+  {
+    msflags |= WS_POPUP;
+  }
 
   if (style & wxMINIMIZE_BOX)
     msflags |= WS_MINIMIZEBOX;
@@ -779,6 +786,16 @@ void wxFrame::IconizeChildFrames(bool bIconize)
     {
         wxWindow *win = node->GetData();
 
+        // iconizing the frames with this style under Win95 shell puts them at
+        // the bottom of the screen (as the MDI children) instead of making
+        // them appear in the taskbar because they are, by virtue of this
+        // style, not managed by the taskbar - instead leave Windows take care
+        // of them
+#ifdef __WIN95__
+        if ( win->GetWindowStyle() & wxFRAME_TOOL_WINDOW )
+            continue;
+#endif // Win95
+
         // the child MDI frames are a special case and should not be touched by
         // the parent frame - instead, they are managed by the user
         wxFrame *frame = wxDynamicCast(win, wxFrame);
diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c
index 47325c4320..60d2c3f417 100644
--- a/src/msw/gsocket.c
+++ b/src/msw/gsocket.c
@@ -97,7 +97,7 @@ GSocket *GSocket_new(void)
   if (!success)
   {
     free(socket);
-    return NULL;
+    socket = NULL;
   }
 
   return socket;
diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp
index 48bd3c57a2..f8a26cd036 100644
--- a/src/msw/imaglist.cpp
+++ b/src/msw/imaglist.cpp
@@ -64,7 +64,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)
 
 // returns the mask if it's valid, otherwise the bitmap mask and, if it's not
 // valid neither, a "solid" mask (no transparent zones at all)
-static wxBitmap GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask);
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask);
 
 // ============================================================================
 // implementation
@@ -144,8 +144,7 @@ bool wxImageList::GetSize(int WXUNUSED(index), int &width, int &height) const
 // 'bitmap' and 'mask'.
 int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
 {
-    wxBitmap bmpMask = GetMaskForImage(bitmap, mask);
-    HBITMAP hbmpMask = wxInvertMask(GetHbitmapOf(bmpMask));
+    HBITMAP hbmpMask = GetMaskForImage(bitmap, mask);
 
     int index = ImageList_Add(GetHImageList(), GetHbitmapOf(bitmap), hbmpMask);
     if ( index == -1 )
@@ -201,8 +200,7 @@ bool wxImageList::Replace(int index,
     wxFAIL_MSG(_T("ImageList_Replace not implemented in TWIN32"));
     return FALSE;
 #else
-    wxBitmap bmpMask = GetMaskForImage(bitmap, mask);
-    HBITMAP hbmpMask = wxInvertMask(GetHbitmapOf(bmpMask));
+    HBITMAP hbmpMask = GetMaskForImage(bitmap, mask);
 
     bool ok = ImageList_Replace(GetHImageList(), index,
                                 GetHbitmapOf(bitmap), hbmpMask) != 0;
@@ -314,36 +312,42 @@ bool wxImageList::Draw(int index,
 // helpers
 // ----------------------------------------------------------------------------
 
-static wxBitmap GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
 {
-    wxBitmap bmpMask;
+    HBITMAP hbmpMask;
+    wxBitmap *bmpMask = NULL;
 
     if ( mask.Ok() )
     {
-        bmpMask = mask;
+        hbmpMask = GetHbitmapOf(mask);
     }
     else
     {
         wxMask *pMask = bitmap.GetMask();
         if ( pMask )
         {
-            bmpMask.SetHBITMAP(pMask->GetMaskBitmap());
+            hbmpMask = (HBITMAP)pMask->GetMaskBitmap();
         }
-    }
+        else
+        {
+            // create a non transparent mask - apparently, this is needed under
+            // Win9x (it doesn't behave correctly if it's passed 0 mask)
+            bmpMask = new wxBitmap(bitmap.GetWidth(), bitmap.GetHeight(), 1);
 
-    if ( !bmpMask.Ok() )
-    {
-        // create a non transparent mask - apparently, this is needed under
-        // Win9x (it doesn't behave correctly if it's passed 0 mask)
-        bmpMask.Create(bitmap.GetWidth(), bitmap.GetHeight(), 1);
-
-        wxMemoryDC dcMem;
-        dcMem.SelectObject(bmpMask);
-        dcMem.Clear();
-        dcMem.SelectObject(wxNullBitmap);
+            wxMemoryDC dcMem;
+            dcMem.SelectObject(*bmpMask);
+            dcMem.Clear();
+            dcMem.SelectObject(wxNullBitmap);
+
+            hbmpMask = GetHbitmapOf(*bmpMask);
+        }
     }
 
-    return bmpMask;
+    // windows mask convention is opposite to the wxWindows one
+    HBITMAP hbmpMaskInv = wxInvertMask(hbmpMask);
+    delete bmpMask;
+
+    return hbmpMaskInv;
 }
 
 #endif // Win95
diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp
index acb319062b..cbe91c8878 100644
--- a/src/msw/listctrl.cpp
+++ b/src/msw/listctrl.cpp
@@ -1040,9 +1040,12 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial)
     findInfo.flags = LVFI_STRING;
     if ( partial )
         findInfo.flags |= LVFI_PARTIAL;
-    findInfo.psz = WXSTRINGCAST str;
+    findInfo.psz = str;
 
-    return ListView_FindItem(GetHwnd(), (int) start, & findInfo);
+    // ListView_FindItem() excludes the first item from search and to look
+    // through all the items you need to start from -1 which is unnatural and
+    // inconsitent with the generic version - so we adjust the index
+    return ListView_FindItem(GetHwnd(), (int) start - 1, &findInfo);
 }
 
 // Find an item whose data matches this data, starting from the item after 'start'
diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc
index 107fe650f1..066d62dc8f 100644
--- a/src/msw/makefile.vc
+++ b/src/msw/makefile.vc
@@ -27,16 +27,13 @@ LIBTARGET=$(WXLIB)
 DUMMYOBJ=$D\dummy.obj
 !endif
 
-# Please set these according to the settings in setup.h, so we can include
-# the appropriate libraries in wx.lib
-
-# This one overrides the others, to be consistent with the settings in setup.h
-MINIMAL_WXWINDOWS_SETUP=0
-
 PERIPH_LIBS=
 PERIPH_TARGET=
 PERIPH_CLEAN_TARGET=
 
+# Set to 0 if not using GLCanvas (only affects DLL build)
+USE_GLCANVAS=1
+
 # These are absolute paths, so that the compiler
 # generates correct __FILE__ symbols for debugging.
 # Otherwise you don't be able to double-click on a memory
diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp
index 7b551b6a4d..6d9792c740 100644
--- a/src/msw/mdi.cpp
+++ b/src/msw/mdi.cpp
@@ -63,8 +63,10 @@
 extern wxWindowList wxModelessWindows;      // from dialog.cpp
 extern wxMenu *wxCurrentPopupMenu;
 
-extern const wxChar *wxMDIFrameClassName;
+extern const wxChar *wxMDIFrameClassName;   // from app.cpp
 extern const wxChar *wxMDIChildFrameClassName;
+extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
+
 extern wxWindow *wxWndHook;                 // from window.cpp
 
 extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
@@ -221,8 +223,16 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
   if (style & wxCLIP_CHILDREN)
     msflags |= WS_CLIPCHILDREN;
 
-  wxWindow::MSWCreate(m_windowId, parent, wxMDIFrameClassName, this, title, x, y, width, height,
-         msflags);
+  if ( !wxWindow::MSWCreate(m_windowId,
+                            parent,
+                            wxMDIFrameClassName,
+                            this,
+                            title,
+                            x, y, width, height,
+                            msflags) )
+  {
+      return FALSE;
+  }
 
   wxModelessWindows.Append(this);
 
@@ -653,7 +663,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   MDICREATESTRUCT mcs;
 
-  mcs.szClass = wxMDIChildFrameClassName;
+  mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
+                    ? wxMDIChildFrameClassNameNoRedraw
+                    : wxMDIChildFrameClassName;
   mcs.szTitle = title;
   mcs.hOwner = wxGetInstance();
   if (x > -1)
@@ -696,12 +708,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   mcs.lParam = 0;
 
-  DWORD Return = SendMessage(GetWinHwnd(parent->GetClientWindow()),
-                             WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
-
-  //handle = (HWND)LOWORD(Return);
-  // Must be the DWORRD for WIN32. And in 16 bits, HIWORD=0 (says Microsoft)
-  m_hWnd = (WXHWND)Return;
+  m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
+                                 WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
 
   wxWndHook = NULL;
   wxAssociateWinWithHandle((HWND) GetHWND(), this);
@@ -917,15 +925,17 @@ bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
             return TRUE;
     }
 
+    bool processed;
     if (GetMenuBar() && GetMenuBar()->FindItem(id))
     {
-        ProcessCommand(id);
-        return TRUE;
+        processed = ProcessCommand(id);
     }
     else
-        return FALSE;
+    {
+        processed = FALSE;
+    }
 
-    return TRUE;
+    return processed;
 }
 
 bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp
index bf7b961b17..48b0b30706 100644
--- a/src/msw/menu.cpp
+++ b/src/msw/menu.cpp
@@ -434,7 +434,13 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id)
         wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
         event.SetEventObject( this );
         event.SetId( id );
-        event.SetInt( id );
+
+        // VZ: previosuly, the command int was set to id too which was quite
+        //     useless anyhow (as it could be retrieved using GetId()) and
+        //     uncompatible with wxGTK, so now we use the command int instead
+        //     to pass the checked status
+        event.SetInt(::GetMenuState(GetHmenu(), id, MF_BYCOMMAND) & MF_CHECKED);
+
         ProcessCommand(event);
     }
 
@@ -552,11 +558,9 @@ void wxMenuBar::Refresh()
 
 WXHMENU wxMenuBar::Create()
 {
-    if (m_hMenu != 0 )
+    if ( m_hMenu != 0 )
         return m_hMenu;
 
-    wxCHECK_MSG( !m_hMenu, TRUE, wxT("menubar already created") );
-
     m_hMenu = (WXHMENU)::CreateMenu();
 
     if ( !m_hMenu )
diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp
index 9ce9195d15..5eef575db7 100644
--- a/src/msw/nativdlg.cpp
+++ b/src/msw/nativdlg.cpp
@@ -282,11 +282,9 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
         win->SubclassWin(hWnd);
         win->AdoptAttributesFromHWND();
         win->SetupColours();
-
-        return win;
     }
-    else
-        return NULL;
+
+    return win;
 }
 
 // Make sure the window style (etc.) reflects the HWND style (roughly)
diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp
index 9ea5f213aa..a5c49e721b 100644
--- a/src/msw/ole/automtn.cpp
+++ b/src/msw/ole/automtn.cpp
@@ -435,13 +435,9 @@ WXIDISPATCH* wxAutomationObject::GetDispatchProperty(const wxString& property, i
 		{
 			return (WXIDISPATCH*) retVariant.GetVoidPtr();
 		}
-		else
-		{
-			return (WXIDISPATCH*) NULL;
-		}
 	}
-	else
-		return (WXIDISPATCH*) NULL;
+
+	return (WXIDISPATCH*) NULL;
 }
 
 // A way of initialising another wxAutomationObject with a dispatch object
diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp
index 08a5e32134..529c46dbd3 100644
--- a/src/msw/radiobox.cpp
+++ b/src/msw/radiobox.cpp
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        radiobox.cpp
-// Purpose:     wxRadioBox
+// Name:        msw/radiobox.cpp
+// Purpose:     wxRadioBox implementation
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
@@ -98,6 +98,7 @@ static WXFARPROC s_wndprocRadioBtn = (WXFARPROC)NULL;
 // wxRadioBox
 // ---------------------------------------------------------------------------
 
+// returns the number of rows
 int wxRadioBox::GetNumVer() const
 {
     if ( m_windowStyle & wxRA_SPECIFY_ROWS )
@@ -110,6 +111,7 @@ int wxRadioBox::GetNumVer() const
     }
 }
 
+// returns the number of columns
 int wxRadioBox::GetNumHor() const
 {
     if ( m_windowStyle & wxRA_SPECIFY_ROWS )
@@ -141,7 +143,14 @@ bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id)
             }
         }
 
-        wxASSERT_MSG( selectedButton != -1, wxT("click from alien button?") );
+        if ( selectedButton == -1 )
+        {
+            // just ignore it - due to a hack with WM_NCHITTEST handling in our
+            // wnd proc, we can receive dummy click messages when we click near
+            // the radiobox edge (this is ugly but Julian wouldn't let me get
+            // rid of this...)
+            return FALSE;
+        }
 
         if ( selectedButton != m_selectedButton )
         {
@@ -201,7 +210,7 @@ bool wxRadioBox::Create(wxWindow *parent,
     m_selectedButton = -1;
     m_noItems = 0;
 
-    m_majorDim =  majorDim == 0 ? n : majorDim;
+    m_majorDim = majorDim == 0 ? n : majorDim;
     m_noRowsOrCols = majorDim;
 
     // common initialization
@@ -366,6 +375,75 @@ wxString wxRadioBox::GetString(int N) const
     return wxGetWindowText(m_radioButtons[N]);
 }
 
+// ----------------------------------------------------------------------------
+// size calculations
+// ----------------------------------------------------------------------------
+
+wxSize wxRadioBox::GetMaxButtonSize() const
+{
+    // calculate the max button size
+    int widthMax = 0,
+        heightMax = 0;
+    for ( int i = 0 ; i < m_noItems; i++ )
+    {
+        int width, height;
+        if ( m_radioWidth[i] < 0 )
+        {
+            GetTextExtent(wxGetWindowText(m_radioButtons[i]), &width, &height);
+
+            // adjust the size to take into account the radio box itself
+            // FIXME this is totally bogus!
+            width += RADIO_SIZE;
+            height *= 3;
+            height /= 2;
+        }
+        else
+        {
+            width = m_radioWidth[i];
+            height = m_radioHeight[i];
+        }
+
+        if ( widthMax < width )
+            widthMax = width;
+        if ( heightMax < height )
+            heightMax = height;
+    }
+
+    return wxSize(widthMax, heightMax);
+}
+
+wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
+{
+    // the radiobox should be big enough for its buttons
+    int cx1, cy1;
+    wxGetCharSize(m_hWnd, &cx1, &cy1, &GetFont());
+
+    int extraHeight = cy1;
+
+#if defined(CTL3D) && !CTL3D
+    // Requires a bigger group box in plain Windows
+    extraHeight *= 3;
+    extraHeight /= 2;
+#endif
+
+    int height = GetNumVer() * sizeBtn.y + cy1/2 + extraHeight;
+    int width  = GetNumHor() * (sizeBtn.x + cx1) + cx1;
+
+    // and also wide enough for its label
+    int widthLabel;
+    GetTextExtent(GetTitle(), &widthLabel, NULL);
+    widthLabel += RADIO_SIZE; // FIXME this is bogus too
+    if ( widthLabel > width )
+        width = widthLabel;
+
+    return wxSize(width, height);
+}
+
+wxSize wxRadioBox::DoGetBestSize() const
+{
+    return GetTotalButtonSize(GetMaxButtonSize());
+}
+
 // Restored old code.
 void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 {
@@ -390,106 +468,89 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
     int x_offset = xx;
 #endif
 
-    int current_width, cyf;
-
-    int cx1,cy1;
+    int cx1, cy1;
     wxGetCharSize(m_hWnd, &cx1, &cy1, & GetFont());
 
     // Attempt to have a look coherent with other platforms: We compute the
     // biggest toggle dim, then we align all items according this value.
-    int maxWidth =  -1;
-    int maxHeight = -1;
+    wxSize maxSize = GetMaxButtonSize();
+    int maxWidth = maxSize.x,
+        maxHeight = maxSize.y;
 
-    int i;
-    for (i = 0 ; i < m_noItems; i++)
+    wxSize totSize = GetTotalButtonSize(maxSize);
+    int totWidth = totSize.x,
+        totHeight = totSize.y;
+
+    // only change our width/height if asked for
+    if ( width == -1 )
     {
-        int eachWidth;
-        int eachHeight;
-        if (m_radioWidth[i]<0)
-        {
-            // It's a labelled toggle
-            GetTextExtent(wxGetWindowText(m_radioButtons[i]),
-                          &current_width, &cyf);
-            eachWidth = (int)(current_width + RADIO_SIZE);
-            eachHeight = (int)((3*cyf)/2);
-        }
+        if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+            width = totWidth;
         else
-        {
-            eachWidth = m_radioWidth[i];
-            eachHeight = m_radioHeight[i];
-        }
-
-        if (maxWidth<eachWidth)
-            maxWidth = eachWidth;
-        if (maxHeight<eachHeight)
-            maxHeight = eachHeight;
+            width = widthOld;
     }
 
-    if (m_hWnd)
+    if ( height == -1 )
     {
-        int totWidth;
-        int totHeight;
-
-        int nbHor = GetNumHor(),
-            nbVer = GetNumVer();
-
-        // this formula works, but I don't know why.
-        // Please, be sure what you do if you modify it!!
-        if (m_radioWidth[0]<0)
-            totHeight = (nbVer * maxHeight) + cy1/2;
+        if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+            height = totHeight;
         else
-            totHeight = nbVer * (maxHeight+cy1/2);
-        totWidth  = nbHor * (maxWidth+cx1);
-
-        int extraHeight = cy1;
-
-#if defined(CTL3D) && !CTL3D
-        // Requires a bigger group box in plain Windows
-        extraHeight *= 3;
-        extraHeight /= 2;
-#endif
+            height = heightOld;
+    }
 
-        // only change our width/height if asked for
-        if ( width == -1 )
-        {
-            if ( sizeFlags & wxSIZE_AUTO_WIDTH )
-                width = totWidth + cx1;
-            else
-                width = widthOld;
-        }
+    ::MoveWindow(GetHwnd(), xx, yy, width, height, TRUE);
 
-        if ( height == -1 )
-        {
-            if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
-                height = totHeight + extraHeight;
-            else
-                height = heightOld;
-        }
+    // Now position all the buttons: the current button will be put at
+    // wxPoint(x_offset, y_offset) and the new row/column will start at
+    // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
+    // maxHeight) except for the buttons in the last column which should extend
+    // to the right border of radiobox and thus can be wider than this.
 
-        ::MoveWindow(GetHwnd(), xx, yy, width, height, TRUE);
+    // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
+    // left to right order and m_majorDim is the number of columns while
+    // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
+    // m_majorDim is the number of rows.
 
-        x_offset += cx1;
-        y_offset += cy1;
-    }
+    x_offset += cx1;
+    y_offset += cy1;
 
 #if defined(CTL3D) && (!CTL3D)
     y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
     // JACS 2/12/93. CTL3D draws group label quite high.
 #endif
+
     int startX = x_offset;
     int startY = y_offset;
 
-    for ( i = 0 ; i < m_noItems; i++)
+    for ( int i = 0; i < m_noItems; i++ )
     {
-        // Bidimensional radio adjustment
-        if (i&&((i%m_majorDim)==0)) // Why is this omitted for i = 0?
+        // the last button in the row may be wider than the other ones as the
+        // radiobox may be wider than the sum of the button widths (as it
+        // happens, for example, when the radiobox label is very long)
+        bool isLastInTheRow;
+        if ( m_windowStyle & wxRA_SPECIFY_COLS )
+        {
+            // item is the last in its row if it is a multiple of the number of
+            // columns or if it is just the last item
+            int n = i + 1;
+            isLastInTheRow = ((n % m_majorDim) == 0) || (n == m_noItems);
+        }
+        else // wxRA_SPECIFY_ROWS
         {
-            if (m_windowStyle & wxRA_VERTICAL)
+            // item is the last in the row if it is in the last columns
+            isLastInTheRow = i >= (m_noItems/m_majorDim)*m_majorDim;
+        }
+
+        // is this the start of new row/column?
+        if ( i && (i % m_majorDim == 0) )
+        {
+            if ( m_windowStyle & wxRA_SPECIFY_ROWS )
             {
+                // start of new column
                 y_offset = startY;
                 x_offset += maxWidth + cx1;
             }
-            else
+            else // start of new row
             {
                 x_offset = startX;
                 y_offset += maxHeight;
@@ -497,23 +558,19 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
                     y_offset += cy1/2;
             }
         }
-        int eachWidth;
-        int eachHeight;
-        if (m_radioWidth[i]<0)
+
+        int widthBtn;
+        if ( isLastInTheRow )
         {
-            // It's a labeled item
-            GetTextExtent(wxGetWindowText(m_radioButtons[i]),
-                          &current_width, &cyf);
-
-            // How do we find out radio button bitmap size!!
-            // By adjusting them carefully, manually :-)
-            eachWidth = (int)(current_width + RADIO_SIZE);
-            eachHeight = (int)((3*cyf)/2);
+            // make the button go to the end of radio box
+            widthBtn = startX + width - x_offset - 2*cx1;
+            if ( widthBtn < maxWidth )
+                widthBtn = maxWidth;
         }
         else
         {
-            eachWidth = m_radioWidth[i];
-            eachHeight = m_radioHeight[i];
+            // normal button, always of the same size
+            widthBtn = maxWidth;
         }
 
         // VZ: make all buttons of the same, maximal size - like this they
@@ -521,17 +578,22 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
         //     shown (otherwise they are not when the mouse pointer is in the
         //     radiobox part not belonging to any radiobutton)
         ::MoveWindow((HWND)m_radioButtons[i],
-                     x_offset, y_offset, maxWidth, maxHeight,
+                     x_offset, y_offset, widthBtn, maxHeight,
                      TRUE);
 
-        if (m_windowStyle & wxRA_SPECIFY_ROWS)
+        // where do we put the next button?
+        if ( m_windowStyle & wxRA_SPECIFY_ROWS )
         {
+            // below this one
             y_offset += maxHeight;
             if (m_radioWidth[0]>0)
                 y_offset += cy1/2;
         }
         else
-            x_offset += maxWidth + cx1;
+        {
+            // to the right of this one
+            x_offset += widthBtn + cx1;
+        }
     }
 }
 
@@ -866,25 +928,60 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
 
                 bool processed = TRUE;
 
+                bool horz = (radiobox->GetWindowStyle() & wxRA_SPECIFY_COLS) != 0;
+                int num = radiobox->Number(),
+                    rows = radiobox->GetNumVer(),
+                    cols = radiobox->GetNumHor();
+
                 int selOld = radiobox->GetSelection();
                 int selNew = selOld;
 
+                // wrapping will be handled below for the cases when we
+                // add/substract more than 1 but here otherwise as it's simpler
                 switch ( wParam )
                 {
                     case VK_UP:
-                        selNew--;
+                        if ( horz )
+                            selNew -= cols;
+                        else
+                        {
+                            if ( selNew )
+                                selNew--;
+                            else
+                                selNew = num - 1;
+                        }
                         break;
 
                     case VK_LEFT:
-                        selNew -= radiobox->GetNumVer();
+                        if ( horz )
+                        {
+                            if ( selNew )
+                                selNew--;
+                            else
+                                selNew = num - 1;
+                        }
+                        else
+                            selNew -= rows;
                         break;
 
                     case VK_DOWN:
-                        selNew++;
+                        if ( horz )
+                            selNew += cols;
+                        else
+                        {
+                            if ( ++selNew == num )
+                                selNew = 0;
+                        }
                         break;
 
                     case VK_RIGHT:
-                        selNew += radiobox->GetNumVer();
+                        if ( horz )
+                        {
+                            if ( ++selNew == num )
+                                selNew = 0;
+                        }
+                        else
+                            selNew += rows;
                         break;
 
                     default:
@@ -894,9 +991,28 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
                 if ( processed )
                 {
                     // ensure that selNew is in range [0..num)
-                    int num = radiobox->Number();
-                    selNew += num;
-                    selNew %= num;
+                    if ( selNew >= num )
+                    {
+                        selNew -= num;
+
+                        int dim = horz ? cols : rows;
+                        selNew += dim - 1;
+                        selNew %= dim;
+                    }
+                    else if ( selNew < 0 )
+                    {
+                        selNew += num;
+
+                        int dim = horz ? cols : rows;
+                        if ( selNew % dim == 0 )
+                        {
+                            selNew -= dim - 1;
+                        }
+                        else
+                        {
+                            selNew++;
+                        }
+                    }
 
                     if ( selNew != selOld )
                     {
diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp
index 6a10d9168d..a9a7705f60 100644
--- a/src/msw/radiobut.cpp
+++ b/src/msw/radiobut.cpp
@@ -39,6 +39,7 @@ bool wxRadioButton::MSWCommand(WXUINT param, WXWORD id)
   {
     wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId);
     event.SetEventObject( this );
+    event.SetInt( GetValue() );
     ProcessCommand(event);
     return TRUE;
   }
diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp
index cd87ce1fb5..5e05b92cdf 100644
--- a/src/msw/settings.cpp
+++ b/src/msw/settings.cpp
@@ -171,6 +171,5 @@ int wxSystemSettings::GetSystemMetric(int index)
         default:
             return 0;
     }
-    return 0;
 }
 
diff --git a/src/msw/version.rc b/src/msw/version.rc
index 9a1a536efd..eaca646963 100644
--- a/src/msw/version.rc
+++ b/src/msw/version.rc
@@ -9,15 +9,21 @@
 // Licence:     wxWindows license
 ///////////////////////////////////////////////////////////////////////////////
 
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,2,0,0
- PRODUCTVERSION 2,2,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef __WXDEBUG__
- FILEFLAGS 0x1L
+#include "wx/version.h"
+
+#ifdef _DEBUG
+    #define DLL_FLAGS 0x1L
+    #define DLL_SUFFIX "d"
 #else
- FILEFLAGS 0x0L
+    #define DLL_FLAGS 0x0L
+    #define DLL_SUFFIX ""
 #endif
+
+1 VERSIONINFO
+ FILEVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ PRODUCTVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS DLL_FLAGS
  FILEOS 0x40004L
  FILETYPE 0x2L
  FILESUBTYPE 0x0L
@@ -29,19 +35,15 @@ BEGIN
             VALUE "Comments", "wxWindows cross-platform GUI framework\0"
             VALUE "CompanyName", "wxWindows development team\0"
             VALUE "FileDescription", "wxWindows for MSW\0"
-            VALUE "FileVersion", "2, 2, 0, 0\0"
+            VALUE "FileVersion", "2.2.1\0"
             VALUE "InternalName", "wxMSW\0"
-            VALUE "LegalCopyright", "Copyright © 1993,2000 wxWindows development team\0"
+            VALUE "LegalCopyright", "Copyright © 1993, 2000 wxWindows development team\0"
             VALUE "LegalTrademarks", "\0"
-            VALUE "OriginalFilename", "wx220.dll\0"
+            VALUE "OriginalFilename", "wxmsw221" DLL_SUFFIX ".dll\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "wxMSW\0"
-            VALUE "ProductVersion", "2, 2, 0, 0\0"
+            VALUE "ProductName", "wxWindows\0"
+            VALUE "ProductVersion", "2.2.1\0"
             VALUE "SpecialBuild", "\0"
         END
     END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
 END
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index 6aa913b6b2..98979b0466 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -2766,11 +2766,9 @@ bool wxWindow::HandleSetCursor(WXHWND hWnd,
         // cursor set, stop here
         return TRUE;
     }
-    else
-    {
-        // pass up the window chain
-        return FALSE;
-    }
+
+    // pass up the window chain
+    return FALSE;
 }
 
 // ---------------------------------------------------------------------------
diff --git a/src/msw/xpmhand.cpp b/src/msw/xpmhand.cpp
index 1974d381f2..78459be100 100644
--- a/src/msw/xpmhand.cpp
+++ b/src/msw/xpmhand.cpp
@@ -67,7 +67,8 @@ static void XpmToBitmap(wxBitmap *bitmap,
     if (xmask)
     {
         wxMask *mask = new wxMask();
-        mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap));
+        mask->SetMaskBitmap((WXHBITMAP) wxInvertMask(xmask->bitmap,
+                                                     bm.bmWidth, bm.bmHeight));
         bitmap->SetMask(mask);
     }
 }
diff --git a/src/xpm/RdFToI.c b/src/xpm/RdFToI.c
index 89cdc4ec0f..eff47d3ef3 100644
--- a/src/xpm/RdFToI.c
+++ b/src/xpm/RdFToI.c
@@ -155,8 +155,9 @@ OpenReadFile(filename, mdata)
 #endif
 {
 #ifndef NO_ZPIPE
-    char *compressfile, buf[BUFSIZ];
+    char buf[BUFSIZ];
 # ifdef STAT_ZFILE
+    char *compressfile;
     struct stat status;
 # endif
 #endif
diff --git a/wxPython/.cvsignore b/wxPython/.cvsignore
index 75e75a190a..8886a1a7b1 100644
--- a/wxPython/.cvsignore
+++ b/wxPython/.cvsignore
@@ -1,2 +1,3 @@
 .emacs.desktop
 build.local
+update.log
diff --git a/wxPython/BUILD.txt b/wxPython/BUILD.txt
index 36366ccfeb..52a401e42f 100644
--- a/wxPython/BUILD.txt
+++ b/wxPython/BUILD.txt
@@ -90,9 +90,9 @@ below.)
    command, as well as to build.local for wxPython, (see below.)
 
 
-2. For either platform, you should be sure to set an environment
+2. For the win32 platform you should be sure to set an environment
    variable named WXWIN to be the path to the top of the wxWindows
-   tree.
+   source tree.
 
 
 3. If you are working from a copy of the code retrieved from CVS, then
@@ -106,6 +106,9 @@ below.)
 
    WXPSRCDIR = "~/MyStuff/wxPython-2.1.15/src"
 
+   If your wxPython sources are not under $WXWIN then you'll need to
+   adjust the remainder of these instructions accordingly.
+
 
 4. At this point you may want to make an alias, symlink, script,
    batch file, or whatever on the PATH that invokes
@@ -116,7 +119,7 @@ below.)
    python %WXWIN%/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6
 
 
-5. Change into the $(WXWIN)/utils/wxPython/src directory.
+5. Change into the $(WXWIN)/wxPython/src directory.
 
 
 6. If you don't use SWIG, or don't have a new enough version
@@ -153,7 +156,7 @@ below.)
    again.
 
 
-9. Change to the $WXWIN/utils/wxPython/demo directory.
+9. Change to the $WXWIN/wxPython/demo directory.
 
 
 10. Try executing the demo program.  For example:
@@ -163,4 +166,3 @@ below.)
     To run it without requiring a console on win32, you can use the
     pythonw.exe version of Python either from the command line or from
     a shortcut.
-
diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt
index 83608f35c0..a64317d078 100644
--- a/wxPython/CHANGES.txt
+++ b/wxPython/CHANGES.txt
@@ -2,6 +2,13 @@ CHANGES.txt for wxPython
 
 ----------------------------------------------------------------------
 
+New in 2.2.1
+------------
+
+Various tweaks, fixes, missing methods, etc.
+
+
+
 New in 2.2.0
 ------------
 
diff --git a/wxPython/demo/About.py b/wxPython/demo/About.py
index 7e9827675e..ab36a5428a 100644
--- a/wxPython/demo/About.py
+++ b/wxPython/demo/About.py
@@ -25,7 +25,7 @@ sit back and enjoy.  Be sure to take a peek at the source code for each
 demo item so you can learn how to use the classes yourself.</p>
 
 <p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br>
-<b>Total Control Software</b>, Copyright (c) 1997-1999.</p>
+<b>Total Control Software</b>, Copyright (c) 1997-2000.</p>
 
 <p>
 <font size="-1">Please see <i>license.txt</i> for licensing information.</font>
diff --git a/wxPython/demo/GridSimple.py b/wxPython/demo/GridSimple.py
index 5f23c26dc8..f816e7a3f4 100644
--- a/wxPython/demo/GridSimple.py
+++ b/wxPython/demo/GridSimple.py
@@ -30,6 +30,9 @@ class SimpleGrid(wxGrid):
         # you can set cell attributes for the whole row (or column)
         self.SetRowAttr(5, attr)
 
+        self.SetColLabelValue(0, "Custom")
+        self.SetColLabelValue(1, "column")
+        self.SetColLabelValue(2, "labels")
 
         # test all the events
         EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py
index 10ed61edd0..6d5a116d18 100644
--- a/wxPython/demo/Main.py
+++ b/wxPython/demo/Main.py
@@ -70,6 +70,7 @@ class wxPythonDemo(wxFrame):
                          style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
 
         self.cwd = os.getcwd()
+        self.curOverview = ""
 
         if wxPlatform == '__WXMSW__':
             self.icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO)
diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py
index 8c9d2713ed..e018d18e10 100644
--- a/wxPython/demo/wxScrolledWindow.py
+++ b/wxPython/demo/wxScrolledWindow.py
@@ -100,7 +100,7 @@ class MyCanvas(wxScrolledWindow):
         self.x, self.y = self.ConvertEventCoords(event)
 
     def ConvertEventCoords(self, event):
-        xView, yView = self.ViewStart()
+        xView, yView = self.GetViewStart()
         xDelta, yDelta = self.GetScrollPixelsPerUnit()
         return (event.GetX() + (xView * xDelta),
                 event.GetY() + (yView * yDelta))
diff --git a/wxPython/distrib/autobuild.py b/wxPython/distrib/autobuild.py
index e6a303fbab..706f00dc1b 100755
--- a/wxPython/distrib/autobuild.py
+++ b/wxPython/distrib/autobuild.py
@@ -7,8 +7,8 @@ cwd = os.getcwd()
 
 logfile = 'c:\\temp\\autobuild.log'
 WXDIR   = os.environ['WXWIN']
-dllVer  = '21_16'
-wxpVer  = '2.1.16'
+dllVer  = '22_0'
+wxpVer  = '2.2.0'
 dateSt  = time.strftime("%Y%m%d", time.localtime(time.time()))
 
 base = os.path.split(sys.argv[0])[0]
diff --git a/wxPython/distrib/build.py b/wxPython/distrib/build.py
index d23a664a1a..3e64e9f736 100755
--- a/wxPython/distrib/build.py
+++ b/wxPython/distrib/build.py
@@ -120,8 +120,8 @@ import sys, os, string, getopt
 # This is really the wxPython version number, and will be placed in the
 # Makefiles for use with the distribution related targets.
 
-major_version = '2.1'
-build_version = '16'
+major_version = '2.2'
+build_version = '0'
 
 __version__ = major_version + '.' + build_version
 
diff --git a/wxPython/distrib/wxPython.WSM b/wxPython/distrib/wxPython.WSM
index 26e9687feac63bb918b3eabe0b7e9071e4649fc6..863771d4a9ea2aa92fc7dfa0a8f1dc19ce4f7761 100644
GIT binary patch
literal 33
mcmWF!_BGpQ#K6GFz^GZe<JS*YhC|9s3?RT5TCS4l%K!kFrU)|t

literal 33
mcmWF!_BFFNVqjooIHNIPW9AlDhCj+o3?RT5TCS4l%K!k8@CWw*

diff --git a/wxPython/distrib/wxPython.spec b/wxPython/distrib/wxPython.spec
index 7cdbfa9766..578e779695 100644
--- a/wxPython/distrib/wxPython.spec
+++ b/wxPython/distrib/wxPython.spec
@@ -1,6 +1,6 @@
 %define pref /usr
-%define ver 2.1.16
-%define rpmver 1
+%define ver 2.2.0
+%define rpmver 0
 
 Summary: Cross platform GUI toolkit for use with the Python language.
 Name: wxPython
diff --git a/wxPython/distrib/wxPython.wse b/wxPython/distrib/wxPython.wse
index d12d329375..0d82dd645c 100644
--- a/wxPython/distrib/wxPython.wse
+++ b/wxPython/distrib/wxPython.wse
@@ -1,7 +1,7 @@
 Document Type: WSE
 item: Global
   Version=6.01
-  Title=wxPython 2.1 Installation
+  Title=wxPython 2.2 Installation
   Flags=10010111
   Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
   Japanese Font Name=MS Gothic
@@ -17,7 +17,7 @@ item: Global
   Patch Flags=0000000000001001
   Patch Threshold=85
   Patch Memory=4000
-  EXE Filename=wxPython-2.1.16.exe
+  EXE Filename=wxPython-2.2.0.exe
   FTP Cluster Size=20
   Per-User Version ID=1
   Dialogs Version=6
@@ -55,12 +55,12 @@ item: End Block
 end
 item: Set Variable
   Variable=APPTITLE
-  Value=wxPython 2.1
+  Value=wxPython 2.2
   Flags=10000000
 end
 item: Set Variable
   Variable=GROUP
-  Value=wxPython 2.1
+  Value=wxPython 2.2
   Flags=10000000
 end
 item: Set Variable
@@ -819,8 +819,8 @@ item: Install File
   Flags=0000001010000011
 end
 item: Install File
-  Source=c:\projects\wx\lib\wx21_16.dll
-  Destination=%SYS%\wx21_16.dll
+  Source=c:\projects\wx\lib\wx22_0.dll
+  Destination=%SYS%\wx22_0.dll
   Flags=0000001010010010
 end
 item: Install File
diff --git a/wxPython/src/__version__.py b/wxPython/src/__version__.py
index d1f4e8a4f6..2ca00768cd 100644
--- a/wxPython/src/__version__.py
+++ b/wxPython/src/__version__.py
@@ -1 +1 @@
-ver = '2.1.16'
+ver = '2.2.0'
diff --git a/wxPython/src/clip_dnd.i b/wxPython/src/clip_dnd.i
index a9ff1f6f94..8feb9e8786 100644
--- a/wxPython/src/clip_dnd.i
+++ b/wxPython/src/clip_dnd.i
@@ -317,8 +317,9 @@ public:
             return list;
         }
     }
-
-    //void AddFile(const wxString &filename);
+#ifdef __WXMSW__
+    void AddFile(const wxString &filename);
+#endif
 };
 
 
diff --git a/wxPython/src/events.i b/wxPython/src/events.i
index 6ca6f66c18..d0c6713c0b 100644
--- a/wxPython/src/events.i
+++ b/wxPython/src/events.i
@@ -75,7 +75,8 @@ class wxCommandEvent : public wxEvent {
 public:
     wxCommandEvent(int commandEventType = 0, int id = 0);
 
-    bool Checked();
+    bool IsChecked();
+    %name(Checked)bool IsChecked();
     long GetExtraLong();
     int GetInt();
     int GetSelection();
diff --git a/wxPython/src/gtk/events.cpp b/wxPython/src/gtk/events.cpp
index 6f136bae90..32334162a2 100644
--- a/wxPython/src/gtk/events.cpp
+++ b/wxPython/src/gtk/events.cpp
@@ -764,8 +764,8 @@ static PyObject *_wrap_new_wxCommandEvent(PyObject *self, PyObject *args, PyObje
     return _resultobj;
 }
 
-#define wxCommandEvent_Checked(_swigobj)  (_swigobj->Checked())
-static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxCommandEvent_IsChecked(_swigobj)  (_swigobj->IsChecked())
+static PyObject *_wrap_wxCommandEvent_IsChecked(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     bool  _result;
     wxCommandEvent * _arg0;
@@ -773,18 +773,18 @@ static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, Py
     char *_kwnames[] = { "self", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_Checked",_kwnames,&_argo0)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_IsChecked",_kwnames,&_argo0)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
         else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_Checked. Expected _wxCommandEvent_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_IsChecked. Expected _wxCommandEvent_p.");
         return NULL;
         }
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxCommandEvent_Checked(_arg0);
+        _result = (bool )wxCommandEvent_IsChecked(_arg0);
 
     wxPy_END_ALLOW_THREADS;
 }    _resultobj = Py_BuildValue("i",_result);
@@ -5214,7 +5214,8 @@ static PyMethodDef eventscMethods[] = {
 	 { "wxCommandEvent_GetSelection", (PyCFunction) _wrap_wxCommandEvent_GetSelection, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCommandEvent_GetInt", (PyCFunction) _wrap_wxCommandEvent_GetInt, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCommandEvent_GetExtraLong", (PyCFunction) _wrap_wxCommandEvent_GetExtraLong, METH_VARARGS | METH_KEYWORDS },
-	 { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_Checked, METH_VARARGS | METH_KEYWORDS },
+	 { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
+	 { "wxCommandEvent_IsChecked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxCommandEvent", (PyCFunction) _wrap_new_wxCommandEvent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCloseEvent_SetCanVeto", (PyCFunction) _wrap_wxCloseEvent_SetCanVeto, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCloseEvent_GetVeto", (PyCFunction) _wrap_wxCloseEvent_GetVeto, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/gtk/events.py b/wxPython/src/gtk/events.py
index e5ca31ceb0..bea61f2861 100644
--- a/wxPython/src/gtk/events.py
+++ b/wxPython/src/gtk/events.py
@@ -105,6 +105,9 @@ class wxCommandEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def IsChecked(self, *_args, **_kwargs):
+        val = apply(eventsc.wxCommandEvent_IsChecked,(self,) + _args, _kwargs)
+        return val
     def Checked(self, *_args, **_kwargs):
         val = apply(eventsc.wxCommandEvent_Checked,(self,) + _args, _kwargs)
         return val
diff --git a/wxPython/src/gtk/mdi.cpp b/wxPython/src/gtk/mdi.cpp
index d1ce26ac04..0e8fb7a797 100644
--- a/wxPython/src/gtk/mdi.cpp
+++ b/wxPython/src/gtk/mdi.cpp
@@ -703,6 +703,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_class_wxCustomDataObject","_wxCustomDataObject",0},
+    { "_wxSpinCtrl","_class_wxSpinCtrl",0},
     { "_class_wxRegionIterator","_wxRegionIterator",0},
     { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0},
     { "_class_wxMenuBar","_wxMenuBar",0},
@@ -791,6 +792,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPoint","_class_wxPoint",0},
     { "_class_wxButton","_wxButton",0},
     { "_wxRadioBox","_class_wxRadioBox",0},
+    { "_class_wxSpinCtrl","_wxSpinCtrl",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
diff --git a/wxPython/src/gtk/printfw.cpp b/wxPython/src/gtk/printfw.cpp
index f5c1ce43a3..5fda7ca28d 100644
--- a/wxPython/src/gtk/printfw.cpp
+++ b/wxPython/src/gtk/printfw.cpp
@@ -1552,13 +1552,12 @@ static PyObject *_wrap_wxPageSetupDialogData_SetMinMarginBottomRight(PyObject *s
 static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxPageSetupDialogData * _arg0;
-    wxPaperSize * _arg1;
+    wxPaperSize  _arg1;
     PyObject * _argo0 = 0;
-    PyObject * _argo1 = 0;
     char *_kwnames[] = { "self","id", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_argo1)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_arg1)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1567,16 +1566,9 @@ static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject
         return NULL;
         }
     }
-    if (_argo1) {
-        if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPaperSize_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPageSetupDialogData_SetPaperId. Expected _wxPaperSize_p.");
-        return NULL;
-        }
-    }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxPageSetupDialogData_SetPaperId(_arg0,*_arg1);
+        wxPageSetupDialogData_SetPaperId(_arg0,_arg1);
 
     wxPy_END_ALLOW_THREADS;
 }    Py_INCREF(Py_None);
@@ -4366,6 +4358,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_class_wxCustomDataObject","_wxCustomDataObject",0},
+    { "_wxSpinCtrl","_class_wxSpinCtrl",0},
     { "_wxFontData","_class_wxFontData",0},
     { "_class_wxRegionIterator","_wxRegionIterator",0},
     { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0},
@@ -4474,6 +4467,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPoint","_class_wxPoint",0},
     { "_class_wxButton","_wxButton",0},
     { "_wxRadioBox","_class_wxRadioBox",0},
+    { "_class_wxSpinCtrl","_wxSpinCtrl",0},
     { "_class_wxFontData","_wxFontData",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
diff --git a/wxPython/src/gtk/windows.cpp b/wxPython/src/gtk/windows.cpp
index dc72e45fee..acf0b200c8 100644
--- a/wxPython/src/gtk/windows.cpp
+++ b/wxPython/src/gtk/windows.cpp
@@ -1050,6 +1050,62 @@ static PyObject *_wrap_wxWindow_CenterOnParent(PyObject *self, PyObject *args, P
     return _resultobj;
 }
 
+#define wxWindow_CentreOnScreen(_swigobj,_swigarg0)  (_swigobj->CentreOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CentreOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    int  _arg1 = (int ) wxBOTH;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self","direction", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CentreOnScreen",_kwnames,&_argo0,&_arg1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CentreOnScreen. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxWindow_CentreOnScreen(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+#define wxWindow_CenterOnScreen(_swigobj,_swigarg0)  (_swigobj->CenterOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CenterOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    int  _arg1 = (int ) wxBOTH;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self","direction", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CenterOnScreen",_kwnames,&_argo0,&_arg1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CenterOnScreen. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxWindow_CenterOnScreen(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 #define wxWindow_ClientToScreenXY(_swigobj,_swigarg0,_swigarg1)  (_swigobj->ClientToScreen(_swigarg0,_swigarg1))
 static PyObject *_wrap_wxWindow_ClientToScreenXY(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -9135,6 +9191,8 @@ static PyMethodDef windowscMethods[] = {
 	 { "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_ClientToScreen", (PyCFunction) _wrap_wxWindow_ClientToScreen, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_ClientToScreenXY", (PyCFunction) _wrap_wxWindow_ClientToScreenXY, METH_VARARGS | METH_KEYWORDS },
+	 { "wxWindow_CenterOnScreen", (PyCFunction) _wrap_wxWindow_CenterOnScreen, METH_VARARGS | METH_KEYWORDS },
+	 { "wxWindow_CentreOnScreen", (PyCFunction) _wrap_wxWindow_CentreOnScreen, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_CenterOnParent", (PyCFunction) _wrap_wxWindow_CenterOnParent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_CentreOnParent", (PyCFunction) _wrap_wxWindow_CentreOnParent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_Centre", (PyCFunction) _wrap_wxWindow_Centre, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py
index 3a5d0580af..935946452f 100644
--- a/wxPython/src/gtk/windows.py
+++ b/wxPython/src/gtk/windows.py
@@ -139,6 +139,12 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def CenterOnParent(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_CenterOnParent,(self,) + _args, _kwargs)
         return val
+    def CentreOnScreen(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_CentreOnScreen,(self,) + _args, _kwargs)
+        return val
+    def CenterOnScreen(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_CenterOnScreen,(self,) + _args, _kwargs)
+        return val
     def ClientToScreenXY(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_ClientToScreenXY,(self,) + _args, _kwargs)
         return val
diff --git a/wxPython/src/mdi.i b/wxPython/src/mdi.i
index 6fc5ed554a..7d68b700d0 100644
--- a/wxPython/src/mdi.i
+++ b/wxPython/src/mdi.i
@@ -55,7 +55,10 @@ public:
     // TODO:  This isn't handled by the standard event-table system...
     //wxMDIClientWindow* OnCreateClient();
 
+
 #ifdef __WXMSW__
+    wxMenu* GetWindowMenu();
+    void SetWindowMenu(wxMenu* menu);
     void SetToolBar(wxToolBar* toolbar);
 #endif
     void Tile();
diff --git a/wxPython/src/msw/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp
index 4ff3c2d667..abf56480c1 100644
--- a/wxPython/src/msw/clip_dnd.cpp
+++ b/wxPython/src/msw/clip_dnd.cpp
@@ -1679,6 +1679,46 @@ static PyObject *_wrap_wxFileDataObject_GetFilenames(PyObject *self, PyObject *a
     return _resultobj;
 }
 
+#define wxFileDataObject_AddFile(_swigobj,_swigarg0)  (_swigobj->AddFile(_swigarg0))
+static PyObject *_wrap_wxFileDataObject_AddFile(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxFileDataObject * _arg0;
+    wxString * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _obj1 = 0;
+    char *_kwnames[] = { "self","filename", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFileDataObject_AddFile",_kwnames,&_argo0,&_obj1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFileDataObject_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFileDataObject_AddFile. Expected _wxFileDataObject_p.");
+        return NULL;
+        }
+    }
+{
+    if (!PyString_Check(_obj1)) {
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+        return NULL;
+    }
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
+}
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFileDataObject_AddFile(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+{
+    if (_obj1)
+        delete _arg1;
+}
+    return _resultobj;
+}
+
 static void *SwigwxCustomDataObjectTowxDataObjectSimple(void *ptr) {
     wxCustomDataObject *src;
     wxDataObjectSimple *dest;
@@ -3297,6 +3337,7 @@ static PyMethodDef clip_dndcMethods[] = {
 	 { "wxCustomDataObject_SetData", (PyCFunction) _wrap_wxCustomDataObject_SetData, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCustomDataObject_TakeData", (PyCFunction) _wrap_wxCustomDataObject_TakeData, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxCustomDataObject", (PyCFunction) _wrap_new_wxCustomDataObject, METH_VARARGS | METH_KEYWORDS },
+	 { "wxFileDataObject_AddFile", (PyCFunction) _wrap_wxFileDataObject_AddFile, METH_VARARGS | METH_KEYWORDS },
 	 { "wxFileDataObject_GetFilenames", (PyCFunction) _wrap_wxFileDataObject_GetFilenames, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxFileDataObject", (PyCFunction) _wrap_new_wxFileDataObject, METH_VARARGS | METH_KEYWORDS },
 	 { "wxPyBitmapDataObject__setSelf", (PyCFunction) _wrap_wxPyBitmapDataObject__setSelf, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/msw/clip_dnd.py b/wxPython/src/msw/clip_dnd.py
index 3e9416a13d..8be9ceb3a4 100644
--- a/wxPython/src/msw/clip_dnd.py
+++ b/wxPython/src/msw/clip_dnd.py
@@ -219,6 +219,9 @@ class wxFileDataObjectPtr(wxDataObjectSimplePtr):
     def GetFilenames(self, *_args, **_kwargs):
         val = apply(clip_dndc.wxFileDataObject_GetFilenames,(self,) + _args, _kwargs)
         return val
+    def AddFile(self, *_args, **_kwargs):
+        val = apply(clip_dndc.wxFileDataObject_AddFile,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxFileDataObject instance at %s>" % (self.this,)
 class wxFileDataObject(wxFileDataObjectPtr):
diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp
index 55ff3f82d4..fc50c1c4e4 100644
--- a/wxPython/src/msw/events.cpp
+++ b/wxPython/src/msw/events.cpp
@@ -764,8 +764,8 @@ static PyObject *_wrap_new_wxCommandEvent(PyObject *self, PyObject *args, PyObje
     return _resultobj;
 }
 
-#define wxCommandEvent_Checked(_swigobj)  (_swigobj->Checked())
-static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxCommandEvent_IsChecked(_swigobj)  (_swigobj->IsChecked())
+static PyObject *_wrap_wxCommandEvent_IsChecked(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     bool  _result;
     wxCommandEvent * _arg0;
@@ -773,18 +773,18 @@ static PyObject *_wrap_wxCommandEvent_Checked(PyObject *self, PyObject *args, Py
     char *_kwnames[] = { "self", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_Checked",_kwnames,&_argo0)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_IsChecked",_kwnames,&_argo0)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
         else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_Checked. Expected _wxCommandEvent_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_IsChecked. Expected _wxCommandEvent_p.");
         return NULL;
         }
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxCommandEvent_Checked(_arg0);
+        _result = (bool )wxCommandEvent_IsChecked(_arg0);
 
     wxPy_END_ALLOW_THREADS;
 }    _resultobj = Py_BuildValue("i",_result);
@@ -5214,7 +5214,8 @@ static PyMethodDef eventscMethods[] = {
 	 { "wxCommandEvent_GetSelection", (PyCFunction) _wrap_wxCommandEvent_GetSelection, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCommandEvent_GetInt", (PyCFunction) _wrap_wxCommandEvent_GetInt, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCommandEvent_GetExtraLong", (PyCFunction) _wrap_wxCommandEvent_GetExtraLong, METH_VARARGS | METH_KEYWORDS },
-	 { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_Checked, METH_VARARGS | METH_KEYWORDS },
+	 { "wxCommandEvent_Checked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
+	 { "wxCommandEvent_IsChecked", (PyCFunction) _wrap_wxCommandEvent_IsChecked, METH_VARARGS | METH_KEYWORDS },
 	 { "new_wxCommandEvent", (PyCFunction) _wrap_new_wxCommandEvent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCloseEvent_SetCanVeto", (PyCFunction) _wrap_wxCloseEvent_SetCanVeto, METH_VARARGS | METH_KEYWORDS },
 	 { "wxCloseEvent_GetVeto", (PyCFunction) _wrap_wxCloseEvent_GetVeto, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/msw/events.py b/wxPython/src/msw/events.py
index e5ca31ceb0..bea61f2861 100644
--- a/wxPython/src/msw/events.py
+++ b/wxPython/src/msw/events.py
@@ -105,6 +105,9 @@ class wxCommandEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def IsChecked(self, *_args, **_kwargs):
+        val = apply(eventsc.wxCommandEvent_IsChecked,(self,) + _args, _kwargs)
+        return val
     def Checked(self, *_args, **_kwargs):
         val = apply(eventsc.wxCommandEvent_Checked,(self,) + _args, _kwargs)
         return val
diff --git a/wxPython/src/msw/mdi.cpp b/wxPython/src/msw/mdi.cpp
index 178767f380..beb1536cea 100644
--- a/wxPython/src/msw/mdi.cpp
+++ b/wxPython/src/msw/mdi.cpp
@@ -408,6 +408,76 @@ static PyObject *_wrap_wxMDIParentFrame_GetToolBar(PyObject *self, PyObject *arg
     return _resultobj;
 }
 
+#define wxMDIParentFrame_GetWindowMenu(_swigobj)  (_swigobj->GetWindowMenu())
+static PyObject *_wrap_wxMDIParentFrame_GetWindowMenu(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxMenu * _result;
+    wxMDIParentFrame * _arg0;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self", NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMDIParentFrame_GetWindowMenu",_kwnames,&_argo0)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMDIParentFrame_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMDIParentFrame_GetWindowMenu. Expected _wxMDIParentFrame_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMenu *)wxMDIParentFrame_GetWindowMenu(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxMenu_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
+#define wxMDIParentFrame_SetWindowMenu(_swigobj,_swigarg0)  (_swigobj->SetWindowMenu(_swigarg0))
+static PyObject *_wrap_wxMDIParentFrame_SetWindowMenu(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxMDIParentFrame * _arg0;
+    wxMenu * _arg1;
+    PyObject * _argo0 = 0;
+    PyObject * _argo1 = 0;
+    char *_kwnames[] = { "self","menu", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMDIParentFrame_SetWindowMenu",_kwnames,&_argo0,&_argo1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMDIParentFrame_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMDIParentFrame_SetWindowMenu. Expected _wxMDIParentFrame_p.");
+        return NULL;
+        }
+    }
+    if (_argo1) {
+        if (_argo1 == Py_None) { _arg1 = NULL; }
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMenu_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMDIParentFrame_SetWindowMenu. Expected _wxMenu_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxMDIParentFrame_SetWindowMenu(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 #define wxMDIParentFrame_SetToolBar(_swigobj,_swigarg0)  (_swigobj->SetToolBar(_swigarg0))
 static PyObject *_wrap_wxMDIParentFrame_SetToolBar(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -706,6 +776,8 @@ static PyMethodDef mdicMethods[] = {
 	 { "new_wxMDIChildFrame", (PyCFunction) _wrap_new_wxMDIChildFrame, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMDIParentFrame_Tile", (PyCFunction) _wrap_wxMDIParentFrame_Tile, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMDIParentFrame_SetToolBar", (PyCFunction) _wrap_wxMDIParentFrame_SetToolBar, METH_VARARGS | METH_KEYWORDS },
+	 { "wxMDIParentFrame_SetWindowMenu", (PyCFunction) _wrap_wxMDIParentFrame_SetWindowMenu, METH_VARARGS | METH_KEYWORDS },
+	 { "wxMDIParentFrame_GetWindowMenu", (PyCFunction) _wrap_wxMDIParentFrame_GetWindowMenu, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMDIParentFrame_GetToolBar", (PyCFunction) _wrap_wxMDIParentFrame_GetToolBar, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMDIParentFrame_GetClientWindow", (PyCFunction) _wrap_wxMDIParentFrame_GetClientWindow, METH_VARARGS | METH_KEYWORDS },
 	 { "wxMDIParentFrame_GetActiveChild", (PyCFunction) _wrap_wxMDIParentFrame_GetActiveChild, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/msw/mdi.py b/wxPython/src/msw/mdi.py
index 0569d10921..b42676e001 100644
--- a/wxPython/src/msw/mdi.py
+++ b/wxPython/src/msw/mdi.py
@@ -45,6 +45,13 @@ class wxMDIParentFramePtr(wxFramePtr):
         val = apply(mdic.wxMDIParentFrame_GetToolBar,(self,) + _args, _kwargs)
         if val: val = wxWindowPtr(val) 
         return val
+    def GetWindowMenu(self, *_args, **_kwargs):
+        val = apply(mdic.wxMDIParentFrame_GetWindowMenu,(self,) + _args, _kwargs)
+        if val: val = wxMenuPtr(val) 
+        return val
+    def SetWindowMenu(self, *_args, **_kwargs):
+        val = apply(mdic.wxMDIParentFrame_SetWindowMenu,(self,) + _args, _kwargs)
+        return val
     def SetToolBar(self, *_args, **_kwargs):
         val = apply(mdic.wxMDIParentFrame_SetToolBar,(self,) + _args, _kwargs)
         return val
diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp
index b6d6548a70..00aea76a57 100644
--- a/wxPython/src/msw/printfw.cpp
+++ b/wxPython/src/msw/printfw.cpp
@@ -1552,13 +1552,12 @@ static PyObject *_wrap_wxPageSetupDialogData_SetMinMarginBottomRight(PyObject *s
 static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxPageSetupDialogData * _arg0;
-    wxPaperSize * _arg1;
+    wxPaperSize  _arg1;
     PyObject * _argo0 = 0;
-    PyObject * _argo1 = 0;
     char *_kwnames[] = { "self","id", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_argo1)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPageSetupDialogData_SetPaperId",_kwnames,&_argo0,&_arg1)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1567,16 +1566,9 @@ static PyObject *_wrap_wxPageSetupDialogData_SetPaperId(PyObject *self, PyObject
         return NULL;
         }
     }
-    if (_argo1) {
-        if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPaperSize_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPageSetupDialogData_SetPaperId. Expected _wxPaperSize_p.");
-        return NULL;
-        }
-    }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxPageSetupDialogData_SetPaperId(_arg0,*_arg1);
+        wxPageSetupDialogData_SetPaperId(_arg0,_arg1);
 
     wxPy_END_ALLOW_THREADS;
 }    Py_INCREF(Py_None);
diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp
index 2e4ca5bf6c..66532bc801 100644
--- a/wxPython/src/msw/windows.cpp
+++ b/wxPython/src/msw/windows.cpp
@@ -1110,6 +1110,62 @@ static PyObject *_wrap_wxWindow_CenterOnParent(PyObject *self, PyObject *args, P
     return _resultobj;
 }
 
+#define wxWindow_CentreOnScreen(_swigobj,_swigarg0)  (_swigobj->CentreOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CentreOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    int  _arg1 = (int ) wxBOTH;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self","direction", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CentreOnScreen",_kwnames,&_argo0,&_arg1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CentreOnScreen. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxWindow_CentreOnScreen(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
+#define wxWindow_CenterOnScreen(_swigobj,_swigarg0)  (_swigobj->CenterOnScreen(_swigarg0))
+static PyObject *_wrap_wxWindow_CenterOnScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxWindow * _arg0;
+    int  _arg1 = (int ) wxBOTH;
+    PyObject * _argo0 = 0;
+    char *_kwnames[] = { "self","direction", NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_CenterOnScreen",_kwnames,&_argo0,&_arg1)) 
+        return NULL;
+    if (_argo0) {
+        if (_argo0 == Py_None) { _arg0 = NULL; }
+        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CenterOnScreen. Expected _wxWindow_p.");
+        return NULL;
+        }
+    }
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxWindow_CenterOnScreen(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+}
+
 #define wxWindow_ClientToScreenXY(_swigobj,_swigarg0,_swigarg1)  (_swigobj->ClientToScreen(_swigarg0,_swigarg1))
 static PyObject *_wrap_wxWindow_ClientToScreenXY(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -9226,6 +9282,8 @@ static PyMethodDef windowscMethods[] = {
 	 { "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_ClientToScreen", (PyCFunction) _wrap_wxWindow_ClientToScreen, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_ClientToScreenXY", (PyCFunction) _wrap_wxWindow_ClientToScreenXY, METH_VARARGS | METH_KEYWORDS },
+	 { "wxWindow_CenterOnScreen", (PyCFunction) _wrap_wxWindow_CenterOnScreen, METH_VARARGS | METH_KEYWORDS },
+	 { "wxWindow_CentreOnScreen", (PyCFunction) _wrap_wxWindow_CentreOnScreen, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_CenterOnParent", (PyCFunction) _wrap_wxWindow_CenterOnParent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_CentreOnParent", (PyCFunction) _wrap_wxWindow_CentreOnParent, METH_VARARGS | METH_KEYWORDS },
 	 { "wxWindow_Centre", (PyCFunction) _wrap_wxWindow_Centre, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py
index f9db9758b1..6028fe3d55 100644
--- a/wxPython/src/msw/windows.py
+++ b/wxPython/src/msw/windows.py
@@ -139,6 +139,12 @@ class wxWindowPtr(wxEvtHandlerPtr):
     def CenterOnParent(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_CenterOnParent,(self,) + _args, _kwargs)
         return val
+    def CentreOnScreen(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_CentreOnScreen,(self,) + _args, _kwargs)
+        return val
+    def CenterOnScreen(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_CenterOnScreen,(self,) + _args, _kwargs)
+        return val
     def ClientToScreenXY(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_ClientToScreenXY,(self,) + _args, _kwargs)
         return val
diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i
index c10fad5b2c..d849726c21 100644
--- a/wxPython/src/printfw.i
+++ b/wxPython/src/printfw.i
@@ -132,7 +132,7 @@ public:
     void SetMarginBottomRight(const wxPoint& pt);
     void SetMinMarginTopLeft(const wxPoint& pt);
     void SetMinMarginBottomRight(const wxPoint& pt);
-    void SetPaperId(wxPaperSize& id);
+    void SetPaperId(wxPaperSize id);
     void SetPaperSize(const wxSize& size);
     void SetPrintData(const wxPrintData& printData);
 };
diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i
index 1867774874..6e95e8e5ab 100644
--- a/wxPython/src/windows.i
+++ b/wxPython/src/windows.i
@@ -207,6 +207,8 @@ public:
     void Centre(int direction = wxBOTH);
     void CentreOnParent(int direction = wxBOTH );
     void CenterOnParent(int direction = wxBOTH );
+    void CentreOnScreen(int direction = wxBOTH );
+    void CenterOnScreen(int direction = wxBOTH );
 
     // (uses apply'ed INOUT typemap, see above)
     %name(ClientToScreenXY)void ClientToScreen(int* x, int* y);
diff --git a/wxPython/wxPython/lib/pyshell.py b/wxPython/wxPython/lib/pyshell.py
index 58dd3601ff..4df731fd46 100644
--- a/wxPython/wxPython/lib/pyshell.py
+++ b/wxPython/wxPython/lib/pyshell.py
@@ -17,8 +17,8 @@ inside a wxStyledTextCtrl, similar to the Python shell windows found in
 IDLE and PythonWin.
 
 There is still much to be done to improve this class, such as line
-buffering/recall, autoindent, calltips, autocomplete, etc...  But
-it's a good start.
+buffering/recall, autoindent, calltips, autocomplete, fixing the colourizer,
+etc...  But it's a good start.
 
 """
 
@@ -107,7 +107,7 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
         # Event handlers
         EVT_KEY_DOWN(self, self.OnKey)
         EVT_STC_UPDATEUI(self, ID, self.OnUpdateUI)
-        EVT_STC_STYLENEEDED(self, ID, self.OnStyle)
+        #EVT_STC_STYLENEEDED(self, ID, self.OnStyle)
 
 
     def GetLocals(self): return self.locals
@@ -126,8 +126,8 @@ class PyShellWindow(wxStyledTextCtrl, InteractiveInterpreter):
         """
         p = self.props
 
-        self.SetEdgeMode(wxSTC_EDGE_LINE)
-        self.SetEdgeColumn(80)
+        #self.SetEdgeMode(wxSTC_EDGE_LINE)
+        #self.SetEdgeColumn(80)
 
 
         # set the selection margin and window margin
-- 
2.50.0

