\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
\setfooter{\thepage}{}{}{}{}{\thepage}%
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
\setfooter{\thepage}{}{}{}{}{\thepage}%
wxWidgets is a C++ framework providing GUI (Graphical User
Interface) and other facilities on more than one platform. Version 2 currently
wxWidgets is a C++ framework providing GUI (Graphical User
Interface) and other facilities on more than one platform. Version 2 currently
platforms related to Microsoft Windows, including 16-bit and 32-bit
variants, unless otherwise stated. All trademarks are acknowledged.
platforms related to Microsoft Windows, including 16-bit and 32-bit
variants, unless otherwise stated. All trademarks are acknowledged.
wxWidgets was developed to provide a cheap and flexible way to maximize
investment in GUI application development. While a number of commercial
wxWidgets was developed to provide a cheap and flexible way to maximize
investment in GUI application development. While a number of commercial
-\item A 486 or higher PC running MS Windows.
-\item A Windows compiler: most are supported, but please see {\tt install.txt} for
-details. Supported compilers include Microsoft Visual C++ 4.0 or higher, Borland C++, Cygwin,
-MinGW, Metrowerks CodeWarrior.
-\item At least 60 MB of disk space.
+\item A 32-bit or 64-bit PC running MS Windows.
+\item A Windows compiler: MS Visual C++ (embedded Visual C++ for wxWinCE
+port), Borland C++, Watcom C++, Cygwin, MinGW, Metrowerks CodeWarrior,
+Digital Mars C++. See {\tt install.txt} for details about compiler
+version supported.
+\item At least 100 MB of disk space for source tree and additional space for
+libraries and application building (depends on compiler and build settings).
\item Almost any C++ compiler, including GNU C++ (EGCS 1.1.1 or above).
\item Almost any Unix workstation, and one of: GTK+ 1.2, GTK+ 2.0, Motif 1.2 or higher, Lesstif.
If using the wxX11 port, no such widget set is required.
\item Almost any C++ compiler, including GNU C++ (EGCS 1.1.1 or above).
\item Almost any Unix workstation, and one of: GTK+ 1.2, GTK+ 2.0, Motif 1.2 or higher, Lesstif.
If using the wxX11 port, no such widget set is required.
\begin{enumerate}\itemsep=0pt
\item A PowerPC Mac running Mac OS 8.6/9.x (eg. Classic) or Mac OS X 10.x.
\item CodeWarrior 5.3, 6 or 7 for Classic Mac OS.
\begin{enumerate}\itemsep=0pt
\item A PowerPC Mac running Mac OS 8.6/9.x (eg. Classic) or Mac OS X 10.x.
\item CodeWarrior 5.3, 6 or 7 for Classic Mac OS.
-\item The Apple Developer Tools (eg. GNU C++) or CodeWarrior 7 for Mac OS X.
-\item At least 60 MB of disk space.
+\item The Apple Developer Tools (eg. GNU C++), CodeWarrior 7 or above for Mac OS X.
+\item At least 100 MB of disk space for source tree and additional space for
+libraries and application building (depends on compiler and build settings).
\winhelponly{wxWidgets is available by anonymous FTP and World Wide Web
from ftp://biolpc22.york.ac.uk/pub and/or http://www.wxwidgets.org.}
\winhelponly{wxWidgets is available by anonymous FTP and World Wide Web
from ftp://biolpc22.york.ac.uk/pub and/or http://www.wxwidgets.org.}
Thanks are due to AIAI for being willing to release the original version of
wxWidgets into the public domain, and to our patient partners.
Thanks are due to AIAI for being willing to release the original version of
wxWidgets into the public domain, and to our patient partners.
Thomas Fettig, Matthew Flatt, Pasquale Foggia, Josep Fortiana, Todd Fries,
Dominic Gallagher, Guillermo Rodriguez Garcia, Wolfram Gloger, Norbert Grotz,
Stefan Gunter, Bill Hale, Patrick Halke, Stefan Hammes, Guillaume Helle,
Thomas Fettig, Matthew Flatt, Pasquale Foggia, Josep Fortiana, Todd Fries,
Dominic Gallagher, Guillermo Rodriguez Garcia, Wolfram Gloger, Norbert Grotz,
Stefan Gunter, Bill Hale, Patrick Halke, Stefan Hammes, Guillaume Helle,
-Harco de Hilster, Cord Hockemeyer, Markus Holzem, Olaf Klein, Leif Jensen,
+Harco de Hilster, Kevin Hock, Cord Hockemeyer, Markus Holzem, Olaf Klein, Leif Jensen,
Bart Jourquin, Guilhem Lavaux, Ron Lee, Jan Lessner, Nicholas Liebmann,
Torsten Liermann, Per Lindqvist, Thomas Runge, Tatu M\"{a}nnist\"{o},
Bart Jourquin, Guilhem Lavaux, Ron Lee, Jan Lessner, Nicholas Liebmann,
Torsten Liermann, Per Lindqvist, Thomas Runge, Tatu M\"{a}nnist\"{o},
-Scott Maxwell, Thomas Myers, Oliver Niedung, Stefan Neis, Hernan Otero,
+Scott Maxwell, Thomas Myers, Oliver Niedung, Stefan Neis, Ryan Norton, Hernan Otero,
Ian Perrigo, Timothy Peters, Giordano Pezzoli, Harri Pasanen, Thomaso Paoletti,
Garrett Potts, Marcel Rasche, Robert Roebling, Dino Scaringella,
Jobst Schmalenbach, Arthur Seaton, Paul Shirley, Wlodzimierz `ABX' Skiba,
Ian Perrigo, Timothy Peters, Giordano Pezzoli, Harri Pasanen, Thomaso Paoletti,
Garrett Potts, Marcel Rasche, Robert Roebling, Dino Scaringella,
Jobst Schmalenbach, Arthur Seaton, Paul Shirley, Wlodzimierz `ABX' Skiba,
see the file install.txt for up-to-date installation instructions, and
changes.txt for differences between versions.
see the file install.txt for up-to-date installation instructions, and
changes.txt for differences between versions.
The file {\tt "wx/wxprec.h"} includes {\tt "wx/wx.h"}. Although this incantation
may seem quirky, it is in fact the end result of a lot of experimentation,
The file {\tt "wx/wxprec.h"} includes {\tt "wx/wx.h"}. Although this incantation
may seem quirky, it is in fact the end result of a lot of experimentation,
-and several Windows compilers to use precompilation (those tested are Microsoft Visual C++, Borland C++
-and Watcom C++).
+and several Windows compilers to use precompilation which is largely automatic for
+compilers with necessary support. Currently it is used for Visual C++ (including
+embedded Visual C++), Borland C++, Open Watcom C++, Digital Mars C++
+and newer versions of GCC.
+Some compilers might need extra work from the application developer to set the
+build environment up as necessary for the support.
-Borland precompilation is largely automatic. Visual C++ requires specification of {\tt "wx/wxprec.h"} as
-the file to use for precompilation. Watcom C++ is automatic apart from the specification of
-the .pch file. Watcom C++ is strange in requiring the precompiled header to be used only for
-object files compiled in the same directory as that in which the precompiled header was created.
-Therefore, the wxWidgets Watcom C++ makefiles go through hoops deleting and recreating
-a single precompiled header file for each module, thus preventing an accumulation of many
-multi-megabyte .pch files.
-
-\section{Libraries}
+\section{Libraries}\label{libraries}
Most ports of wxWidgets can create either a static library or a shared
library. wxWidgets can also be built in multilib and monolithic variants.
See the \helpref{libraries list}{librarieslist} for more
information on these.
Most ports of wxWidgets can create either a static library or a shared
library. wxWidgets can also be built in multilib and monolithic variants.
See the \helpref{libraries list}{librarieslist} for more
information on these.
When using project files and makefiles directly to build wxWidgets,
options are configurable in the file
When using project files and makefiles directly to build wxWidgets,
options are configurable in the file
for installing wxWidgets on Linux, a correct setup.h is shipped in the package and
this must not be changed.
for installing wxWidgets on Linux, a correct setup.h is shipped in the package and
this must not be changed.
On Microsoft Windows, wxWidgets has a different set of makefiles for each
compiler, because each compiler's 'make' tool is slightly different.
On Microsoft Windows, wxWidgets has a different set of makefiles for each
compiler, because each compiler's 'make' tool is slightly different.
please see docs/xxx/install.txt in your distribution, where
xxx is the platform of interest, such as msw, gtk, x11, mac.
please see docs/xxx/install.txt in your distribution, where
xxx is the platform of interest, such as msw, gtk, x11, mac.
-wxWidgets application compilation under MS Windows requires at least two
-extra files, resource and module definition files.
+wxWidgets application compilation under MS Windows requires at least one
+extra file: a resource file.
so programs that search your executable for icons (such
as the Program Manager) find your application icon first.}
so programs that search your executable for icons (such
as the Program Manager) find your application icon first.}
In general, classes derived from wxWindow must dynamically allocated
with {\it new} and deleted with {\it delete}. If you delete a window,
In general, classes derived from wxWindow must dynamically allocated
with {\it new} and deleted with {\it delete}. If you delete a window,
a drawing object that may be in use. Code that doesn't do this will probably work
fine on some platforms, and then fail under Windows.
a drawing object that may be in use. Code that doesn't do this will probably work
fine on some platforms, and then fail under Windows.
A problem which sometimes arises from writing multi-platform programs is that
the basic C types are not defined the same on all platforms. This holds true
A problem which sometimes arises from writing multi-platform programs is that
the basic C types are not defined the same on all platforms. This holds true
The macros handling bit-swapping with respect to the applications endianness
are described in the \helpref{Byte order macros}{byteordermacros} section.
The macros handling bit-swapping with respect to the applications endianness
are described in the \helpref{Byte order macros}{byteordermacros} section.
One of the purposes of wxWidgets is to reduce the need for conditional
compilation in source code, which can be messy and confusing to follow.
One of the purposes of wxWidgets is to reduce the need for conditional
compilation in source code, which can be messy and confusing to follow.
listed in the file {\tt symbols.txt} may be used for this purpose,
along with any user-supplied ones.
listed in the file {\tt symbols.txt} may be used for this purpose,
along with any user-supplied ones.
wxWidgets does not use templates (except for some advanced features that
are switched off by default) since it is a notoriously unportable feature.
wxWidgets does not use templates (except for some advanced features that
are switched off by default) since it is a notoriously unportable feature.
wxWidgets does not use C++ run-time type information since wxWidgets provides
its own run-time type information system, implemented using macros.
wxWidgets does not use C++ run-time type information since wxWidgets provides
its own run-time type information system, implemented using macros.
Some compilers (e.g. the native IRIX cc) define NULL to be 0L so that
no conversion to pointers is allowed. Because of that, all these
Some compilers (e.g. the native IRIX cc) define NULL to be 0L so that
no conversion to pointers is allowed. Because of that, all these
It is recommended to adhere to this in all code using wxWidgets as
this make the code (a bit) more portable.
It is recommended to adhere to this in all code using wxWidgets as
this make the code (a bit) more portable.
Some compilers, such as Borland C++ and Microsoft C++, support
precompiled headers. This can save a great deal of compiling time. The
Some compilers, such as Borland C++ and Microsoft C++, support
precompiled headers. This can save a great deal of compiling time. The
When building an application which may be used under different
environments, one difficulty is coping with documents which may be
When building an application which may be used under different
environments, one difficulty is coping with documents which may be
\item[{\bf XRC resource system}]
This is the sizer-aware resource system, and uses
XML-based resource specifications that can be generated by tools
\item[{\bf XRC resource system}]
This is the sizer-aware resource system, and uses
XML-based resource specifications that can be generated by tools
-such as \urlref{wxDesigner}{http://www.roebling.de} and XRC's own wxrcedit.
-You can find this in {\tt contrib/src/xrc}, {\tt contrib/include/wx/xrc}, {\tt contrib/samples/xrc}, and {\tt contrib/utils/wxrcedit}.
+such as \urlref{wxDesigner}{http://www.roebling.de}.
+You can find this in {\tt src/xrc}, {\tt include/wx/xrc}, {\tt samples/xrc}.
For more information, see the \helpref{XML-based resource system overview}{xrcoverview}.
\item[{\bf Object Graphics Library}]
OGL defines an API for applications that need to display objects connected by lines.
For more information, see the \helpref{XML-based resource system overview}{xrcoverview}.
\item[{\bf Object Graphics Library}]
OGL defines an API for applications that need to display objects connected by lines.
writing and debugging wxWidgets programs. If you have any good tips,
please submit them for inclusion here.
writing and debugging wxWidgets programs. If you have any good tips,
please submit them for inclusion here.
Although I haven't done this myself within wxWidgets, it is good
practice to use ASSERT statements liberally, that check for conditions that
Although I haven't done this myself within wxWidgets, it is good
practice to use ASSERT statements liberally, that check for conditions that
and your application. Using ASSERT is an example of `defensive programming':
it can alert you to problems later on.
and your application. Using ASSERT is an example of `defensive programming':
it can alert you to problems later on.
Using wxString can be much safer and more convenient than using char *.
Again, I haven't practiced what I'm preaching, but I'm now trying to use
Using wxString can be much safer and more convenient than using char *.
Again, I haven't practiced what I'm preaching, but I'm now trying to use
Don't use absolute panel item positioning if you can avoid it. Different GUIs have
very differently sized panel items. Consider using the constraint system, although this
Don't use absolute panel item positioning if you can avoid it. Different GUIs have
very differently sized panel items. Consider using the constraint system, although this
Use .xrc (wxWidgets resource files) where possible, because they can be easily changed
independently of source code.
\section{Strategies for debugging}\label{debugstrategies}
Use .xrc (wxWidgets resource files) where possible, because they can be easily changed
independently of source code.
\section{Strategies for debugging}\label{debugstrategies}
It is common to blow up the problem in one's imagination, so that it seems to threaten
weeks, months or even years of work. The problem you face may seem insurmountable:
It is common to blow up the problem in one's imagination, so that it seems to threaten
weeks, months or even years of work. The problem you face may seem insurmountable:
Reduce the code exhibiting the problem to the smallest program possible
that exhibits the problem. If it is not possible to reduce a large and
Reduce the code exhibiting the problem to the smallest program possible
that exhibits the problem. If it is not possible to reduce a large and
to the problem. In some cases though, such as memory leaks or wrong
deallocation, this can still give totally spurious results!
to the problem. In some cases though, such as memory leaks or wrong
deallocation, this can still give totally spurious results!
This sounds like facetious advice, but it is surprising how often people
don't use a debugger. Often it is an overhead to install or learn how to
use a debugger, but it really is essential for anything but the most
trivial programs.
This sounds like facetious advice, but it is surprising how often people
don't use a debugger. Often it is an overhead to install or learn how to
use a debugger, but it really is essential for anything but the most
trivial programs.
There is a variety of logging functions that you can use in your program:
see \helpref{Logging functions}{logfunctions}.
There is a variety of logging functions that you can use in your program:
see \helpref{Logging functions}{logfunctions}.
in some circumstances (such as when your debugger doesn't support a lot
of debugging code, or you wish to print a bunch of variables).
in some circumstances (such as when your debugger doesn't support a lot
of debugging code, or you wish to print a bunch of variables).
You can use wxDebugContext to check for
memory leaks and corrupt memory: in fact in debugging mode, wxWidgets will
You can use wxDebugContext to check for
memory leaks and corrupt memory: in fact in debugging mode, wxWidgets will