From 631f1bfed5d2df0215035207355d838328237578 Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Sat, 6 Feb 1999 13:32:46 +0000
Subject: [PATCH] Added wxMenu::UpdateUI to wxMSW, wxGTK, wxMotif, wxStubs;
 rearranged/debugged docs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/category.tex                  |  22 +++++
 docs/latex/wx/classes.tex                   |   9 +-
 docs/latex/wx/datstrm.tex                   | 104 ++++++++++++--------
 docs/latex/wx/fltinstr.tex                  |   3 +-
 docs/latex/wx/fltoutst.tex                  |   3 +-
 docs/latex/wx/function.tex                  |   6 ++
 docs/latex/wx/menu.tex                      |  12 +++
 docs/latex/wx/{strmext.tex => strmfile.tex} |  80 ---------------
 docs/latex/wx/strmsock.tex                  |  44 +++++++++
 docs/latex/wx/strmzlib.tex                  |  36 +++++++
 docs/latex/wx/tconfig.tex                   |  27 ++---
 docs/latex/wx/textfile.tex                  |  16 +--
 docs/latex/wx/thread.tex                    |   4 +-
 docs/latex/wx/upduievt.tex                  |   6 +-
 docs/latex/wx/window.tex                    |  31 ++----
 include/wx/filefn.h                         |   4 +
 include/wx/gtk/menu.h                       |   6 ++
 include/wx/gtk1/menu.h                      |   6 ++
 include/wx/motif/menu.h                     |  10 ++
 include/wx/msw/menu.h                       |   6 ++
 include/wx/stubs/menu.h                     |  10 ++
 src/common/datstrm.cpp                      |   2 +-
 src/common/filefn.cpp                       |  13 +++
 src/gtk/menu.cpp                            |  40 ++++++++
 src/gtk/window.cpp                          |   2 +
 src/gtk1/menu.cpp                           |  40 ++++++++
 src/gtk1/window.cpp                         |   2 +
 src/motif/menu.cpp                          |  47 ++++++++-
 src/msw/menu.cpp                            |  40 ++++++++
 src/msw/utils.cpp                           |   3 +
 src/stubs/menu.cpp                          |  43 ++++++++
 utils/dialoged/src/reseditr.cpp             |  13 +--
 utils/ogl/src/mfutils.h                     |   6 +-
 33 files changed, 504 insertions(+), 192 deletions(-)
 rename docs/latex/wx/{strmext.tex => strmfile.tex} (55%)
 create mode 100644 docs/latex/wx/strmsock.tex
 create mode 100644 docs/latex/wx/strmzlib.tex

diff --git a/docs/latex/wx/category.tex b/docs/latex/wx/category.tex
index 9a113c2728..6f608b3477 100644
--- a/docs/latex/wx/category.tex
+++ b/docs/latex/wx/category.tex
@@ -358,6 +358,28 @@ overview}{wxfileoverview} for more details.
 \twocolitem{\helpref{wxTextFile}{wxtextfile}}{Class for working with text files as with arrays of lines}
 \end{twocollist}
 
+{\large {\bf Stream classes}}
+
+wxWindows has its own set of stream classes, as an alternative to often buggy standard stream
+libraries, and to provide enhanced functionality.
+
+\begin{twocollist}\itemsep=0pt
+\twocolitem{\helpref{wxStreamBase}{wxstreambase}}{Stream base class}
+\twocolitem{\helpref{wxStreamBuffer}{wxstreambuffer}}{Stream buffer class}
+\twocolitem{\helpref{wxInputStream}{wxinputstream}}{Input stream class}
+\twocolitem{\helpref{wxOutputStream}{wxoutputstream}}{Output stream class}
+\twocolitem{\helpref{wxFilterInputStream}{wxfilterinputstream}}{Filtered input stream class}
+\twocolitem{\helpref{wxFilterOutputStream}{wxfilteroutputstream}}{Filtered output stream class}
+\twocolitem{\helpref{wxDataInputStream}{wxdatainputstream}}{Platform-independent data input stream class}
+\twocolitem{\helpref{wxDataOutputStream}{wxdataoutputstream}}{Platform-independent data output stream class}
+\twocolitem{\helpref{wxFileInputStream}{wxfileinputstream}}{File input stream class}
+\twocolitem{\helpref{wxFileOutputStream}{wxfileoutputstream}}{File output stream class}
+\twocolitem{\helpref{wxZlibInputStream}{wxzlibinputstream}}{Zlib (compression) input stream class}
+\twocolitem{\helpref{wxZlibOutputStream}{wxzliboutputstream}}{Zlib (compression) output stream class}
+\twocolitem{\helpref{wxSocketInputStream}{wxsocketinputstream}}{Socket input stream class}
+\twocolitem{\helpref{wxSocketOutputStream}{wxsocketoutputstream}}{Socket output stream class}
+\end{twocollist}
+
 {\large {\bf Miscellaneous}}
 
 \begin{twocollist}\itemsep=0pt
diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex
index b9f91ca60b..122ab151f6 100644
--- a/docs/latex/wx/classes.tex
+++ b/docs/latex/wx/classes.tex
@@ -60,8 +60,8 @@ $$\image{14cm;0cm}{wxclass.ps}$$
 \input cursor.tex
 \input database.tex
 \input dataobj.tex
-\input date.tex
 \input datstrm.tex
+\input date.tex
 \input dc.tex
 \input ddeclint.tex
 \input ddeconn.tex
@@ -89,6 +89,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$
 \input fildrptg.tex
 \input filehist.tex
 \input filetype.tex
+\input strmfile.tex
 \input fltinstr.tex
 \input fltoutst.tex
 \input focusevt.tex
@@ -178,6 +179,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$
 \input slider.tex
 \input sckaddr.tex
 \input socket.tex
+\input strmsock.tex
 \input spinbutt.tex
 \input splitter.tex
 \input statbmp.tex
@@ -186,9 +188,8 @@ $$\image{14cm;0cm}{wxclass.ps}$$
 \input statusbr.tex
 \input wxstring.tex
 \input strlist.tex
-\input stream.tex
 \input strmbase.tex
-\input strmext.tex
+\input stream.tex
 \input sysclevt.tex
 \input settings.tex
 \input tab.tex
@@ -220,7 +221,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$
 \input wave.tex
 \input window.tex
 \input windowdc.tex
-
+\input strmzlib.tex
 \input function.tex
 \input keycode.tex
 
diff --git a/docs/latex/wx/datstrm.tex b/docs/latex/wx/datstrm.tex
index 637ee3ae0b..3c0481935d 100644
--- a/docs/latex/wx/datstrm.tex
+++ b/docs/latex/wx/datstrm.tex
@@ -1,114 +1,132 @@
-\section{\class{wxDataStream}}\label{wxdatastream}
+\section{\class{wxDataInputStream}}\label{wxdatainputstream}
 
-This class provides functions that read and write integers or double in a
+This class provides functions that read data types in a
 portable way. So, a file written by an Intel processor can be read by a
 Sparc or anything else.
 
-\latexignore{\rtfignore{\wxheading{Members}}}
-
-\membersection{wxDataStream::wxDataStream}\label{wxdatastreamconstr}
-
-\func{}{wxDataStream}{\param{istream\&}{ stream}}
+\wxheading{Derived from}
 
-Constructs a datastream object from a C++ input stream. Only read methods will
-be available.
+\helpref{wxFilterInputStream}{wxfilterinputstream}\\
+\helpref{wxInputStream}{wxinputstream}\\
+\helpref{wxStreamBase}{wxstreambase}
 
-\wxheading{Parameters}
+\latexignore{\rtfignore{\wxheading{Members}}}
 
-\docparam{stream}{The C++ input stream.}
+\membersection{wxDataInputStream::wxDataInputStream}\label{wxdatainputstreamconstr}
 
-\func{}{wxDataStream}{\param{istream\&}{ stream}}
+\func{}{wxDataInputStream}{\param{wxInputStream\&}{ stream}}
 
-Constructs a datastream object from a C++ input stream. Only read methods will
+Constructs a datastream object from an input stream. Only read methods will
 be available.
 
 \wxheading{Parameters}
 
-\docparam{stream}{The C++ input stream.}
+\docparam{stream}{The input stream.}
 
-\membersection{wxDataStream::\destruct{wxDataStream}}
+\membersection{wxDataInputStream::\destruct{wxDataInputStream}}
 
-\func{}{\destruct{wxDataStream}}{\void}
+\func{}{\destruct{wxDataInputStream}}{\void}
 
-Destroys the wxDataStream object.
+Destroys the wxDataInputStream object.
 
-\membersection{wxDataStream::Read8}
+\membersection{wxDataInputStream::Read8}
 
 \func{unsigned char}{Read8}{\void}
 
 Reads a single byte from the stream.
 
-\membersection{wxDataStream::Read16}
+\membersection{wxDataInputStream::Read16}
 
 \func{unsigned short}{Read16}{\void}
 
 Reads a 16 bit integer from the stream.
 
-\membersection{wxDataStream::Read32}
+\membersection{wxDataInputStream::Read32}
 
 \func{unsigned long}{Read32}{\void}
 
 Reads a 32 bit integer from the stream.
 
-\membersection{wxDataStream::ReadDouble}
+\membersection{wxDataInputStream::ReadDouble}
 
 \func{double}{ReadDouble}{\void}
 
 Reads a double (IEEE encoded) from the stream.
 
-\membersection{wxDataStream::ReadString}
+\membersection{wxDataInputStream::ReadString}
 
-\func{wxString}{wxDataStream::ReadString}{\void}
+\func{wxString}{wxDataInputStream::ReadString}{\void}
 
-Reads a string from a stream. Actually, this function first reads a byte
+Reads a string from a stream. Actually, this function first reads a long integer
 specifying the length of the string (without the last null character) and then
 reads the string.
 
-\membersection{wxDataStream::ReadLine}
+\membersection{wxDataInputStream::ReadLine}
 
-\func{wxString}{wxDataStream::ReadLine}{\void}
+\func{wxString}{wxDataInputStream::ReadLine}{\void}
 
 Reads a line from the stream. A line is a string which ends with \\n or \\r\\n.
 
-\membersection{wxDataStream::Write8}
+\section{\class{wxDataOutputStream}}\label{wxdataoutputstream}
+
+This class provides functions that write data types in a
+portable way. So, a file written by an Intel processor can be read by a
+Sparc or anything else.
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxDataOutputStream::wxDataOutputStream}\label{wxdataoutputstreamconstr}
+
+\func{}{wxDataInputStream}{\param{wxOutputStream\&}{ stream}}
+
+Constructs a datastream object from an output stream. Only read methods will
+be available.
+
+\wxheading{Parameters}
+
+\docparam{stream}{The output stream.}
+
+\membersection{wxDataOutputStream::\destruct{wxDataOutputStream}}
+
+\func{}{\destruct{wxDataOutputStream}}{\void}
+
+Destroys the wxDataOutputStream object.
+
+\membersection{wxDataOutputStream::Write8}
 
-\func{void}{wxDataStream::Write8}{{\param unsigned char }{i8}}
+\func{void}{wxDataOutputStream::Write8}{{\param unsigned char }{i8}}
 
 Writes the single byte {\it i8} to the stream.
 
-\membersection{wxDataStream::Write16}
+\membersection{wxDataOutputStream::Write16}
 
-\func{void}{wxDataStream::Write16}{{\param unsigned short }{i16}}
+\func{void}{wxDataOutputStream::Write16}{{\param unsigned short }{i16}}
 
 Writes the 16 bit integer {\it i16} to the stream.
 
-\membersection{wxDataStream::Write32}
+\membersection{wxDataOutputStream::Write32}
 
-\func{void}{wxDataStream::Write32}{{\param unsigned long }{i32}}
+\func{void}{wxDataOutputStream::Write32}{{\param unsigned long }{i32}}
 
 Writes the 32 bit integer {\it i32} to the stream.
 
-\membersection{wxDataStream::WriteDouble}
+\membersection{wxDataOutputStream::WriteDouble}
 
-\func{void}{wxDataStream::WriteDouble}{{\param double }{f}}
+\func{void}{wxDataOutputStream::WriteDouble}{{\param double }{f}}
 
 Writes the double {\it f} to the stream using the IEEE format.
 
-\membersection{wxDataStream::WriteString}
+\membersection{wxDataOutputStream::WriteString}
 
-\func{void}{wxDataStream::WriteString}{{\param const wxString\& }{string}}
+\func{void}{wxDataOutputStream::WriteString}{{\param const wxString\& }{string}}
 
 Writes {\it string} to the stream. Actually, this method writes the size of
 the string before writing {\it string} itself.
 
-\membersection{wxDataStream::WriteLine}
+\membersection{wxDataOutputStream::WriteLine}
 
-\func{void}{wxDataStream::WriteLine}{{\param const wxString\& }{string}}
+\func{void}{wxDataOutputStream::WriteLine}{{\param const wxString\& }{string}}
 
 Writes {\it string} as a line. Depending on the operating system, it adds
-\\n or \\r\\n.
+$\backslash$n or $\backslash$r$\backslash$n.
 
-%%% Local Variables: 
-%%% mode: latex
-%%% TeX-master: "referenc"
-%%% End: 
diff --git a/docs/latex/wx/fltinstr.tex b/docs/latex/wx/fltinstr.tex
index df80a2cdff..954e025cc5 100644
--- a/docs/latex/wx/fltinstr.tex
+++ b/docs/latex/wx/fltinstr.tex
@@ -5,7 +5,8 @@
 
 \wxheading{Derived from}
 
-\helpref{wxInputStream}{wxinputstream}
+\helpref{wxInputStream}{wxinputstream}\\
+\helpref{wxStreamBase}{wxstreambase}
 
 \wxheading{Note}
 
diff --git a/docs/latex/wx/fltoutst.tex b/docs/latex/wx/fltoutst.tex
index 48662e16de..bb126f619e 100644
--- a/docs/latex/wx/fltoutst.tex
+++ b/docs/latex/wx/fltoutst.tex
@@ -5,7 +5,8 @@
 
 \wxheading{Derived from}
 
-\helpref{wxOutputStream}{wxoutputstream}
+\helpref{wxOutputStream}{wxoutputstream}\\
+\helpref{wxStreamBase}{wxstreambase}
 
 \wxheading{Note}
 
diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index f9487cdb4d..e7befa3eb6 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -66,6 +66,12 @@ For example:
 
 Returns the next file that matches the path passed to \helpref{wxFindFirstFile}{wxfindfirstfile}.
 
+\membersection{::wxGetOSDirectory}\label{wxgetosdirectory}
+
+\func{wxString}{wxGetOSDirectory}{\void}
+
+Returns the Windows directory under Windows; on other platforms returns the empty string.
+
 \membersection{::wxIsAbsolutePath}
 
 \func{bool}{wxIsAbsolutePath}{\param{const wxString\& }{filename}}
diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex
index 29304cf79f..203e6277c0 100644
--- a/docs/latex/wx/menu.tex
+++ b/docs/latex/wx/menu.tex
@@ -330,6 +330,18 @@ This is relevant only to popup menus.
 
 \helpref{wxMenu::SetTitle}{wxmenusettitle}
 
+\membersection{wxMenu::UpdateUI}\label{wxmenuupdateui}
+
+\constfunc{void}{UpdateUI}{\param{wxEvtHandler*}{ source = NULL}}
+
+Sends events to {\it source} (or owning window if NULL) to update the
+menu UI. This is called just before the menu is popped up with \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu}, but
+the application may call it at other times if required.
+
+\wxheading{See also}
+
+\helpref{wxUpdateUIEvent}{wxupdateuievent}
+
 \section{\class{wxMenuBar}}\label{wxmenubar}
 
 A menu bar is a series of menus accessible from the top of a frame.
diff --git a/docs/latex/wx/strmext.tex b/docs/latex/wx/strmfile.tex
similarity index 55%
rename from docs/latex/wx/strmext.tex
rename to docs/latex/wx/strmfile.tex
index c793d4b42b..e19a2c946c 100644
--- a/docs/latex/wx/strmext.tex
+++ b/docs/latex/wx/strmfile.tex
@@ -1,39 +1,3 @@
-% -----------------------------------------------------------------------------
-% wxZlibInputStream
-% -----------------------------------------------------------------------------
-\section{\class{wxZlibInputStream}}
-
-\wxheading{Derived from}
-
-\helpref{wxFilterInputStream}{wxfilterinputstream}
-
-\wxheading{See also}
-
-\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxInputStream}{wxinputstream}
-
-\wxheading{Short description}
-
-This stream uncompresses all data read from it. It uses the ``filtered''
-stream to get new compressed data.
-
-% -----------------------------------------------------------------------------
-% wxZlibOutputStream
-% -----------------------------------------------------------------------------
-\section{\class{wxZlibOutputStream}}
-
-\wxheading{Derived from}
-
-\helpref{wxFilterOutputStream}{wxfilteroutputstream}
-
-\wxheading{See also}
-
-\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxOutputStream}{woutputstream}
-
-\wxheading{Short description}
-
-This stream compresses all data written to it and passed the compressed data
-to the ``filtered'' stream.
-
 % -----------------------------------------------------------------------------
 % wxFileInputStream
 % -----------------------------------------------------------------------------
@@ -145,47 +109,3 @@ Returns TRUE if the stream is initialized and ready.
 Initializes a new file stream in read-write mode using the specified 
 \it{iofilename} name.
 
-% -----------------------------------------------------------------------------
-% wxSocketInputStream
-% -----------------------------------------------------------------------------
-\section{\class{wxSocketInputStream}}
-
-\wxheading{Derived from}
-
-\helpref{wxInputStream}{wxinputStream}
-
-\wxheading{See also}
-
-\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxSocketBase}{wxsocketbase}
-
-\latexignore{\rtfignore{\wxheading{Members}}}
-
-\membersection{wxSocketInputStream::wxSocketInputStream}
-
-\func{}{wxSocketInputStream}{\param{wxSocketBase\&}{ s}}
-
-Initializes a new read-only socket stream using the specified initialized
-socket connection.
-
-% -----------------------------------------------------------------------------
-% wxSocketOutputStream
-% -----------------------------------------------------------------------------
-\section{\class{wxSocketInputStream}}
-
-\wxheading{Derived from}
-
-\helpref{wxOutputStream}{wxoutputStream}
-
-\wxheading{See also}
-
-\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxSocketBase}{wxsocketbase}
-
-\latexignore{\rtfignore{\wxheading{Members}}}
-
-\membersection{wxSocketOutputStream::wxSocketOutputStream}
-
-\func{}{wxSocketInputStream}{\param{wxSocketBase\&}{ s}}
-
-Initializes a new write-only socket stream using the specified initialized
-socket connection.
-
diff --git a/docs/latex/wx/strmsock.tex b/docs/latex/wx/strmsock.tex
new file mode 100644
index 0000000000..08a6e8157e
--- /dev/null
+++ b/docs/latex/wx/strmsock.tex
@@ -0,0 +1,44 @@
+% -----------------------------------------------------------------------------
+% wxSocketInputStream
+% -----------------------------------------------------------------------------
+\section{\class{wxSocketInputStream}}
+
+\wxheading{Derived from}
+
+\helpref{wxInputStream}{wxinputStream}
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxSocketBase}{wxsocketbase}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxSocketInputStream::wxSocketInputStream}
+
+\func{}{wxSocketInputStream}{\param{wxSocketBase\&}{ s}}
+
+Initializes a new read-only socket stream using the specified initialized
+socket connection.
+
+% -----------------------------------------------------------------------------
+% wxSocketOutputStream
+% -----------------------------------------------------------------------------
+\section{\class{wxSocketInputStream}}
+
+\wxheading{Derived from}
+
+\helpref{wxOutputStream}{wxoutputStream}
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxSocketBase}{wxsocketbase}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxSocketOutputStream::wxSocketOutputStream}
+
+\func{}{wxSocketInputStream}{\param{wxSocketBase\&}{ s}}
+
+Initializes a new write-only socket stream using the specified initialized
+socket connection.
+
diff --git a/docs/latex/wx/strmzlib.tex b/docs/latex/wx/strmzlib.tex
new file mode 100644
index 0000000000..1bfbf12fa0
--- /dev/null
+++ b/docs/latex/wx/strmzlib.tex
@@ -0,0 +1,36 @@
+% -----------------------------------------------------------------------------
+% wxZlibInputStream
+% -----------------------------------------------------------------------------
+\section{\class{wxZlibInputStream}}
+
+\wxheading{Derived from}
+
+\helpref{wxFilterInputStream}{wxfilterinputstream}
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxInputStream}{wxinputstream}
+
+\wxheading{Short description}
+
+This stream uncompresses all data read from it. It uses the ``filtered''
+stream to get new compressed data.
+
+% -----------------------------------------------------------------------------
+% wxZlibOutputStream
+% -----------------------------------------------------------------------------
+\section{\class{wxZlibOutputStream}}
+
+\wxheading{Derived from}
+
+\helpref{wxFilterOutputStream}{wxfilteroutputstream}
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxOutputStream}{wxoutputstream}
+
+\wxheading{Short description}
+
+This stream compresses all data written to it and passed the compressed data
+to the ``filtered'' stream.
+
diff --git a/docs/latex/wx/tconfig.tex b/docs/latex/wx/tconfig.tex
index 8b6a4b1628..42c046ca35 100644
--- a/docs/latex/wx/tconfig.tex
+++ b/docs/latex/wx/tconfig.tex
@@ -2,7 +2,7 @@
 
 Classes: \helpref{wxConfig}{wxconfigbase}
 
-This overview briefly describes what the config classes are and what are the
+This overview briefly describes what the config classes are and what they are
 for. All the details about how to use them may be found in the description of
 the \helpref{wxConfigBase}{wxconfigbase} class and the documentation of the
 file, registry and INI file based implementations mentions all the
@@ -17,12 +17,12 @@ means that this information should be:
 binary data, for example.
 \item{2.} Small. For instance, it is not recommended to use the Windows
 registry for amounts of data more than a couple of kilobytes.
-\item{3.} Not performance critical, neither from speed nor from memory
+\item{3.} Not performance critical, neither from speed nor from a memory
 consumption point of view.
 \end{itemize}
 
-On the other hand, the provided features make them very useful for storing all
-kind of small to medioum volumes of hierarchically organized heterogenous
+On the other hand, the features provided make them very useful for storing all
+kinds of small to medium volumes of hierarchically-organized, heterogenous
 data. In short, this is a place where you can conveniently stuff all your data
 (numbers and strings) organizing it in a tree where you use the
 filesystem-like paths to specify the location of a piece of data. In
@@ -33,17 +33,18 @@ differences between the Windows registry and the standard Unix text format
 configuration files. Other (future) implementations of wxConfigBase might also
 understand GTK ressource files or their analogues on the KDE side.
 
-In any case, each implementation of wxConfigBase does its best (although due
+In any case, each implementation of wxConfigBase does its best to
+make the data look the same way everywhere. Due
 to the limitations of the underlying physical storage as in the case of
-wxIniConfigs it may not implement 100\% of the base class functionality) to
-make the data look the same way everywhere. So you have the groups of entries
-and the entries themselves. Each entry contains either a string or a number
-(or a boolean value... support for other types of data such as dates or
+wxIniConfig, it may not implement 100\% of the base class functionality.
+
+There are groups of entries and the entries themselves. Each entry contains either a string or a number
+(or a boolean value; support for other types of data such as dates or
 timestamps is planned) and is identified by the full path to it: something
 like /MyApp/UserPreferences/Colors/Foreground. The previous elements in the
-path are the group names, each name may contain an arbitrary number of entries
+path are the group names, and each name may contain an arbitrary number of entries
 and subgroups. The path components are {\bf always} separated with a slash,
-even though some implementations use the backslash internally. The further
-details (including how to read/write these entries) may be found in
-\helpref{wxConfigBase}{wxconfigbase} documentation.
+even though some implementations use the backslash internally. Further
+details (including how to read/write these entries) may be found in 
+the documentation for \helpref{wxConfigBase}{wxconfigbase}.
 
diff --git a/docs/latex/wx/textfile.tex b/docs/latex/wx/textfile.tex
index a6ca12687f..0ffa822a36 100644
--- a/docs/latex/wx/textfile.tex
+++ b/docs/latex/wx/textfile.tex
@@ -4,7 +4,7 @@ The wxTextFile is a simple class which allows to work with text files on line by
 line basis. It also understands the differences in line termination characters
 under different platforms and will not do anything bad to files with "non
 native" line termination sequences - in fact, it can be also used to modify the
-text files and chaneg the line termination characters from one type (say DOS) to
+text files and change the line termination characters from one type (say DOS) to
 another (say Unix).
 
 One word of warning: the class is not at all optimized for big files and so it
@@ -22,7 +22,7 @@ function which opens the file (name may be specified either as Open argument or
 in the constructor), reads its contents in memory and closes it. If all of these
 operations are successful, Open() will return TRUE and FALSE on error.
 \item Work with the lines in the file: this may be done either with "direct
-access" functions like \helpref{GetLineCount}{wxtextfilegetlinecount} and
+access" functions like \helpref{GetLineCount}{wxtextfilegetlinecount} and 
 \helpref{GetLine}{wxtextfilegetline} ({\it operator[]} does exactly the same
 but looks more like array addressing) or with "sequential access" functions
 which include \helpref{GetFirstLine}{wxtextfilegetfirstline}/
@@ -34,9 +34,9 @@ changed with \helpref{GoToLine}{wxtextfilegotoline}.
 \item Add/remove lines to the file: \helpref{AddLine}{wxtextfileaddline} and 
 \helpref{InsertLine}{wxtextfileinsertline} add new lines while 
 \helpref{RemoveLine}{wxtextfileremoveline} deletes the existing ones.
-\item Save your changes: notice that the changes you do to the file will {\bf
-not} be saved automatically, calling \helpref{Close}{wxtextfileclose} or doing
-nothing discards them! To save the chanegs you must explicitly call 
+\item Save your changes: notice that the changes you make to the file will {\bf
+not} be saved automatically; calling \helpref{Close}{wxtextfileclose} or doing
+nothing discards them! To save the changes you must explicitly call 
 \helpref{Write}{wxtextfilewrite} - here, you may also change the line
 termination type if you wish.
 \end{itemize}
@@ -145,7 +145,7 @@ GoToLine().
 \constfunc{void}{GoToLine}{\param{size\_t }{n}}
 
 Changes the value returned by \helpref{GetCurrentLine}{wxtextfilegetcurrentline} 
-and used by \helpref{GetFirstLine()}{wxtextfilegetfirstline}()/\helpref{GetNextLine()}{wxtextfilegetnextline}.
+and used by \helpref{GetFirstLine()}{wxtextfilegetfirstline}/\helpref{GetNextLine()}{wxtextfilegetnextline}.
 
 \membersection{wxTextFile::Eof}\label{wxtextfileeof}
 
@@ -223,13 +223,13 @@ Insert a line before the line number {\it n}.
 
 \constfunc{void}{RemoveLine}{\param{size\_t }{n}}
 
-Delete one line from the file.
+Delete line number {\it n} from the file.
 
 \membersection{wxTextFile::Write}\label{wxtextfilewrite}
 
 \constfunc{bool}{Write}{\param{wxTextFileType }{typeNew = wxTextFileType\_None}}
 
-Change the file on disk. The {\it typeNew} parameter allows to change the
+Change the file on disk. The {\it typeNew} parameter allows you to change the
 file format (default argument means "don't change type") and may be used to
 convert, for example, DOS files to Unix.
 
diff --git a/docs/latex/wx/thread.tex b/docs/latex/wx/thread.tex
index fa1716ff4d..742473d5da 100644
--- a/docs/latex/wx/thread.tex
+++ b/docs/latex/wx/thread.tex
@@ -1,11 +1,11 @@
 \section{\class{wxThread}}\label{wxthread}
 
 A thread is basically a path of execution through a program. Threads are also
-sometimes calls {\it light-wight processes}, but the fundamental difference
+sometimes called {\it light-weight processes}, but the fundamental difference
 between threads and processes is that memory spaces of different processes are
 separated while all threads share the same address space. While it makes it
 much easier to share common data between several threads, it also makes much
-easier to shoot oneself in a leg, so careful use of synchronization objects
+easier to shoot oneself in the foot, so careful use of synchronization objects
 such as \helpref{mutexes}{wxmutex} and/or \helpref{critical sections}{wxcriticalsection} is recommended.
 
 \wxheading{Derived from}
diff --git a/docs/latex/wx/upduievt.tex b/docs/latex/wx/upduievt.tex
index 2423083c1d..c7f13a2734 100644
--- a/docs/latex/wx/upduievt.tex
+++ b/docs/latex/wx/upduievt.tex
@@ -10,7 +10,7 @@ to give an application the chance to update various user interface elements.
 
 \wxheading{Event table macros}
 
-To process a menu event, use these event handler macros to direct input to member
+To process an update event, use these event handler macros to direct input to member
 functions that take a wxUpdateUIEvent argument.
 
 \twocolwidtha{7cm}
@@ -36,6 +36,10 @@ Instead of directly manipulating the menu or button, you call functions in the e
 object, such as \helpref{wxUpdateUIEvent::Check}{wxupdateuieventcheck}. wxWindows
 will determine whether such a call has been made, and which UI element to update.
 
+These events will work for popup menus as well as menubars. Just before a menu is popped
+up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called to process any UI events for
+the window that owns the menu.
+
 \wxheading{See also}
 
 \helpref{Event handling overview}{eventhandlingoverview}
diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index c5421a8edb..047981dd63 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -298,30 +298,6 @@ Enable or disable the window for user input.
 
 \helpref{wxWindow::IsEnabled}{wxwindowisenabled}
 
-\membersection{wxWindow::FakePopupMenu}\label{wxwindowfakepopupmenu}
-
-\func{virtual bool}{FakePopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}}
-
-A replacement for wxWindow::PopupMenu for cases where the PopupMenu implementation
-does not work correctly, in particular on Motif platforms.
-
-\wxheading{Parameters}
-
-\docparam{menu}{Menu to pop up.}
-
-\docparam{x}{Required x position for the menu to appear.}
-
-\docparam{y}{Required y position for the menu to appear.}
-
-\wxheading{Remarks}
-
-This is a cut-down version of PopupMenu using a dialog and listbox; pull-right menus
-are not supported.
-
-\wxheading{See also}
-
-\helpref{wxMenu}{wxmenu}, \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu}
-
 \membersection{wxWindow::FindFocus}\label{wxwindowfindfocus}
 
 \func{static wxWindow*}{FindFocus}{\void}
@@ -1409,7 +1385,12 @@ the commandInt member of the event to check the selected menu identifier.
 
 \wxheading{See also}
 
-\helpref{wxMenu}{wxmenu}, \helpref{wxWindow::FakePopupMenu}{wxwindowfakepopupmenu}
+\helpref{wxMenu}{wxmenu}
+
+\wxheading{Remarks}
+
+Just before the menu is popped up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called
+to ensure that the menu items are in the correct state.
 
 \membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler}
 
diff --git a/include/wx/filefn.h b/include/wx/filefn.h
index 1067e88f5e..8ed4d7ffbe 100644
--- a/include/wx/filefn.h
+++ b/include/wx/filefn.h
@@ -197,6 +197,10 @@ WXDLLEXPORT void wxSplitPath(const char *pszFileName,
 // find a file in a list of directories, returns false if not found
 WXDLLEXPORT bool wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
 
+// Get the OS directory if appropriate (such as the Windows directory).
+// On non-Windows platform, probably just return the empty string.
+WXDLLEXPORT wxString wxGetOSDirectory();
+
 // ----------------------------------------------------------------------------
 // classes
 // ----------------------------------------------------------------------------
diff --git a/include/wx/gtk/menu.h b/include/wx/gtk/menu.h
index 18844219c9..347acf3340 100644
--- a/include/wx/gtk/menu.h
+++ b/include/wx/gtk/menu.h
@@ -128,6 +128,12 @@ public:
   inline void SetClientData( void* clientData ) { m_clientData = clientData; }
   inline void* GetClientData() const { return m_clientData; }
   
+  // Updates the UI for a menu and all submenus recursively.
+  // source is the object that has the update event handlers
+  // defined for it. If NULL, the menu or associated window
+  // will be used.
+  void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
+
 // implementation
   
   int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
diff --git a/include/wx/gtk1/menu.h b/include/wx/gtk1/menu.h
index 18844219c9..347acf3340 100644
--- a/include/wx/gtk1/menu.h
+++ b/include/wx/gtk1/menu.h
@@ -128,6 +128,12 @@ public:
   inline void SetClientData( void* clientData ) { m_clientData = clientData; }
   inline void* GetClientData() const { return m_clientData; }
   
+  // Updates the UI for a menu and all submenus recursively.
+  // source is the object that has the update event handlers
+  // defined for it. If NULL, the menu or associated window
+  // will be used.
+  void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
+
 // implementation
   
   int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
diff --git a/include/wx/motif/menu.h b/include/wx/motif/menu.h
index d29ae23ac4..1ed3a0da6b 100644
--- a/include/wx/motif/menu.h
+++ b/include/wx/motif/menu.h
@@ -85,6 +85,12 @@ public:
     // Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
   wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
 
+  // Updates the UI for a menu and all submenus recursively.
+  // source is the object that has the update event handlers
+  // defined for it. If NULL, the menu or associated window
+  // will be used.
+  void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
+
   void ProcessCommand(wxCommandEvent& event);
   inline void Callback(const wxFunction func) { m_callback = func; }
 
@@ -94,6 +100,9 @@ public:
 
   inline wxList& GetItems() const { return (wxList&) m_menuItems; }
 
+  void      SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
+  wxWindow *GetInvokingWindow()         const { return m_pInvokingWindow; }
+
   //// Motif-specific
   inline WXWidget GetButtonWidget() const { return m_buttonWidget; }
   inline void SetButtonWidget(WXWidget buttonWidget) { m_buttonWidget = buttonWidget; }
@@ -136,6 +145,7 @@ public:
   wxEvtHandler *    m_parent;
   wxEvtHandler *    m_eventHandler;
   void*             m_clientData;
+  wxWindow*         m_pInvokingWindow;
 
   //// Motif-specific
   int               m_numColumns;
diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h
index 6ca343d1af..7c40f1ab0e 100644
--- a/include/wx/msw/menu.h
+++ b/include/wx/msw/menu.h
@@ -83,6 +83,12 @@ public:
     // Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
   wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
 
+  // Updates the UI for a menu and all submenus recursively.
+  // source is the object that has the update event handlers
+  // defined for it. If NULL, the menu or associated window
+  // will be used.
+  void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
+
   void ProcessCommand(wxCommandEvent& event);
   inline void Callback(const wxFunction func) { m_callback = func; }
 
diff --git a/include/wx/stubs/menu.h b/include/wx/stubs/menu.h
index fa3936557c..db15f8fc70 100644
--- a/include/wx/stubs/menu.h
+++ b/include/wx/stubs/menu.h
@@ -66,6 +66,9 @@ public:
   inline void SetClientData(void* clientData) { m_clientData = clientData; }
   inline void* GetClientData() const { return m_clientData; }
 
+  void      SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
+  wxWindow *GetInvokingWindow()         const { return m_pInvokingWindow; }
+
   // item properties
     // title
   void SetTitle(const wxString& label);
@@ -86,6 +89,12 @@ public:
   void ProcessCommand(wxCommandEvent& event);
   inline void Callback(const wxFunction func) { m_callback = func; }
 
+  // Updates the UI for a menu and all submenus recursively.
+  // source is the object that has the update event handlers
+  // defined for it. If NULL, the menu or associated window
+  // will be used.
+  void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
+
   virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
   inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
   inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
@@ -102,6 +111,7 @@ public:
   wxEvtHandler *    m_parent;
   wxEvtHandler *    m_eventHandler;
   void*             m_clientData;
+  wxWindow*         m_pInvokingWindow;
 };
 
 // ----------------------------------------------------------------------------
diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp
index d455a6dc4e..b9ad7564f9 100644
--- a/src/common/datstrm.cpp
+++ b/src/common/datstrm.cpp
@@ -195,7 +195,7 @@ void wxDataOutputStream::WriteDouble(double d)
 #if wxUSE_APPLE_IEEE
   ConvertToIeeeExtended(d, (unsigned char *)buf);
 #else
-#  pragma warning "wxDataStream::WriteDouble() not using IeeeExtended - will not work!"
+#  pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
  buf[0] = '\0';
 #endif
   Write(buf, 10);
diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
index 8207942f5e..59a9cd78f0 100644
--- a/src/common/filefn.cpp
+++ b/src/common/filefn.cpp
@@ -1451,6 +1451,19 @@ bool wxSetWorkingDirectory(const wxString& d)
 #endif
 }
 
+// Get the OS directory if appropriate (such as the Windows directory).
+// On non-Windows platform, probably just return the empty string.
+wxString wxGetOSDirectory()
+{
+#ifdef __WINDOWS__
+    char buf[256];
+    GetWindowsDirectory(buf, 256);
+    return wxString(buf);
+#else
+    return wxEmptyString;
+#endif
+}
+
 bool wxEndsWithPathSeparator(const char *pszFileName)
 {
   size_t len = Strlen(pszFileName);
diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp
index faa9236de7..7f42dd5e94 100644
--- a/src/gtk/menu.cpp
+++ b/src/gtk/menu.cpp
@@ -642,4 +642,44 @@ wxWindow *wxMenu::GetInvokingWindow()
     return m_invokingWindow;
 }
 
+// Update a menu and all submenus recursively.
+// source is the object that has the update event handlers
+// defined for it. If NULL, the menu or associated window
+// will be used.
+void wxMenu::UpdateUI(wxEvtHandler* source)
+{
+  if (!source && GetInvokingWindow())
+    source = GetInvokingWindow()->GetEventHandler();
+  if (!source)
+    source = GetEventHandler();
+  if (!source)
+    source = this;
+
+  wxNode* node = GetItems().First();
+  while (node)
+  {
+    wxMenuItem* item = (wxMenuItem*) node->Data();
+    if ( !item->IsSeparator() )
+    {
+      wxWindowID id = item->GetId();
+      wxUpdateUIEvent event(id);
+      event.SetEventObject( source );
+
+      if (source->ProcessEvent(event))
+      {
+        if (event.GetSetText())
+          SetLabel(id, event.GetText());
+        if (event.GetSetChecked())
+          Check(id, event.GetChecked());
+        if (event.GetSetEnabled())
+          Enable(id, event.GetEnabled());
+      }
+
+      if (item->GetSubMenu())
+        item->GetSubMenu()->UpdateUI(source);
+    }
+    node = node->Next();
+  }
+}
+
 
diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp
index ac31501f9b..3bb8f1cea5 100644
--- a/src/gtk/window.cpp
+++ b/src/gtk/window.cpp
@@ -2727,6 +2727,8 @@ bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
 
     SetInvokingWindow( menu, this );
 
+    menu->UpdateUI();
+
     gs_pop_x = x;
     gs_pop_y = y;
 
diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp
index faa9236de7..7f42dd5e94 100644
--- a/src/gtk1/menu.cpp
+++ b/src/gtk1/menu.cpp
@@ -642,4 +642,44 @@ wxWindow *wxMenu::GetInvokingWindow()
     return m_invokingWindow;
 }
 
+// Update a menu and all submenus recursively.
+// source is the object that has the update event handlers
+// defined for it. If NULL, the menu or associated window
+// will be used.
+void wxMenu::UpdateUI(wxEvtHandler* source)
+{
+  if (!source && GetInvokingWindow())
+    source = GetInvokingWindow()->GetEventHandler();
+  if (!source)
+    source = GetEventHandler();
+  if (!source)
+    source = this;
+
+  wxNode* node = GetItems().First();
+  while (node)
+  {
+    wxMenuItem* item = (wxMenuItem*) node->Data();
+    if ( !item->IsSeparator() )
+    {
+      wxWindowID id = item->GetId();
+      wxUpdateUIEvent event(id);
+      event.SetEventObject( source );
+
+      if (source->ProcessEvent(event))
+      {
+        if (event.GetSetText())
+          SetLabel(id, event.GetText());
+        if (event.GetSetChecked())
+          Check(id, event.GetChecked());
+        if (event.GetSetEnabled())
+          Enable(id, event.GetEnabled());
+      }
+
+      if (item->GetSubMenu())
+        item->GetSubMenu()->UpdateUI(source);
+    }
+    node = node->Next();
+  }
+}
+
 
diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp
index ac31501f9b..3bb8f1cea5 100644
--- a/src/gtk1/window.cpp
+++ b/src/gtk1/window.cpp
@@ -2727,6 +2727,8 @@ bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
 
     SetInvokingWindow( menu, this );
 
+    menu->UpdateUI();
+
     gs_pop_x = x;
     gs_pop_y = y;
 
diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp
index 2ee35df7c2..959d442bb9 100644
--- a/src/motif/menu.cpp
+++ b/src/motif/menu.cpp
@@ -65,6 +65,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func)
     m_eventHandler = this;
     m_noItems = 0;
     m_menuBar = NULL;
+    m_pInvokingWindow = NULL;
     
     //// Motif-specific members
     m_numColumns = 1;
@@ -379,12 +380,50 @@ void wxMenu::ProcessCommand(wxCommandEvent & event)
     {
         processed = GetEventHandler()->ProcessEvent(event);
     }
-    /* TODO
     // Try the window the menu was popped up from (and up
     // through the hierarchy)
     if ( !processed && GetInvokingWindow())
     processed = GetInvokingWindow()->ProcessEvent(event);
-    */
+}
+
+// Update a menu and all submenus recursively.
+// source is the object that has the update event handlers
+// defined for it. If NULL, the menu or associated window
+// will be used.
+void wxMenu::UpdateUI(wxEvtHandler* source)
+{
+  if (!source && GetInvokingWindow())
+    source = GetInvokingWindow()->GetEventHandler();
+  if (!source)
+    source = GetEventHandler();
+  if (!source)
+    source = this;
+
+  wxNode* node = GetItems().First();
+  while (node)
+  {
+    wxMenuItem* item = (wxMenuItem*) node->Data();
+    if ( !item->IsSeparator() )
+    {
+      wxWindowID id = item->GetId();
+      wxUpdateUIEvent event(id);
+      event.SetEventObject( source );
+
+      if (source->ProcessEvent(event))
+      {
+        if (event.GetSetText())
+          SetLabel(id, event.GetText());
+        if (event.GetSetChecked())
+          Check(id, event.GetChecked());
+        if (event.GetSetEnabled())
+          Enable(id, event.GetEnabled());
+      }
+
+      if (item->GetSubMenu())
+        item->GetSubMenu()->UpdateUI(source);
+    }
+    node = node->Next();
+  }
 }
 
 bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
@@ -409,6 +448,10 @@ bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
     
     menu->SetId(1); /* Mark as popped-up */
     menu->CreateMenu(NULL, widget, menu);
+    menu->SetInvokingWindow(this);
+
+    menu->UpdateUI();
+
     //  menu->SetParent(parent);
     //  parent->children->Append(menu);  // Store menu for later deletion
     
diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp
index 2278e11d3f..670372224f 100644
--- a/src/msw/menu.cpp
+++ b/src/msw/menu.cpp
@@ -519,6 +519,7 @@ extern wxMenu *wxCurrentPopupMenu;
 bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
 {
   menu->SetInvokingWindow(this);
+  menu->UpdateUI();
 
   HWND hWnd = (HWND) GetHWND();
   HMENU hMenu = (HMENU)menu->m_hMenu;
@@ -945,3 +946,42 @@ WXHMENU wxMenu::GetHMenu() const
   return 0;
 }
 
+// Update a menu and all submenus recursively.
+// source is the object that has the update event handlers
+// defined for it. If NULL, the menu or associated window
+// will be used.
+void wxMenu::UpdateUI(wxEvtHandler* source)
+{
+  if (!source && GetInvokingWindow())
+    source = GetInvokingWindow()->GetEventHandler();
+  if (!source)
+    source = GetEventHandler();
+  if (!source)
+    source = this;
+
+  wxNode* node = GetItems().First();
+  while (node)
+  {
+    wxMenuItem* item = (wxMenuItem*) node->Data();
+    if ( !item->IsSeparator() )
+    {
+      wxWindowID id = item->GetId();
+      wxUpdateUIEvent event(id);
+      event.SetEventObject( source );
+
+      if (source->ProcessEvent(event))
+      {
+        if (event.GetSetText())
+          SetLabel(id, event.GetText());
+        if (event.GetSetChecked())
+          Check(id, event.GetChecked());
+        if (event.GetSetEnabled())
+          Enable(id, event.GetEnabled());
+      }
+
+      if (item->GetSubMenu())
+        item->GetSubMenu()->UpdateUI(source);
+    }
+    node = node->Next();
+  }
+}
diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp
index 6d51207e7c..0664c05837 100644
--- a/src/msw/utils.cpp
+++ b/src/msw/utils.cpp
@@ -75,6 +75,7 @@
 #include <stdarg.h>
 
 //// BEGIN for console support: VC++ only
+#ifdef __VISUALC__
 
 #include "wx/msw/msvcrt.h"
 
@@ -103,6 +104,8 @@
 #  define new new(__FILE__,__LINE__)
 #  endif
 
+#endif
+  // __VISUALC__
 /// END for console support
 
 // In the WIN.INI file
diff --git a/src/stubs/menu.cpp b/src/stubs/menu.cpp
index 1fc7c4a229..5880beab53 100644
--- a/src/stubs/menu.cpp
+++ b/src/stubs/menu.cpp
@@ -303,8 +303,51 @@ void wxMenu::ProcessCommand(wxCommandEvent & event)
 */
 }
 
+// Update a menu and all submenus recursively.
+// source is the object that has the update event handlers
+// defined for it. If NULL, the menu or associated window
+// will be used.
+void wxMenu::UpdateUI(wxEvtHandler* source)
+{
+  if (!source && GetInvokingWindow())
+    source = GetInvokingWindow()->GetEventHandler();
+  if (!source)
+    source = GetEventHandler();
+  if (!source)
+    source = this;
+
+  wxNode* node = GetItems().First();
+  while (node)
+  {
+    wxMenuItem* item = (wxMenuItem*) node->Data();
+    if ( !item->IsSeparator() )
+    {
+      wxWindowID id = item->GetId();
+      wxUpdateUIEvent event(id);
+      event.SetEventObject( source );
+
+      if (source->ProcessEvent(event))
+      {
+        if (event.GetSetText())
+          SetLabel(id, event.GetText());
+        if (event.GetSetChecked())
+          Check(id, event.GetChecked());
+        if (event.GetSetEnabled())
+          Enable(id, event.GetEnabled());
+      }
+
+      if (item->GetSubMenu())
+        item->GetSubMenu()->UpdateUI(source);
+    }
+    node = node->Next();
+  }
+}
+
 bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
 {
+    menu->SetInvokingWindow(this);
+    menu->UpdateUI();
+
     // TODO
     return FALSE;
 }
diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp
index a6a17293a5..34a5dd365c 100644
--- a/utils/dialoged/src/reseditr.cpp
+++ b/utils/dialoged/src/reseditr.cpp
@@ -54,10 +54,6 @@
 #include <strstream>
 #endif
 
-#ifdef __WXMSW__
-#include <windows.h>
-#endif
-
 #ifdef __WXMSW__
 #include "wx/help.h"
 #endif
@@ -152,12 +148,13 @@ wxResourceManager::~wxResourceManager()
 bool wxResourceManager::Initialize()
 {
   // Set up the resource filename for each platform.
+  // TODO: This shold be replaced by wxConfig usage.
 #ifdef __WXMSW__
   // dialoged.ini in the Windows directory
-  char buf[256];
-  GetWindowsDirectory(buf, 256);
-  strcat(buf, "\\dialoged.ini");
-  m_optionsResourceFilename = buf;
+  wxString windowsDir = wxGetOSDirectory();
+  windowsDir += "\\dialoged.ini" ;
+
+  m_optionsResourceFilename = windowsDir;
 #elif defined(__WXGTK__) || defined(__WXMOTIF__)
   wxGetHomeDir( &m_optionsResourceFilename );
   m_optionsResourceFilename += "/.dialogedrc";
diff --git a/utils/ogl/src/mfutils.h b/utils/ogl/src/mfutils.h
index e4b1c2c4fe..e5fe51fc2d 100644
--- a/utils/ogl/src/mfutils.h
+++ b/utils/ogl/src/mfutils.h
@@ -19,7 +19,7 @@
 
 #include <wx/metafile.h>
 
-#ifndef __WXMSW__
+#ifndef GetRValue
 #define GetRValue(rgb)	    ((unsigned char)(rgb))
 #define GetGValue(rgb)      ((unsigned char)(((int)(rgb)) >> 8))
 #define GetBValue(rgb)	    ((unsigned char)((rgb)>>16))
@@ -27,7 +27,7 @@
 
 /* Metafile Functions */
 /* Win32s/Borland need these macros, although META_SETBKCOLOR is defined */
-#if !defined(META_SETBKCOLOR) || defined(WIN32)
+#if !defined(META_SETBKCOLOR) // || defined(WIN32)
 
 #define META_SETBKCOLOR		     0x0201
 #define META_SETBKMODE		     0x0102
@@ -129,7 +129,7 @@
 
 /* PitchAndFamily family values (high 4 bits) */
 /* Win32s/Borland don't need this */
-#if !defined(__BORLANDC__) && !defined(WIN32)
+#ifndef FF_DONTCARE // !defined(__BORLANDC__) && !defined(WIN32)
 #define FF_DONTCARE         0x00
 #define FF_ROMAN            0x10
 #define FF_SWISS            0x20
-- 
2.50.0

