X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc2171bd4c660b8554dae2a1cbf34ff09f3032a6..6294ac2e91af3408cfa04910b90ad7ace94f1220:/docs/latex/wx/body.tex diff --git a/docs/latex/wx/body.tex b/docs/latex/wx/body.tex index a7d2c80d38..001cb8bd7b 100644 --- a/docs/latex/wx/body.tex +++ b/docs/latex/wx/body.tex @@ -3,7 +3,7 @@ \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% \setfooter{\thepage}{}{}{}{}{\thepage}% -\section{What is wxWidgets?} +\section{What is wxWidgets?}\label{whatis} wxWidgets is a C++ framework providing GUI (Graphical User Interface) and other facilities on more than one platform. Version 2 currently @@ -23,7 +23,7 @@ Please note that in the following, ``MS Windows" often refers to all platforms related to Microsoft Windows, including 16-bit and 32-bit variants, unless otherwise stated. All trademarks are acknowledged. -\section{Why another cross-platform development tool?} +\section{Why another cross-platform development tool?}\label{why} wxWidgets was developed to provide a cheap and flexible way to maximize investment in GUI application development. While a number of commercial @@ -166,7 +166,7 @@ If using the wxX11 port, no such widget set is required. \item At least 60 MB of disk space. \end{enumerate} -\section{Availability and location of wxWidgets} +\section{Availability and location of wxWidgets}\label{where} \winhelponly{wxWidgets is available by anonymous FTP and World Wide Web from ftp://biolpc22.york.ac.uk/pub and/or http://www.wxwidgets.org.} @@ -176,7 +176,7 @@ and/or \urlref{http://www.wxwidgets.org}{http://www.wxwidgets.org}.} You can also buy a CD-ROM using the form on the Web site. -\section{Acknowledgements} +\section{Acknowledgements}\label{acknowledgements} Thanks are due to AIAI for being willing to release the original version of wxWidgets into the public domain, and to our patient partners. @@ -184,14 +184,26 @@ wxWidgets into the public domain, and to our patient partners. We would particularly like to thank the following for their contributions to wxWidgets, and the many others who have been involved in the project over the years. Apologies for any unintentional omissions from this list. -Yiorgos Adamopoulos, Jamshid Afshar, Alejandro Aguilar-Sierra, AIAI, Patrick Albert, Karsten Ballueder, Michael Bedward, Kai Bendorf, Yura Bidus, Keith -Gary Boyce, Chris Breeze, Pete Britton, Ian Brown, C. Buckley, Dmitri Chubraev, Robin Corbet, Cecil Coupe, Andrew Davison, Neil Dudman, Robin -Dunn, Hermann Dunkel, Jos van Eijndhoven, Tom Felici, 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, Bart Jourquin, Guilhem Lavaux, 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, Ian Perrigo, Timothy Peters, Giordano Pezzoli, Harri Pasanen, Thomaso Paoletti, -Garrett Potts, Marcel Rasche, Robert Roebling, Dino Scaringella, Jobst Schmalenbach, Arthur Seaton, Paul Shirley, Vaclav Slavik, Stein Somers, Petr Smilauer, Neil Smith, -Kari Syst\"{a}, Arthur Tetzlaff-Deas, Jonathan Tonberg, Jyrki Tuomi, David Webster, Janos Vegh, Andrea Venturoli, Vadim Zeitlin, Xiaokun Zhu, Edward Zimmermann. +Yiorgos Adamopoulos, Jamshid Afshar, Alejandro Aguilar-Sierra, AIAI, +Patrick Albert, Karsten Ballueder, Mattia Barbon, Michael Bedward, +Kai Bendorf, Yura Bidus, Keith Gary Boyce, Chris Breeze, Pete Britton, +Ian Brown, C. Buckley, Marco Cavallini, Dmitri Chubraev, Robin Corbet, Cecil Coupe, +Stefan Csomor, Andrew Davison, Gilles Depeyrot, Neil Dudman, Robin Dunn, +Hermann Dunkel, Jos van Eijndhoven, Chris Elliott, David Elliott, Tom Felici, +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, +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, +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, +Vaclav Slavik, Julian Smart, Stein Somers, Petr Smilauer, Neil Smith, +Kari Syst\"{a}, George Tasker, Arthur Tetzlaff-Deas, Jonathan Tonberg, +Jyrki Tuomi, Janos Vegh, Andrea Venturoli, David Webster, Otto Wyss, +Vadim Zeitlin, Xiaokun Zhu, Edward Zimmermann. `Graphplace', the basis for the wxGraphLayout library, is copyright Dr. Jos T.J. van Eijndhoven of Eindhoven University of Technology. The code has @@ -220,7 +232,7 @@ This chapter describes the practical details of using wxWidgets. Please see the file install.txt for up-to-date installation instructions, and changes.txt for differences between versions. -\section{Include files} +\section{Include files}\label{includefiles} The main include file is {\tt "wx/wx.h"}; this includes the most commonly used modules of wxWidgets. @@ -258,14 +270,14 @@ Therefore, the wxWidgets Watcom C++ makefiles go through hoops deleting and recr 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. -\section{Configuration} +\section{Configuration}\label{configuration} When using project files and makefiles directly to build wxWidgets, options are configurable in the file @@ -280,7 +292,7 @@ along with suitable makefiles. When using the RPM packages for installing wxWidgets on Linux, a correct setup.h is shipped in the package and this must not be changed. -\section{Makefiles} +\section{Makefiles}\label{makefiles} On Microsoft Windows, wxWidgets has a different set of makefiles for each compiler, because each compiler's 'make' tool is slightly different. @@ -311,7 +323,7 @@ For details on using makefiles, configure, and project files, please see docs/xxx/install.txt in your distribution, where xxx is the platform of interest, such as msw, gtk, x11, mac. -\section{Windows-specific files} +\section{Windows-specific files}\label{windowsfiles} wxWidgets application compilation under MS Windows requires at least two extra files, resource and module definition files. @@ -339,7 +351,7 @@ the MS Windows SDK documentation. so programs that search your executable for icons (such as the Program Manager) find your application icon first.} -\section{Allocating and deleting wxWidgets objects} +\section{Allocating and deleting wxWidgets objects}\label{allocatingobjects} In general, classes derived from wxWindow must dynamically allocated with {\it new} and deleted with {\it delete}. If you delete a window, @@ -369,7 +381,7 @@ make calls like wxDC::SetPen(wxNullPen) or wxDC::SelectObject(wxNullBitmap) befo 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. -\section{Architecture dependency} +\section{Architecture dependency}\label{architecturedependency} 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 @@ -389,7 +401,7 @@ as well). The macros handling bit-swapping with respect to the applications endianness are described in the \helpref{Byte order macros}{byteordermacros} section. -\section{Conditional compilation} +\section{Conditional compilation}\label{conditionalcompilation} 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. @@ -398,21 +410,21 @@ features (such as metafile use under MS Windows). The symbols listed in the file {\tt symbols.txt} may be used for this purpose, along with any user-supplied ones. -\section{C++ issues} +\section{C++ issues}\label{cpp} The following documents some miscellaneous C++ issues. -\subsection{Templates} +\subsection{Templates}\label{templates} wxWidgets does not use templates (except for some advanced features that are switched off by default) since it is a notoriously unportable feature. -\subsection{RTTI} +\subsection{RTTI}\label{rtti} wxWidgets does not use C++ run-time type information since wxWidgets provides its own run-time type information system, implemented using macros. -\subsection{Type of NULL} +\subsection{Type of NULL}\label{null} 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 @@ -428,7 +440,7 @@ as It is recommended to adhere to this in all code using wxWidgets as this make the code (a bit) more portable. -\subsection{Precompiled headers} +\subsection{Precompiled headers}\label{precompiledheaders} Some compilers, such as Borland C++ and Microsoft C++, support precompiled headers. This can save a great deal of compiling time. The @@ -454,7 +466,7 @@ the optimal compilation for each compiler, although it is biased towards the precompiled headers facility available in Microsoft C++. -\section{File handling} +\section{File handling}\label{filehandling} When building an application which may be used under different environments, one difficulty is coping with documents which may be @@ -575,9 +587,9 @@ This chapter is intended to list strategies that may be useful when writing and debugging wxWidgets programs. If you have any good tips, please submit them for inclusion here. -\section{Strategies for reducing programming errors} +\section{Strategies for reducing programming errors}\label{reducingerrors} -\subsection{Use ASSERT} +\subsection{Use ASSERT}\label{useassert} Although I haven't done this myself within wxWidgets, it is good practice to use ASSERT statements liberally, that check for conditions that @@ -586,7 +598,7 @@ These can be compiled out of a non-debugging version of wxWidgets and your application. Using ASSERT is an example of `defensive programming': it can alert you to problems later on. -\subsection{Use wxString in preference to character arrays} +\subsection{Use wxString in preference to character arrays}\label{usewxstring} 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 @@ -598,9 +610,9 @@ manipulation (which means less code). The same goes for other data types: use classes wherever possible. -\section{Strategies for portability} +\section{Strategies for portability}\label{portability} -\subsection{Use relative positioning or constraints} +\subsection{Use relative positioning or constraints}\label{userelativepositioning} 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 @@ -610,14 +622,14 @@ Alternatively, you could use alternative .wrc (wxWidgets resource files) on diff platforms, with slightly different dimensions in each. Or space your panel items out to avoid problems. -\subsection{Use wxWidgets resource files} +\subsection{Use wxWidgets resource files}\label{useresources} Use .xrc (wxWidgets resource files) where possible, because they can be easily changed independently of source code. \section{Strategies for debugging}\label{debugstrategies} -\subsection{Positive thinking} +\subsection{Positive thinking}\label{positivethinking} 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: @@ -631,7 +643,7 @@ you will probably wonder why you worried so much. That's not to say it isn't painful at the time. Try not to worry -- there are many more important things in life. -\subsection{Simplify the problem} +\subsection{Simplify the problem}\label{simplifyproblem} 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 @@ -644,14 +656,14 @@ to go from functioning to non-functioning state. This should give a clue to the problem. In some cases though, such as memory leaks or wrong deallocation, this can still give totally spurious results! -\subsection{Use a debugger} +\subsection{Use a debugger}\label{usedebugger} 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. -\subsection{Use logging functions} +\subsection{Use logging functions}\label{uselogging} There is a variety of logging functions that you can use in your program: see \helpref{Logging functions}{logfunctions}. @@ -660,7 +672,7 @@ Using tracing statements may be more convenient than using the debugger 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). -\subsection{Use the wxWidgets debugging facilities} +\subsection{Use the wxWidgets debugging facilities}\label{usedebuggingfacilities} You can use wxDebugContext to check for memory leaks and corrupt memory: in fact in debugging mode, wxWidgets will