moved 1.6X -> 2.X porting manual to main book
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Before Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 109 B |
@ -1,16 +0,0 @@
|
||||
[OPTIONS]
|
||||
TITLE=wxWindows Porting Guide
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
||||
[FILES]
|
||||
porting.rtf
|
||||
|
||||
[CONFIG]
|
||||
CreateButton("Up", "&Up", "JumpId(`porting.hlp', `Contents')")
|
||||
BrowseButtons()
|
||||
|
||||
[MAP]
|
||||
|
||||
[BITMAPS]
|
||||
|
@ -1,28 +0,0 @@
|
||||
;;; Tex2RTF initialisation file for 16-bit Winhelp
|
||||
runTwice = yes
|
||||
titleFontSize = 12
|
||||
authorFontSize = 10
|
||||
authorFontSize = 10
|
||||
chapterFontSize = 12
|
||||
sectionFontSize = 12
|
||||
subsectionFontSize = 12
|
||||
contentsDepth = 2
|
||||
headerRule = yes
|
||||
footerRule = yes
|
||||
useHeadingStyles = yes
|
||||
listItemIndent=40
|
||||
generateHPJ = no
|
||||
htmlBrowseButtons = bitmap
|
||||
winHelpContents = yes
|
||||
winHelpVersion = 3 ; 3 for Windows 3.x, 4 for Windows 95
|
||||
winHelpTitle = "wxWindows Porting Guide"
|
||||
truncateFilenames = yes
|
||||
combineSubSections = yes
|
||||
\overview [2] {\rtfonly{See also }\settransparency{on}\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}\settransparency{off}}
|
||||
\htmlonly{\image{}{books.gif}}\helpref{#1}{#2}
|
||||
\sethotspotcolour{on}\sethotspotunderline{on}}
|
||||
\docparam [2]{\parskip{0}{\it #1}\par\parskip{10}\indented{1cm}{#2}}
|
||||
\wxheading [1]{{\bf \fcol{blue}{#1}}}
|
||||
\const [0] {{\bf const}}
|
||||
\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
|
||||
|
@ -1,289 +0,0 @@
|
||||
% LaTeX style file
|
||||
% Name: texhelp.sty
|
||||
% Author: Julian Smart
|
||||
%
|
||||
% Purpose
|
||||
% -------
|
||||
% Style file to enable the simultaneous preparation of printed LaTeX and on-line
|
||||
% hypertext manuals.
|
||||
% Use in conjunction with Tex2RTF (see Tex2RTF documentation).
|
||||
%
|
||||
% Note that if a non-ASCII character starts a newline and there should be a space
|
||||
% between the last word on the previous line and the first word on this line,
|
||||
% you need to use \rtfsp to generate a space in Windows Help. \rtfsp is ignored
|
||||
% in all other formats.
|
||||
%
|
||||
% Julian Smart
|
||||
% Artificial Intelligence Applications Institute
|
||||
%
|
||||
%
|
||||
% ============== C++/CLIPS Documentation Facilities ==============
|
||||
%
|
||||
% Each class definition should be typeset with e.g.
|
||||
%
|
||||
% \section{\class{Name}: Parent}
|
||||
%
|
||||
% followed by a description of the class.
|
||||
% Each member should follow:
|
||||
%
|
||||
% \membersection{wxName::Member}
|
||||
%
|
||||
% with a description of what this member does.
|
||||
% Then, one (or more if overloaded) member (function) in detail:
|
||||
%
|
||||
% \func{return type}{name}{args}
|
||||
% or
|
||||
% \member{type}{name}
|
||||
%
|
||||
% where args is a list of \param{type}{name}, ...
|
||||
|
||||
% Function, e.g.
|
||||
% e.g. to typeset
|
||||
%
|
||||
% void DoIt(char *string);
|
||||
%
|
||||
% write:
|
||||
%
|
||||
% \func{void}{DoIt}{\param{char *}{string}}
|
||||
%
|
||||
|
||||
\newcommand{\func}[3]{\hangafter=1\noindent\hangindent=10mm
|
||||
{{\it #1} {\bf #2}\index{#2}}(#3)}
|
||||
|
||||
% For function/type definition where the name is a pointer,
|
||||
% e.g. to typeset
|
||||
%
|
||||
% typedef void (*wxFunction)(wxObject&)
|
||||
%
|
||||
% write:
|
||||
%
|
||||
% \pfunc{typedef void}{wxFunction}{param{wxObject&}}
|
||||
|
||||
\newcommand{\pfunc}[3]{\hangafter=1\noindent\hangindent=10mm
|
||||
{{\it #1} ({\bf *#2})\index{#2}}(#3)}
|
||||
|
||||
% Use an ordinary \section command for class name definitions.
|
||||
|
||||
% This is used for a member, such as wxBitmap: GetDepth
|
||||
\newcommand{\membersection}[1]{\subsection*{#1}\index{#1}}
|
||||
|
||||
% CLIPS function
|
||||
\newcommand{\clipsfunc}[3]{\hangafter=1\noindent\hangindent=10mm
|
||||
{{\bf #1} ({\bf #2}\index{#2}}#3)}
|
||||
|
||||
\newcommand{\clipssection}[1]{\chapter{#1}}
|
||||
|
||||
% This is used for a CLIPS function name
|
||||
\newcommand{\functionsection}[1]{\subsection*{#1}}
|
||||
|
||||
% Member: a type and a name
|
||||
\newcommand{\member}[2]{{\bf #1 \it #2}}
|
||||
|
||||
% C++ Parameter: a type and a name (no intervening space)
|
||||
\newcommand{\param}[2]{{\it #1}{\bf #2}}
|
||||
|
||||
% CLIPS Parameter: a type and a name (one intervening space)
|
||||
\newcommand{\cparam}[2]{{\bf #1} {\it #2}}
|
||||
|
||||
% Class: puts in index
|
||||
\newcommand{\class}[1]{#1\index{#1}}
|
||||
|
||||
% Void type
|
||||
\newcommand{\void}{{\it void}}
|
||||
|
||||
% Typeset destructor
|
||||
\newcommand{\destruct}[1]{{$\sim$}#1}
|
||||
|
||||
% Typeset insert/extract operators
|
||||
\newcommand{\cinsert}{$<<$}
|
||||
\newcommand{\cextract}{$>>$}
|
||||
|
||||
|
||||
% =================== Hypertext facilities ===================
|
||||
%
|
||||
% To insert hyperlinks (or references, in Latex), \label the sections
|
||||
% or membersections \label{ref-label} immediately after the section, on the same line,
|
||||
% and use \helpref{text-to-show}{ref-label} to make a reference.
|
||||
%
|
||||
|
||||
% Type text with section reference
|
||||
\newcommand{\helpref}[2]{{\it #1} (p.\ \pageref{#2}) }
|
||||
|
||||
% Type text with URL in verbatim mode
|
||||
\newcommand{\urlref}[2]{#1 (\verb$#2$)}
|
||||
|
||||
% Don't typeset section number in LaTeX
|
||||
\newcommand{\helprefn}[2]{{\it #1}}
|
||||
|
||||
% Like helpref, but popup text in WinHelp instead of hyperlinked
|
||||
\newcommand{\popref}[2]{{\it #1}}
|
||||
|
||||
% Like footnote, but popup text.
|
||||
\newcommand{\footnotepopup}[2]{{\it #1}\footnote{#2}}
|
||||
|
||||
% =================== On-line help specific macros ===================
|
||||
%
|
||||
|
||||
% Global document font size/family, help only.
|
||||
\newcommand{\helpfontsize}[1]{}
|
||||
\newcommand{\helpfontfamily}[1]{}
|
||||
|
||||
% Ignore in all on-line help
|
||||
\newcommand{\helpignore}[1]{#1}
|
||||
% Only print in all on-line help
|
||||
\newcommand{\helponly}[1]{}
|
||||
|
||||
% Ignore in LaTeX
|
||||
\newcommand{\latexignore}[1]{}
|
||||
% Only print in LaTeX
|
||||
\newcommand{\latexonly}[1]{#1}
|
||||
|
||||
% Ignore in linear RTF
|
||||
\newcommand{\rtfignore}[1]{#1}
|
||||
% Only print in linear RTF
|
||||
\newcommand{\rtfonly}[1]{}
|
||||
|
||||
% Ignore in WinHelp RTF
|
||||
\newcommand{\winhelpignore}[1]{#1}
|
||||
% Only print in WinHelp RTF
|
||||
\newcommand{\winhelponly}[1]{}
|
||||
|
||||
% Ignore in wxHelp
|
||||
\newcommand{\xlpignore}[1]{#1}
|
||||
% Only print in wxHelp
|
||||
\newcommand{\xlponly}[1]{}
|
||||
|
||||
% Ignore in HTML
|
||||
\newcommand{\htmlignore}[1]{#1}
|
||||
% Only print in HTML
|
||||
\newcommand{\htmlonly}[1]{}
|
||||
|
||||
% Input a file only for help system (binder thickness is not a limitation
|
||||
% in help systems!)
|
||||
\newcommand{\helpinput}[1]{}
|
||||
|
||||
\newcommand{\rtfsp}{ } % Force a space in RTF, ignore in Latex
|
||||
|
||||
% =================== Miscellaneous macros ===================
|
||||
%
|
||||
% Headings consistent with generated ones
|
||||
\newcommand{\myheading}[1]{\vspace*{25pt}
|
||||
\begin{flushleft}
|
||||
{\LARGE \bf #1}
|
||||
\end{flushleft}
|
||||
\vskip 20pt
|
||||
}
|
||||
|
||||
% Heading with entry in contents page.
|
||||
\newcommand{\chapterheading}[1]{\myheading{#1}
|
||||
\addcontentsline{toc}{chapter}{#1}}
|
||||
|
||||
\newcommand{\sectionheading}[1]{\myheading{#1}
|
||||
\addcontentsline{toc}{section}{#1}}
|
||||
|
||||
% Glossary environment
|
||||
\newenvironment{helpglossary}{\newpage\chapterheading{Glossary}\begin{description}}{\end{description}}
|
||||
|
||||
% Glossary entry
|
||||
\newcommand{\gloss}[1]{\item[#1]\index{#1}}
|
||||
|
||||
% Image: EPS in Latex, BMP or MF (whatever's available) in RTF. Requires psbox.
|
||||
\newcommand{\image}[2]{\psboxto(#1){#2}}
|
||||
|
||||
% Image, left aligned (HTML)
|
||||
\newcommand{\imager}[2]{\psboxto(#1){#2}}
|
||||
|
||||
% Image, right aligned (HTML)
|
||||
\newcommand{\imagel}[2]{\psboxto(#1){#2}}
|
||||
|
||||
% Imagemap: principally for HTML only. In Latex,
|
||||
% acts like \image.
|
||||
\newcommand{\imagemap}[3]{\psboxto(#1){#2}}
|
||||
|
||||
% Headers and footers
|
||||
% \setheader{EvenPageLeft}{EvenPageCentre}{EvenPageRight}
|
||||
% {OddPageLeft}{OddPageCentre}{OddPageRight}
|
||||
\newcommand{\setheader}[6]{
|
||||
\lhead[\fancyplain{}{#1}]{\fancyplain{}{#4}}
|
||||
\chead[\fancyplain{}{#2}]{\fancyplain{}{#5}}
|
||||
\rhead[\fancyplain{}{#3}]{\fancyplain{}{#6}}
|
||||
}
|
||||
|
||||
% \setfooter{EvenPageLeft}{EvenPageCentre}{EvenPageRight}
|
||||
% {OddPageLeft}{OddPageCentre}{OddPageRight}
|
||||
\newcommand{\setfooter}[6]{
|
||||
\lfoot[\fancyplain{#1}{#1}]{\fancyplain{#4}{#4}}
|
||||
\cfoot[\fancyplain{#2}{#2}]{\fancyplain{#5}{#5}}
|
||||
\rfoot[\fancyplain{#3}{#3}]{\fancyplain{#6}{#6}}
|
||||
}
|
||||
|
||||
% Needed for telling RTF where margin paragraph should go
|
||||
% in mirrored margins mode.
|
||||
\newcommand{\marginpareven}[1]{\hspace*{0pt}\marginpar{#1}}
|
||||
\newcommand{\marginparodd}[1]{\hspace*{0pt}\marginpar{#1}}
|
||||
|
||||
% Environment for two-column table popular in WinHelp and manuals.
|
||||
\newcommand{\twocolwidtha}[1]{\def\twocolwidthaval{#1}}
|
||||
\newcommand{\twocolwidthb}[1]{\def\twocolwidthbval{#1}}
|
||||
\newcommand{\twocolspacing}[1]{\def\twocolspacingval{#1}}
|
||||
|
||||
\twocolwidtha{3cm}
|
||||
\twocolwidthb{8.5cm}
|
||||
\twocolspacing{2}
|
||||
|
||||
\newcommand{\twocolitem}[2]{#1 & #2\\}
|
||||
\newcommand{\twocolitemruled}[2]{#1 & #2\\\hline}
|
||||
|
||||
\newenvironment{twocollist}{\renewcommand{\arraystretch}{\twocolspacingval}\begin{tabular}{lp{\twocolwidthbval}}}%
|
||||
{\end{tabular}\renewcommand{\arraystretch}{1}}
|
||||
|
||||
% Specifying table rows for RTF compatibility
|
||||
\newcommand{\row}[1]{#1\\}
|
||||
|
||||
% Use for the last ruled row for correct RTF generation.
|
||||
\newcommand{\ruledrow}[1]{#1\\\hline}
|
||||
|
||||
% Indentation environment. Arg1 is left margin size
|
||||
\newenvironment{indented}[1]{\begin{list}{}{\leftmargin=#1}\item[]}%
|
||||
{\end{list}}
|
||||
|
||||
% Framed box of text, normal formatting.
|
||||
\newcommand{\normalbox}[1]{\fbox{\vbox{#1}}}
|
||||
% Double-framed box of text.
|
||||
\newcommand{\normalboxd}[1]{\fbox{\fbox{\vbox{#1}}}}
|
||||
|
||||
% WITHDRAWN -- can't do in RTF, easily.
|
||||
% Framed box of text, horizontally centred. Ragged right within box.
|
||||
% \newcommand{\centeredbox}[2]{\begin{center}\fbox{\parbox{#1}{\raggedright#2}}\end{center}}
|
||||
% Double-framed box of text, horizontally centred. Ragged right within box.
|
||||
% \newcommand{\centeredboxd}[2]{\begin{center}\fbox{\fbox{\parbox{#1}{\raggedright#2}}}\end{center}}
|
||||
|
||||
% toocomplex environment: simply prints the argument in LaTeX,
|
||||
% comes out verbatim in all generated formats.
|
||||
\newenvironment{toocomplex}{}{}
|
||||
|
||||
% Colour: dummy commands since LaTeX doesn't support colour.
|
||||
% \definecolour{name}{red}{blue}{green}
|
||||
% \fcol{name}{text} ; Foreground
|
||||
% \bcol{name}{text} ; Background
|
||||
\newcommand{\definecolour}[4]{}
|
||||
\newcommand{\definecolor}[4]{}
|
||||
\newcommand{\fcol}[2]{#2}
|
||||
\newcommand{\bcol}[2]{#2}
|
||||
\newcommand{\sethotspotcolour}[1]{}
|
||||
\newcommand{\sethotspotunderline}[1]{}
|
||||
\newcommand{\settransparency}[1]{}
|
||||
\newcommand{\backslashraw}[0]{}
|
||||
\newcommand{\lbraceraw}[0]{}
|
||||
\newcommand{\rbraceraw}[0]{}
|
||||
\newcommand{\registered}[0]{(r)}
|
||||
\newcommand{\background}[1]{}
|
||||
\newcommand{\textcolour}[1]{}
|
||||
\newcommand{\overview}[2]{See \helpref{#1}{#2}.}
|
||||
\newcommand{\docparam}[2]{{\it #1}\begin{list}{}{\leftmargin=1cm}\item[]
|
||||
#2%
|
||||
\end{list}}
|
||||
\newcommand{\wxheading}[1]{{\bf #1}}
|
||||
\newcommand{\const}[0]{{\bf const}}
|
||||
\newcommand{\constfunc}[3]{{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
|
||||
|
@ -1 +0,0 @@
|
||||
GIF87a
|
Before Width: | Height: | Size: 6 B |
@ -661,7 +661,9 @@ That's all there is to it!
|
||||
\input{category.tex}
|
||||
\input{topics.tex}
|
||||
\input{wxhtml.tex}
|
||||
\input{proplist.tex}
|
||||
\input{wxPython.tex}
|
||||
\input{porting.tex}
|
||||
|
||||
\begin{comment}
|
||||
\newpage
|
||||
|
@ -1,36 +1,6 @@
|
||||
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}
|
||||
\newcommand{\indexit}[1]{#1\index{#1}}%
|
||||
\newcommand{\pipe}[0]{$\|$\ }%
|
||||
\definecolour{black}{0}{0}{0}%
|
||||
\definecolour{cyan}{0}{255}{255}%
|
||||
\definecolour{green}{0}{255}{0}%
|
||||
\definecolour{magenta}{255}{0}{255}%
|
||||
\definecolour{red}{255}{0}{0}%
|
||||
\definecolour{blue}{0}{0}{200}%
|
||||
\definecolour{yellow}{255}{255}{0}%
|
||||
\definecolour{white}{255}{255}{255}%
|
||||
\input psbox.tex
|
||||
\parskip=10pt
|
||||
\parindent=0pt
|
||||
\title{Guide to porting applications from wxWindows 1.xx to 2.0}
|
||||
\author{Julian Smart}
|
||||
\date{March 1999}
|
||||
\makeindex
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\pagestyle{fancyplain}
|
||||
\bibliographystyle{plain}
|
||||
\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
%
|
||||
\chapter{About this document}\label{about}
|
||||
\pagenumbering{arabic}%
|
||||
\setheader{{\it Porting guide}}{}{}{}{}{{\it Porting guide}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
\chapter{Porting from wxWindows 1.xx}\label{porting}
|
||||
|
||||
This document gives guidelines and tips for porting applications from
|
||||
This addendum gives guidelines and tips for porting applications from
|
||||
version 1.xx of wxWindows to version 2.0.
|
||||
|
||||
The first section offers tips for writing 1.xx applications in a way to
|
||||
@ -53,7 +23,7 @@ future.
|
||||
|
||||
{\it Please note that this document is a work in progress.}
|
||||
|
||||
\chapter{Preparing for version 2.0}\label{preparing}
|
||||
\section{Preparing for version 2.0}\label{portingpreparing}
|
||||
|
||||
Even before compiling with version 2.0, there's also a lot you can do right now to make porting
|
||||
relatively simple. Here are a few tips.
|
||||
@ -122,13 +92,13 @@ zero in the {\it multiple} parameter. The {\it multiple} parameter will be remov
|
||||
MDI sample is. In wxWindows 2.0, MDI functionality is separated into distinct classes.
|
||||
\end{itemize}
|
||||
|
||||
\chapter{The new event system}\label{eventsystem}
|
||||
\section{The new event system}\label{portingeventsystem}
|
||||
|
||||
The way that events are handled has been radically changed in wxWindows 2.0. Please
|
||||
read the topic `Event handling overview' in the wxWindows 2.0 manual for background
|
||||
on this.
|
||||
|
||||
\section{Callbacks}
|
||||
\subsection{Callbacks}
|
||||
|
||||
Instead of callbacks for panel items, menu command events, control commands and other events are directed to
|
||||
the originating window, or an ancestor, or an event handler that has been plugged into the window
|
||||
@ -151,14 +121,14 @@ Control commands, such as button commands, can be routed to a derived button cla
|
||||
the parent window, or even the frame. Here, you use a function of the form EVT\_BUTTON(id, func).
|
||||
Similar macros exist for other control commands.
|
||||
|
||||
\section{Other events}
|
||||
\subsection{Other events}
|
||||
|
||||
To intercept other events, you used to override virtual functions, such as OnSize. Now, while you can use
|
||||
the OnSize name for such event handlers (or any other name of your choice), it has only a single argument
|
||||
(wxSizeEvent) and must again be `mapped' using the EVT\_SIZE macro. The same goes for all other events,
|
||||
including OnClose (although in fact you can still use the old, virtual form of OnClose for the time being).
|
||||
|
||||
\chapter{Class hierarchy}\label{classhierarchy}
|
||||
\section{Class hierarchy}\label{portingclasshierarchy}
|
||||
|
||||
The class hierarchy has changed somewhat. wxToolBar and wxButtonBar
|
||||
classes have been split into several classes, and are derived from wxControl (which was
|
||||
@ -170,9 +140,9 @@ There are new MDI classes so that wxFrame does not have to be overloaded with th
|
||||
functionality.
|
||||
|
||||
There are new device context classes, with wxPanelDC and wxCanvasDC disappearing.
|
||||
See \helpref{Device contexts and painting}{dc}.
|
||||
See \helpref{Device contexts and painting}{portingdc}.
|
||||
|
||||
\chapter{GDI objects}\label{gdiobjects}
|
||||
\section{GDI objects}\label{portinggdiobjects}
|
||||
|
||||
These objects - instances of classes such as wxPen, wxBrush, wxBitmap (but not wxColour) -
|
||||
are now implemented with reference-counting. This makes assignment a very cheap operation,
|
||||
@ -192,7 +162,7 @@ unless this causes too much of an overhead in your application.
|
||||
At a minimum, you will have to make sure that calls to SetPen, SetBrush etc. work. Also, where you pass NULL to these
|
||||
functions, you will need to use an identifier such as wxNullPen or wxNullBrush.
|
||||
|
||||
\chapter{Dialogs and controls}\label{dialogscontrols}
|
||||
\section{Dialogs and controls}\label{portingdialogscontrols}
|
||||
|
||||
\wxheading{Labels}
|
||||
|
||||
@ -252,7 +222,7 @@ instead, which takes standard dialogs and panels and associates controls with pr
|
||||
You may also find that the new validation method, combined with dialog resources, is easier
|
||||
and more flexible than using wxForm.
|
||||
|
||||
\chapter{Device contexts and painting}\label{dc}
|
||||
\section{Device contexts and painting}\label{portingdc}
|
||||
|
||||
In wxWindows 2.0, device contexts are used for drawing into, as per 1.xx, but the way
|
||||
they are accessed and constructed is a bit different.
|
||||
@ -274,9 +244,9 @@ no longer exists.
|
||||
|
||||
wxMetaFile and wxMetaFileDC have been renamed to wxMetafile and wxMetafileDC.
|
||||
|
||||
\chapter{Miscellaneous}
|
||||
\section{Miscellaneous}
|
||||
|
||||
\section{Strings}
|
||||
\subsection{Strings}
|
||||
|
||||
wxString has replaced char* in the majority of cases. For passing strings into functions,
|
||||
this should not normally require you to change your code if the syntax is otherwise the
|
||||
@ -307,7 +277,7 @@ with this:
|
||||
To indicate an empty return value or a problem, a function may return either the
|
||||
empty string (``") or a null string. You can check for a null string with wxString::IsNull().
|
||||
|
||||
\section{Use of const}
|
||||
\subsection{Use of const}
|
||||
|
||||
The {\bf const} keyword is now used to denote constant functions that do not affect the
|
||||
object, and for function arguments to denote that the object passed cannot be changed.
|
||||
@ -318,19 +288,19 @@ check whether there is a parameter mismatch (or function type mismatch) involvin
|
||||
|
||||
Try to use the {\bf const} keyword in your own code where possible.
|
||||
|
||||
\chapter{Backward compatibility}\label{compat}
|
||||
\section{Backward compatibility}\label{portingcompat}
|
||||
|
||||
Some wxWindows 1.xx functionality has been left to ease the transition to 2.0. This functionality
|
||||
(usually) only works if you compile with WXWIN\_COMPATIBILITY set to 1 in setup.h.
|
||||
|
||||
Mostly this defines old names to be the new names (e.g. wxRectangle is defined to be wxRect).
|
||||
|
||||
\chapter{Quick reference}\label{quickreference}
|
||||
\section{Quick reference}\label{portingquickreference}
|
||||
|
||||
This section allows you to quickly find features that
|
||||
need to be converted.
|
||||
|
||||
\section{Include files}
|
||||
\subsection{Include files}
|
||||
|
||||
Use the form:
|
||||
|
||||
@ -362,30 +332,30 @@ For precompiled header support, use this form:
|
||||
#include <wx/toolbar.h>
|
||||
\end{verbatim}
|
||||
|
||||
\section{IPC classes}
|
||||
\subsection{IPC classes}
|
||||
|
||||
These are now separated out into wxDDEServer/Client/Connection (Windows only) and wxTCPServer/Client/Connection
|
||||
(Windows and Unix). Take care to use wxString for your overridden function arguments, instead of char*, as per
|
||||
the documentation.
|
||||
|
||||
\section{MDI style frames}
|
||||
\subsection{MDI style frames}
|
||||
|
||||
MDI is now implemented as a family of separate classes, so you can't switch to MDI just by
|
||||
using a different frame style. Please see the documentation for the MDI frame classes, and the MDI
|
||||
sample may be helpful too.
|
||||
|
||||
\section{OnActivate}
|
||||
\subsection{OnActivate}
|
||||
|
||||
Replace the arguments with one wxActivateEvent\& argument, make sure the function isn't virtual,
|
||||
and add an EVT\_ACTIVATE event table entry.
|
||||
|
||||
\section{OnChar}
|
||||
\subsection{OnChar}
|
||||
|
||||
This is now a non-virtual function, with the same wxKeyEvent\& argument as before.
|
||||
Add an EVT\_CHAR macro to the event table
|
||||
for your window, and the implementation of your function will need very few changes.
|
||||
|
||||
\section{OnClose}
|
||||
\subsection{OnClose}
|
||||
|
||||
The old virtual function OnClose is now obsolete.
|
||||
Add an OnCloseWindow event handler using an EVT\_CLOSE event table entry. For details
|
||||
@ -394,7 +364,7 @@ topic so please read it very carefully. Basically, OnCloseWindow is now responsi
|
||||
destroying a window with Destroy(), but the default implementation (for example for wxDialog) may not
|
||||
destroy the window, so to be sure, always provide this event handler so it's obvious what's going on.
|
||||
|
||||
\section{OnEvent}
|
||||
\subsection{OnEvent}
|
||||
|
||||
This is now a non-virtual function, with the same wxMouseEvent\& argument as before. However
|
||||
you may wish to rename it OnMouseEvent. Add an EVT\_MOUSE\_EVENTS macro to the event table
|
||||
@ -403,12 +373,12 @@ However, if you wish to intercept different events using different functions, yo
|
||||
specify specific events in your event table, such as EVT\_LEFT\_DOWN.
|
||||
|
||||
Your OnEvent function is likely to have references to GetDC(), so make sure you create
|
||||
a wxClientDC instead. See \helpref{Device contexts}{dc}.
|
||||
a wxClientDC instead. See \helpref{Device contexts}{portingdc}.
|
||||
|
||||
If you are using a wxScrolledWindow (formerly wxCanvas), you should call
|
||||
PrepareDC(dc) to set the correct translation for the current scroll position.
|
||||
|
||||
\section{OnMenuCommand}
|
||||
\subsection{OnMenuCommand}
|
||||
|
||||
You need to replace this virtual function with a series of non-virtual functions, one for
|
||||
each case of your old switch statement. Each function takes a wxCommandEvent\& argument.
|
||||
@ -416,7 +386,7 @@ Create an event table for your frame
|
||||
containing EVT\_MENU macros, and insert DECLARE\_EVENT\_TABLE() in your frame class, as
|
||||
per the samples.
|
||||
|
||||
\section{OnPaint}
|
||||
\subsection{OnPaint}
|
||||
|
||||
This is now a non-virtual function, with a wxPaintEvent\& argument.
|
||||
Add an EVT\_PAINT macro to the event table
|
||||
@ -428,12 +398,12 @@ obtain the device context.
|
||||
If you are using a wxScrolledWindow (formerly wxCanvas), you should call
|
||||
PrepareDC(dc) to set the correct translation for the current scroll position.
|
||||
|
||||
\section{OnSize}
|
||||
\subsection{OnSize}
|
||||
|
||||
Replace the arguments with one wxSizeEvent\& argument, make it non-virtual, and add to your
|
||||
event table using EVT\_SIZE.
|
||||
|
||||
\section{wxApp definition}
|
||||
\subsection{wxApp definition}
|
||||
|
||||
The definition of OnInit has changed. Return a bool value, not a wxFrame.
|
||||
|
||||
@ -441,51 +411,51 @@ Also, do {\it not} declare a global application object. Instead, use the macros
|
||||
DECLARE\_APP and IMPLEMENT\_APP as per the samples. Remove any occurrences of IMPLEMENT\_WXWIN\_MAIN:
|
||||
this is subsumed in IMPLEMENT\_APP.
|
||||
|
||||
\section{wxButton}
|
||||
\subsection{wxButton}
|
||||
|
||||
For bitmap buttons, use wxBitmapButton.
|
||||
|
||||
\section{wxCanvas}
|
||||
\subsection{wxCanvas}
|
||||
|
||||
Change the name to wxScrolledWindow.
|
||||
|
||||
\section{wxDialogBox}
|
||||
\subsection{wxDialogBox}
|
||||
|
||||
Change the name to wxDialog, and for modal dialogs, use ShowModal instead of Show.
|
||||
|
||||
\section{wxDialog::Show}
|
||||
\subsection{wxDialog::Show}
|
||||
|
||||
If you used {\bf Show} to show a modal dialog or to override the standard
|
||||
modal dialog {\bf Show}, use {\bf ShowModal} instead.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Dialogs and controls}{dialogscontrols}
|
||||
\helpref{Dialogs and controls}{portingdialogscontrols}
|
||||
|
||||
\section{wxForm}
|
||||
\subsection{wxForm}
|
||||
|
||||
Sorry, this class is no longer available. Try using the wxPropertyListView or wxPropertyFormView class
|
||||
instead, or use .wxr files and validators.
|
||||
|
||||
\section{wxPoint}
|
||||
\subsection{wxPoint}
|
||||
|
||||
The old wxPoint is called wxRealPoint, and wxPoint now uses integers.
|
||||
|
||||
\section{wxRectangle}
|
||||
\subsection{wxRectangle}
|
||||
|
||||
This is now called wxRect.
|
||||
|
||||
\section{wxScrollBar}
|
||||
\subsection{wxScrollBar}
|
||||
|
||||
The function names have changed for this class: please refer to the documentation for wxScrollBar. Instead
|
||||
of setting properties individually, you will call SetScrollbar with several parameters.
|
||||
|
||||
\section{wxText, wxMultiText, wxTextWindow}
|
||||
\subsection{wxText, wxMultiText, wxTextWindow}
|
||||
|
||||
Change all these to wxTextCtrl. Add the window style wxTE\_MULTILINE if you
|
||||
wish to have a multi-line text control.
|
||||
|
||||
\section{wxToolBar}
|
||||
\subsection{wxToolBar}
|
||||
|
||||
This name is an alias for the most popular form of toolbar for your platform. There is now a family
|
||||
of toolbar classes, with for example wxToolBar95, wxToolBarMSW and wxToolBarSimple classes existing
|
||||
@ -495,4 +465,3 @@ Toolbar management is supported by frames, so calling wxFrame::CreateToolBar and
|
||||
enough, and the SDI or MDI frame will manage the positioning for you. The client area of the frame is the space
|
||||
left over when the menu bar, toolbar and status bar have been taken into account.
|
||||
|
||||
\end{document}
|