Doc mods; fixed return non-processing problem; fixed toolbar sizing problems

(incl. MDI area clipping); put wxPrintPaperDatabase, wxPrintPaperType into prntbase.cpp
since it's needed in non-PostScript WIN16 for the generic page setup dialog;
corrected some 16-bit makefiles


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-02-28 20:59:08 +00:00
parent 828f655fd3
commit 2a47d3c193
41 changed files with 371 additions and 534 deletions

View File

@@ -131,18 +131,17 @@ otherwise.
\helpref{wxApp::SetExitOnDelete}{wxappsetexitondelete} \helpref{wxApp::SetExitOnDelete}{wxappsetexitondelete}
\membersection{wxApp::GetPrintMode}\label{wxappgetprintmode}
\constfunc{bool}{GetPrintMode}{\void}
Returns the print mode: see \helpref{wxApp::SetPrintMode}{wxappsetprintmode}.
\membersection{wxApp::GetTopWindow}\label{wxappgettopwindow} \membersection{wxApp::GetTopWindow}\label{wxappgettopwindow}
\constfunc{wxWindow *}{GetTopWindow}{\void} \constfunc{wxWindow *}{GetTopWindow}{\void}
Returns a pointer to the top window. Returns a pointer to the top window.
\wxheading{Remarks}
If the top window hasn't been set using \helpref{wxApp::SetTopWindow}{wxappsettopwindow}, this
function will find the first top-level window (frame or dialog) and return that.
\wxheading{See also} \wxheading{See also}
\helpref{wxApp::SetTopWindow}{wxappsettopwindow} \helpref{wxApp::SetTopWindow}{wxappsettopwindow}
@@ -271,7 +270,7 @@ Under Windows, OnEndSession is called in response to the WM\_ENDSESSION message.
\func{bool}{OnInit}{\void} \func{bool}{OnInit}{\void}
This must be provided by the application, and will usually create the This must be provided by the application, and will usually create the
application's main window, calling \helpref{wxApp::SetTopWindow}{wxappsettopwindow}. application's main window, optionally calling \helpref{wxApp::SetTopWindow}{wxappsettopwindow}.
Return TRUE to continue processing, FALSE to exit the application. Return TRUE to continue processing, FALSE to exit the application.
@@ -423,31 +422,16 @@ deleted. If FALSE, the application will continue to run.}
Currently, setting this to FALSE only has an effect under Windows. Currently, setting this to FALSE only has an effect under Windows.
\membersection{wxApp::SetPrintMode}\label{wxappsetprintmode}
\func{void}{SetPrintMode}{\param{int}{ mode}}
Sets the print mode determining what printing facilities will be
used by the printing framework.
\wxheading{Parameters}
\docparam{mode}{This can be one of:
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf wxPRINT\_WINDOWS}}{Under Windows, use Windows printing (wxPrinterDC). This is the
default under Windows.}
\twocolitem{{\bf wxPRINT\_POSTSCRIPT}}{Use PostScript printing (wxPostScriptDC). This is the
default for non-Windows platforms.}
\end{twocollist}
}%
\membersection{wxApp::SetTopWindow}\label{wxappsettopwindow} \membersection{wxApp::SetTopWindow}\label{wxappsettopwindow}
\func{void}{SetTopWindow}{\param{wxWindow* }{window}} \func{void}{SetTopWindow}{\param{wxWindow* }{window}}
Sets the `top' window. You should normally call this from within \helpref{wxApp::OnInit}{wxapponinit} to Sets the `top' window. You can call this from within \helpref{wxApp::OnInit}{wxapponinit} to
let wxWindows know which is the main window. let wxWindows know which is the main window. You don't have to set the top window;
it's only a convenience so that (for example) certain dialogs without parents can use a
specific window as the top window. If no top window is specified by the application,
wxWindows just uses the first frame or dialog in its top-level window list, when it
needs to use the top window.
\wxheading{Parameters} \wxheading{Parameters}

View File

@@ -3,11 +3,11 @@
wxArrayString is an efficient container for storing wxArrayString is an efficient container for storing
\helpref{wxString}{wxstring} objects. It has the same features as all \helpref{wxString}{wxstring} objects. It has the same features as all
\helpref{wxArray}{wxarray} classes, i.e. it dynamically expands when new items \helpref{wxArray}{wxarray} classes, i.e. it dynamically expands when new items
are added to it (so it is as easy to sue as a linked list), but the access are added to it (so it is as easy to use as a linked list), but the access
time to the elements is constant (instead of being linear in number of time to the elements is constant, instead of being linear in number of
elements as in the case of linked lists). It is also very size efficient and elements as in the case of linked lists. It is also very size efficient and
doesn't take more space than a C array {\it wxString[]} type (wxArrayString doesn't take more space than a C array {\it wxString[]} type. wxArrayString
uses its knowledge of internals of wxString class to achieve this). uses its knowledge of internals of wxString class to achieve this.
This class is used in the same way as other dynamic \helpref{arrays}{wxarray}, This class is used in the same way as other dynamic \helpref{arrays}{wxarray},
except that no {\it WX\_DEFINE\_ARRAY} declaration is needed for it. When a except that no {\it WX\_DEFINE\_ARRAY} declaration is needed for it. When a
@@ -29,7 +29,7 @@ array elements may be modified in place like this
Finally, none of the methods of this class is virtual including its Finally, none of the methods of this class is virtual including its
destructor, so this class should not be derived from. destructor, so this class should not be derived from.
\wxheading{Specialization of} \wxheading{Derived from}
Although this is not true strictly speaking, this class may be considered as a Although this is not true strictly speaking, this class may be considered as a
specialization of \helpref{wxArray}{wxarray} class for the wxString member specialization of \helpref{wxArray}{wxarray} class for the wxString member
@@ -42,8 +42,7 @@ functions.
\wxheading{See also} \wxheading{See also}
\helpref{wxArray}{wxarray}, \helpref{wxString}{wxstring}, \helpref{wxString \helpref{wxArray}{wxarray}, \helpref{wxString}{wxstring}, \helpref{wxString overview}{wxstringoverview}
overview}{wxstringoverview}
\latexignore{\rtfignore{\wxheading{Members}}} \latexignore{\rtfignore{\wxheading{Members}}}
@@ -224,10 +223,11 @@ wxString\&} parameters and returning {\it int} value less than, equal to or
greater than 0 if the first string is less than, equal to or greater than the greater than 0 if the first string is less than, equal to or greater than the
second one. second one.
Example: sorting strings by their length: \wxheading{Example}
The following example sorts strings by their length.
\begin{verbatim} \begin{verbatim}
static int CompareStringLen(const wxString& first, const wxString& second) static int CompareStringLen(const wxString& first, const wxString& second)
{ {
return first.length() - second.length(); return first.length() - second.length();
@@ -243,7 +243,7 @@ array.Add("three");
array.Add("four"); array.Add("four");
array.Sort(CompareStringLen); array.Sort(CompareStringLen);
\end{verbatim} \end{verbatim}
See also: \helpref{Sort}{wxarraystringsort} See also: \helpref{Sort}{wxarraystringsort}

View File

@@ -11,16 +11,17 @@ headerRule = yes
footerRule = yes footerRule = yes
useHeadingStyles = yes useHeadingStyles = yes
listItemIndent=40 listItemIndent=40
generateHPJ = no generateHPJ = yes
htmlBrowseButtons = bitmap htmlBrowseButtons = bitmap
winHelpContents = yes winHelpContents = yes
winHelpVersion = 4 ; 3 for Windows 3.x, 4 for Windows 95 winHelpVersion = 3 ; 3 for Windows 3.x, 4 for Windows 95
winHelpTitle = "wxWindows Manual" winHelpTitle = "wxWindows Manual"
truncateFilenames = yes truncateFilenames = yes
combineSubSections = yes combineSubSections = yes
\overview [2] {\rtfonly{See also }\settransparency{on}\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}\settransparency{off}} ;\overview [2] {\rtfonly{See also }\settransparency{on}\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}\settransparency{off}}
\htmlonly{\image{}{books.gif}}\helpref{#1}{#2} ;\htmlonly{\image{}{books.gif}}\helpref{#1}{#2}
\sethotspotcolour{on}\sethotspotunderline{on}} ;\sethotspotcolour{on}\sethotspotunderline{on}}
\overview [2] {\helpref{#1}{#2}}
\docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}} \docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}}
\wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}} \wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}}
\const [0] {{\bf const}} \const [0] {{\bf const}}

View File

@@ -7,10 +7,10 @@ and others right to left, character encoding may differ and many other things
may need changing too), it is a necessary first step. wxWindows provides may need changing too), it is a necessary first step. wxWindows provides
facilities for the messages translation with its facilities for the messages translation with its
\helpref{wxLocale}{wxlocale} class and is itself fully translated into several \helpref{wxLocale}{wxlocale} class and is itself fully translated into several
languages (please consult wxWindows home page for the most up-to-date languages. Please consult wxWindows home page for the most up-to-date
translations - and if you may translate it in one of the languages not done translations - and if you translate it into one of the languages not done
yet, your translations would be gratefully accepted for inclusion into the yet, your translations would be gratefully accepted for inclusion into the
future versions of the library!). future versions of the library!
The wxWindows approach to i18n closely follows GNU gettext package. wxWindows uses the The wxWindows approach to i18n closely follows GNU gettext package. wxWindows uses the
message catalogs which are binary compatible with gettext catalogs and this message catalogs which are binary compatible with gettext catalogs and this
@@ -18,7 +18,7 @@ allows to use all of the programs in this package to work with them. But note
that no additional libraries are needed during the run-time, however, so you that no additional libraries are needed during the run-time, however, so you
have only the message catalogs to distribute and nothing else. have only the message catalogs to distribute and nothing else.
However, during the program development you will need the gettext package for During program development you will need the gettext package for
working with message catalogs. {\bf Warning:} gettext versions < 0.10 are known working with message catalogs. {\bf Warning:} gettext versions < 0.10 are known
to be buggy, so you should find a later version of it! to be buggy, so you should find a later version of it!
@@ -30,25 +30,22 @@ Only the binary files are needed during program execution.
The program i18n involves several steps: The program i18n involves several steps:
\begin{enumerate}\itemsep=0pt \begin{enumerate}\itemsep=0pt
\item Translating the strings in the program text using \item Translating the strings in the program text using
\helpref{wxGetTranslation}{wxgettranslation} or equivalently the \_() macro. \helpref{wxGetTranslation}{wxgettranslation} or equivalently the \_() macro.
\item Extracting the strings to be translated from the program: this uses the \item Extracting the strings to be translated from the program: this uses the
work done in the previous step because {\it xgettext} program used for string work done in the previous step because {\it xgettext} program used for string
extraction may be told (using its -k option) to reckognize \_() and extraction may be told (using its -k option) to recognise \_() and
wxGetTranslation and extract all strings inside the calls to these functions. wxGetTranslation and extract all strings inside the calls to these functions.
Alternatively, you may use -a option to extract all the strings, but it will Alternatively, you may use -a option to extract all the strings, but it will
usually result in many strings being found which don't have to be translated at usually result in many strings being found which don't have to be translated at
all. This will create a text message catalog - a .po file. all. This will create a text message catalog - a .po file.
\item Translating the strings extracted in the previous step to other \item Translating the strings extracted in the previous step to other
language(s). It involves editing the .po file. language(s). It involves editing the .po file.
\item Compiling the .po file into .mo file to be used by the program. \item Compiling the .po file into .mo file to be used by the program.
\item Setting the appropriate locale in your program to use the strings for the \item Setting the appropriate locale in your program to use the strings for the
given language: see \helpref{wxLocale}{wxlocale}. given language: see \helpref{wxLocale}{wxlocale}.
\end{enumerate} \end{enumerate}
See also the GNU gettext documentation linked from {\tt docs/html/index.htm} in
your wxWindows distribution.

View File

@@ -56,4 +56,3 @@ please look at the printout sample code.
} }
\end{verbatim} \end{verbatim}

View File

@@ -62,7 +62,7 @@ only thing to remember is that the {\it cookie} passed to
\helpref{GetNextChild}{wxtreectrlgetnextchild} should be the same variable (and \helpref{GetNextChild}{wxtreectrlgetnextchild} should be the same variable (and
that nothing should be done with it by the user code). that nothing should be done with it by the user code).
Among other functionalities of the tree control are: item sorting with Among other features of the tree control are: item sorting with
\helpref{SortChildren}{wxtreectrlsortchildren} which uses the user-defined comparison \helpref{SortChildren}{wxtreectrlsortchildren} which uses the user-defined comparison
function \helpref{OnCompareItems}{wxtreectrloncompareitems} (by default the function \helpref{OnCompareItems}{wxtreectrloncompareitems} (by default the
comparison is the alphabetic comparison of tree labels), hit testing comparison is the alphabetic comparison of tree labels), hit testing
@@ -75,5 +75,6 @@ Finally, the tree control has a keyboard interface: the cursor navigation (arrow
may be used to change the current selection. <HOME> and <END> are used to go to may be used to change the current selection. <HOME> and <END> are used to go to
the first/last sibling of the current item. '+', '-' and '*' expand, collapse the first/last sibling of the current item. '+', '-' and '*' expand, collapse
and toggle the current branch. Note, however, that <DEL> and <INS> keys do and toggle the current branch. Note, however, that <DEL> and <INS> keys do
nothing by default, but it is custom to associate them with deleting item from nothing by default, but it is usual to associate them with deleting item from
a tree and inserting a new one in it. a tree and inserting a new one into it.

View File

@@ -1,14 +1,8 @@
; This file is maintained by HCW. Do not modify this file directly.
[OPTIONS] [OPTIONS]
COMPRESS=60 Hall Zeck BMROOT=d:\wx2\wxwind~1\docs/latex/wx ; Assume that bitmaps are where the source is
LCID=0x409 0x0 0x0 ; English (United States)
REPORT=Yes
CONTENTS=Contents
TITLE=wxWindows Manual TITLE=wxWindows Manual
BMROOT=. CONTENTS=Contents
HLP=wx.hlp COMPRESS=HIGH
[FILES] [FILES]
wx.rtf wx.rtf
@@ -16,3 +10,8 @@ wx.rtf
[CONFIG] [CONFIG]
CreateButton("Up", "&Up", "JumpId(`wx.hlp', `Contents')") CreateButton("Up", "&Up", "JumpId(`wx.hlp', `Contents')")
BrowseButtons() BrowseButtons()
[MAP]
[BITMAPS]

View File

@@ -3,6 +3,8 @@
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
\setfooter{\thepage}{}{}{}{}{\thepage}% \setfooter{\thepage}{}{}{}{}{\thepage}%
This addendum is written by Robin Dunn, author of the wxPython wrapper
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{What is wxPython?}\label{wxpwhat} \section{What is wxPython?}\label{wxpwhat}
@@ -43,18 +45,17 @@ applications, or in situations where Python is embedded in a C++
application as an internal scripting or macro language. application as an internal scripting or macro language.
Currently wxPython is available for Win32 platforms and the GTK Currently wxPython is available for Win32 platforms and the GTK
toolkit (wxGTK) on most *nix/X-windows platforms. The effort to toolkit (wxGTK) on most Unix/X-windows platforms. The effort to
enable wxPython for wxMotif will begin shortly. See \helpref{Building enable wxPython for wxMotif will begin shortly. See \helpref{Building Python}{wxpbuild} for
Python}{wxpbuild} for details about getting wxPython working for you. details about getting wxPython working for you.
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{Why use wxPython?}\label{wxpwhy} \section{Why use wxPython?}\label{wxpwhy}
So why would you want to use wxPython over just C++ and wxWindows? So why would you want to use wxPython over just C++ and wxWindows?
Personally I prefer using Python for everything. I only use C++ when Personally I prefer using Python for everything. I only use C++ when
I absolutly have to eek more performance out of an algorithm, and even I absolutely have to eek more performance out of an algorithm, and even
then I ususally code it as an extension module and leave the majority then I ususally code it as an extension module and leave the majority
of the program in Python. of the program in Python.
@@ -66,7 +67,6 @@ application in a few hours with Python that would normally take a few
days or longer with C++. Converting a wxPython app to a C++/wxWindows app days or longer with C++. Converting a wxPython app to a C++/wxWindows app
should be a straight forward task. should be a straight forward task.
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{Other Python GUIs}\label{wxpother} \section{Other Python GUIs}\label{wxpother}
@@ -118,7 +118,6 @@ cross-platform compatible. See \urlref{this
link}{http://www.python.org/download/Contributed.html\#Graphics} link}{http://www.python.org/download/Contributed.html\#Graphics}
for a listing of a few of them. for a listing of a few of them.
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{Building wxPython}\label{wxpbuild} \section{Building wxPython}\label{wxpbuild}
@@ -148,8 +147,7 @@ The default is \tt{\$(WXWIN)/utils/wxPython}. If you leave it here
then you should add \tt{\$(WXWIN)/utils} to your \tt{PYTHONPATH}. then you should add \tt{\$(WXWIN)/utils} to your \tt{PYTHONPATH}.
However, you may prefer to use something that is already on your However, you may prefer to use something that is already on your
\tt{PYTHONPATH}, such as the \tt{site-packages} directory on Unix \tt{PYTHONPATH}, such as the \tt{site-packages} directory on Unix
systems. systems.
\wxheading{Win32} \wxheading{Win32}
@@ -163,34 +161,26 @@ specified below.
\item Build wxWindows with \tt{wxUSE_RESOURCE_LOADING_IN_MSW} set to 1 in \item Build wxWindows with \tt{wxUSE_RESOURCE_LOADING_IN_MSW} set to 1 in
\tt{include/wx/msw/setup.h} so icons can be loaded dynamically. While \tt{include/wx/msw/setup.h} so icons can be loaded dynamically. While
there, make sure \tt{wxUSE_OWNER_DRAWN} is also set to 1. there, make sure \tt{wxUSE_OWNER_DRAWN} is also set to 1.
\item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory. \item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory.
\item Edit makefile.vc and specify where your python installation is at. \item Edit makefile.vc and specify where your python installation is at.
You may also want to fiddle with the \tt{TARGETDIR} variable as described You may also want to fiddle with the \tt{TARGETDIR} variable as described
above. above.
\item Run \tt{nmake -f makefile.vc} \item Run \tt{nmake -f makefile.vc}
\item If it builds successfully, congratulations! Move on to the next \item If it builds successfully, congratulations! Move on to the next
step. If not then you can try mailing the wxwin-developers list for step. If not then you can try mailing the wxwin-developers list for
help. Also, I will always have a pre-built win32 version of this extension module at help. Also, I will always have a pre-built win32 version of this extension module at
\urlref{http://alldunn.com/wxPython}{http://alldunn.com/wxPython}. \urlref{http://alldunn.com/wxPython}{http://alldunn.com/wxPython}.
\item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory. \item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory.
\item Try executing the test programs. Note that some of these print \item Try executing the test programs. Note that some of these print
diagnositc or test info to standard output, so they will require the diagnositc or test info to standard output, so they will require the
console version of python. For example: console version of python. For example:
\tt{python test1.py} \tt{python test1.py}
To run them without requiring a console, you can use the \tt{pythonw.exe} To run them without requiring a console, you can use the \tt{pythonw.exe}
version of Python either from the command line or from a shortcut. version of Python either from the command line or from a shortcut.
\end{enumerate} \end{enumerate}
\wxheading{Unix} \wxheading{Unix}
These directions assume that you have already successfully built These directions assume that you have already successfully built
@@ -203,29 +193,23 @@ with the development libraries, etc. that you will need to install.
\begin{enumerate}\itemsep=0pt \begin{enumerate}\itemsep=0pt
\item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory. \item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory.
\item Edit \tt{Setup.in} and ensure that the flags, directories, and toolkit \item Edit \tt{Setup.in} and ensure that the flags, directories, and toolkit
options are correct, (hopefully this will be done by \tt{configure} options are correct, (hopefully this will be done by \tt{configure}
soon.) See the above commentary about \tt{TARGETDIR}. There are a soon.) See the above commentary about \tt{TARGETDIR}. There are a
few sample Setup.in.[platform] files provided. few sample Setup.in.[platform] files provided.
\item Run this command to generate a makefile: \item Run this command to generate a makefile:
\tt{make -f Makefile.pre.in boot} \tt{make -f Makefile.pre.in boot}
\item Once you have the \tt{Makefile}, run \bftt{make} to build and then \item Once you have the \tt{Makefile}, run \bftt{make} to build and then
\bftt{make install} to install the wxPython extension module. \bftt{make install} to install the wxPython extension module.
\item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory. \item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory.
\item Try executing the test programs. For example: \item Try executing the test programs. For example:
\tt{python test1.py} \tt{python test1.py}
\end{enumerate} \end{enumerate}
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{Using wxPython}\label{wxpusing} \section{Using wxPython}\label{wxpusing}
@@ -325,13 +309,14 @@ it by issuing this command:
\end{verbatim} \end{verbatim}
\hrule \hrule
\wxheading{Things to notice:}\begin{enumerate}\itemsep=0pt \wxheading{Things to notice}
\begin{enumerate}\itemsep=0pt
\item At line 2 the wxPython classes, constants, and etc. are imported \item At line 2 the wxPython classes, constants, and etc. are imported
into the current module's namespace. If you prefer to reduce into the current module's namespace. If you prefer to reduce
namespace polution you can use "\tt{from wxPython import wx}" and namespace polution you can use "\tt{from wxPython import wx}" and
then access all the wxPython identifiers through the wx module, for then access all the wxPython identifiers through the wx module, for
example, "\tt{wx.wxFrame}". example, "\tt{wx.wxFrame}".
\item At line 13 the frame's sizing and moving events are connected to \item At line 13 the frame's sizing and moving events are connected to
methods of the class. These helper functions are intended to be like methods of the class. These helper functions are intended to be like
the event table macros that wxWindows employs. But since static event the event table macros that wxWindows employs. But since static event
@@ -339,20 +324,17 @@ tables are impossible with wxPython, we use helpers that are named the
same to dynamically build the table. The only real difference is same to dynamically build the table. The only real difference is
that the first arguemnt to the event helpers is always the window that that the first arguemnt to the event helpers is always the window that
the event table entry should be added to. the event table entry should be added to.
\item Notice the use of \tt{wxDLG\_PNT} and \tt{wxDLG\_SZE} in lines 19
\item Notice the use of \tt{wxDLG_PNT} and \tt{wxDLG_SZE} in lines 19
- 29 to convert from dialog units to pixels. These helpers are unique - 29 to convert from dialog units to pixels. These helpers are unique
to wxPython since Python can't do method overloading like C++. to wxPython since Python can't do method overloading like C++.
\item There is an \tt{OnCloseWindow} method at line 34 but no call to \item There is an \tt{OnCloseWindow} method at line 34 but no call to
EVT_CLOSE to attach the event to the method. Does it really get EVT\_CLOSE to attach the event to the method. Does it really get
called? The answer is, yes it does. This is because many of the called? The answer is, yes it does. This is because many of the
\em{standard} events are attached to windows that have the associated \em{standard} events are attached to windows that have the associated
\em{standard} method names. I have tried to follow the lead of the \em{standard} method names. I have tried to follow the lead of the
C++ classes in this area to determine what is \em{standard} but since C++ classes in this area to determine what is \em{standard} but since
that changes from time to time I can make no guarentees, nor will it that changes from time to time I can make no guarentees, nor will it
be fully documented. When in doubt, use an EVT_*** function. be fully documented. When in doubt, use an EVT\_*** function.
\item At lines 17 to 21 notice that there are no saved references to \item At lines 17 to 21 notice that there are no saved references to
the panel or the static text items that are created. Those of you the panel or the static text items that are created. Those of you
who know Python might be wondering what happens when Python deletes who know Python might be wondering what happens when Python deletes
@@ -361,16 +343,14 @@ don't. Remember that in wxPython the Python objects are just shadows of the
coresponding C++ objects. Once the C++ windows and controls are coresponding C++ objects. Once the C++ windows and controls are
attached to their parents, the parents manage them and delete them attached to their parents, the parents manage them and delete them
when necessary. For this reason, most wxPython objects do not need to when necessary. For this reason, most wxPython objects do not need to
have a __del__ method that explicitly causes the C++ object to be have a \_\_del\_\_ method that explicitly causes the C++ object to be
deleted. If you ever have the need to forcibly delete a window, use deleted. If you ever have the need to forcibly delete a window, use
the Destroy() method as shown on line 36. the Destroy() method as shown on line 36.
\item Just like wxWindows in C++, wxPython apps need to create a class \item Just like wxWindows in C++, wxPython apps need to create a class
derived from \tt{wxApp} (line 56) that implements a method named derived from \tt{wxApp} (line 56) that implements a method named
\tt{OnInit}, (line 59.) This method should create the application's \tt{OnInit}, (line 59.) This method should create the application's
main window (line 62) and use \tt{wxApp.SetTopWindow()} (line 66) to main window (line 62) and use \tt{wxApp.SetTopWindow()} (line 66) to
inform wxWindows about it. inform wxWindows about it.
\item And finally, at line 72 an instance of the application class is \item And finally, at line 72 an instance of the application class is
created. At this point wxPython finishes initializing itself, and calls created. At this point wxPython finishes initializing itself, and calls
the \tt{OnInit} method to get things started. (The zero parameter here is the \tt{OnInit} method to get things started. (The zero parameter here is
@@ -378,11 +358,8 @@ a flag for functionality that isn't quite implemented yet. Just
ignore it for now.) The call to \tt{MainLoop} at line 73 starts the event ignore it for now.) The call to \tt{MainLoop} at line 73 starts the event
loop which continues until the application terminates or all the top loop which continues until the application terminates or all the top
level windows are closed. level windows are closed.
\end{enumerate} \end{enumerate}
%---------------------------------------------------------------------- %----------------------------------------------------------------------
\section{wxWindows classes implemented in wxPython}\label{wxpclasses} \section{wxWindows classes implemented in wxPython}\label{wxpclasses}
@@ -532,8 +509,3 @@ Or you can send mail directly to the list using this address:
wxpython-users@starship.python.net wxpython-users@starship.python.net

View File

@@ -267,46 +267,6 @@ private:
WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData; WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE); WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE);
/*
* Again, this only really needed for non-Windows platforms
* or if you want to test the PostScript printing under Windows.
*/
class WXDLLEXPORT wxPrintPaperType: public wxObject
{
public:
wxPrintPaperType(const char *name = (const char *) NULL, int wmm = 0, int hmm = 0, int wp = 0, int hp = 0);
~wxPrintPaperType();
public:
int widthMM;
int heightMM;
int widthPixels;
int heightPixels;
char *pageName;
private:
DECLARE_DYNAMIC_CLASS(wxPrintPaperType)
};
class WXDLLEXPORT wxPrintPaperDatabase: public wxList
{
public:
wxPrintPaperDatabase();
~wxPrintPaperDatabase();
void CreateDatabase();
void ClearDatabase();
void AddPaperType(const char *name, int wmm, int hmm, int wp, int hp);
wxPrintPaperType *FindPaperType(const char *name);
private:
DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase)
};
WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase;
#endif #endif
// wxUSE_POSTSCRIPT // wxUSE_POSTSCRIPT

View File

@@ -340,5 +340,47 @@ public:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/*
* Again, this only really needed for non-Windows platforms
* or if you want to test the PostScript printing under Windows,
* or if you're using the generic page setup dialog under e.g. Win16.
*/
class WXDLLEXPORT wxPrintPaperType: public wxObject
{
public:
wxPrintPaperType(const char *name = (const char *) NULL, int wmm = 0, int hmm = 0, int wp = 0, int hp = 0);
~wxPrintPaperType();
public:
int widthMM;
int heightMM;
int widthPixels;
int heightPixels;
char *pageName;
private:
DECLARE_DYNAMIC_CLASS(wxPrintPaperType)
};
class WXDLLEXPORT wxPrintPaperDatabase: public wxList
{
public:
wxPrintPaperDatabase();
~wxPrintPaperDatabase();
void CreateDatabase();
void ClearDatabase();
void AddPaperType(const char *name, int wmm, int hmm, int wp, int hp);
wxPrintPaperType *FindPaperType(const char *name);
private:
DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase)
};
WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase;
#endif #endif
// _WX_PRNTBASEH__ // _WX_PRNTBASEH__

View File

@@ -95,7 +95,9 @@ public:
void OnSetFont( wxCommandEvent &event ); void OnSetFont( wxCommandEvent &event );
void OnPageChanged( wxNotebookEvent &event ); void OnPageChanged( wxNotebookEvent &event );
void OnSliderUpdate( wxCommandEvent &event ); void OnSliderUpdate( wxCommandEvent &event );
#ifndef __WIN16__
void OnSpinUpdate( wxSpinEvent &event ); void OnSpinUpdate( wxSpinEvent &event );
#endif
void OnPasteFromClipboard( wxCommandEvent &event ); void OnPasteFromClipboard( wxCommandEvent &event );
void OnCopyToClipboard( wxCommandEvent &event ); void OnCopyToClipboard( wxCommandEvent &event );
void OnMoveToEndOfText( wxCommandEvent &event ); void OnMoveToEndOfText( wxCommandEvent &event );
@@ -108,7 +110,9 @@ public:
wxGauge *m_gauge; wxGauge *m_gauge;
wxSlider *m_slider; wxSlider *m_slider;
wxButton *m_fontButton; wxButton *m_fontButton;
#ifndef __WIN16__
wxSpinButton *m_spinbutton; wxSpinButton *m_spinbutton;
#endif
wxTextCtrl *m_spintext; wxTextCtrl *m_spintext;
MyTextCtrl *m_multitext; MyTextCtrl *m_multitext;
MyTextCtrl *m_textentry; MyTextCtrl *m_textentry;
@@ -336,7 +340,9 @@ EVT_BUTTON (ID_RADIOBOX_FONT, MyPanel::OnRadioButtons)
EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons) EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons)
EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont) EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont)
EVT_SLIDER (ID_SLIDER, MyPanel::OnSliderUpdate) EVT_SLIDER (ID_SLIDER, MyPanel::OnSliderUpdate)
#ifndef __WIN16__
EVT_SPIN (ID_SPIN, MyPanel::OnSpinUpdate) EVT_SPIN (ID_SPIN, MyPanel::OnSpinUpdate)
#endif
EVT_BUTTON (ID_PASTE_TEXT, MyPanel::OnPasteFromClipboard) EVT_BUTTON (ID_PASTE_TEXT, MyPanel::OnPasteFromClipboard)
EVT_BUTTON (ID_COPY_TEXT, MyPanel::OnCopyToClipboard) EVT_BUTTON (ID_COPY_TEXT, MyPanel::OnCopyToClipboard)
EVT_BUTTON (ID_MOVE_END_ZONE, MyPanel::OnMoveToEndOfText) EVT_BUTTON (ID_MOVE_END_ZONE, MyPanel::OnMoveToEndOfText)
@@ -541,8 +547,10 @@ m_text(NULL), m_notebook(NULL)
); );
#endif #endif
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) ); m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );
#ifndef __WIN16__
m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,159), wxSize(-1,-1) ); m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,159), wxSize(-1,-1) );
m_spinbutton->SetRange(0,100); m_spinbutton->SetRange(0,100);
#endif
m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge); m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge);
} }
@@ -873,12 +881,14 @@ void MyPanel::OnSliderUpdate( wxCommandEvent &WXUNUSED(event) )
m_gauge->SetValue( m_slider->GetValue() ); m_gauge->SetValue( m_slider->GetValue() );
} }
#ifndef __WIN16__
void MyPanel::OnSpinUpdate( wxSpinEvent &event ) void MyPanel::OnSpinUpdate( wxSpinEvent &event )
{ {
wxString value; wxString value;
value.sprintf( "%d", (int)event.GetPosition() ); value.sprintf( "%d", (int)event.GetPosition() );
m_spintext->SetValue( value ); m_spintext->SetValue( value );
} }
#endif
MyPanel::~MyPanel() MyPanel::~MyPanel()
{ {

View File

@@ -1,88 +1,17 @@
# #
# File: makefile.dos # File: makefile.dos
# Author: Julian Smart # Author: Julian Smart
# Created: 1993 # Created: 1998
# Updated: # Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
# #
# "%W% %G%" # Makefile : Builds 16-bit sample, VC++ 1.5
#
# Makefile : Builds printing example (DOS).
# Use FINAL=1 argument to nmake to build final version with no debugging # Use FINAL=1 argument to nmake to build final version with no debugging
# info. # info
# Set WXDIR for your system
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
!include $(WXDIR)\src\makemsc.env TARGET=printing
OBJECTS=$(TARGET).obj
THISDIR = $(WXDIR)\samples\printing
WXLIB = $(WXDIR)\lib\wx.lib
LIBS=$(WXLIB) oldnames libw llibcew commdlg ddeml shell mmsystem
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
DUMMY=$(WXDIR)\src\msw\dummy.obj
# Set this to nothing if using MS C++ 7
ZOPTION=/Z7
!ifndef FINAL
FINAL=0
!endif
DEBUGFLAG=#/DDEBUG=1
!if "$(FINAL)" == "0"
CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) $(DEBUGFLAG) /YuWX_PREC.H /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /NOE /CO /ONERROR:NOEXE /SEG:256
!else
CPPFLAGS=/AL /W3 /G2sw $(INC) /Ox /YuWX_PREC.H /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch
LINKFLAGS=/NOD /ONERROR:NOEXE /SEG:256
!endif
HEADERS = printing.h
SOURCES = printing.$(SRCSUFF)
OBJECTS = printing.obj
printing: printing.exe
all: wx printing.exe
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.dos FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.dos clean
cd $(THISDIR)
printing.exe: $(DUMMY) $(WXLIB) printing.obj printing.def printing.res
link $(LINKFLAGS) @<<
$(DUMMY) printing.obj,
printing,
NUL,
$(LIBS),
printing.def
;
<<
rc -31 -K printing.res
printing.obj: printing.h printing.$(SRCSUFF) $(DUMMY) $(WXDIR)\include\base\wx_print.h
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<
printing.res : printing.rc $(WXDIR)\include\msw\wx.rc
rc -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa printing
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb
!include $(WXDIR)\src\makeprog.msc

View File

@@ -1,86 +1,17 @@
# #
# File: makefile.dos # File: makefile.dos
# Author: Julian Smart # Author: Julian Smart
# Created: 1993 # Created: 1998
# Updated: # Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
# #
# "%W% %G%" # Makefile : Builds 16-bit sample, VC++ 1.5
#
# Makefile : Builds resource example (DOS).
# Use FINAL=1 argument to nmake to build final version with no debugging # Use FINAL=1 argument to nmake to build final version with no debugging
# info. # info
# Set WXDIR for your system
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
!include $(WXDIR)\src\makemsc.env TARGET=resource
OBJECTS=$(TARGET).obj
THISDIR = $(WXDIR)\samples\resource !include $(WXDIR)\src\makeprog.msc
WXLIB = $(WXDIR)\lib\wx.lib
LIBS=$(WXLIB) oldnames libw llibcew commdlg ddeml shell mmsystem
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
DUMMY=$(WXDIR)\src\msw\dummy.obj
# Set this to nothing if using MS C++ 7
ZOPTION=/Z7
!ifndef FINAL
FINAL=0
!endif
PRECOMP = /YuWX_PREC.H /Fp$(WXDIR)\src\msw\wx.pch
!if "$(FINAL)" == "0"
CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) $(PRECOMP) /Dwx_msw
LINKFLAGS=/NOD /CO /ONERROR:NOEXE /SEG:256
!else
CPPFLAGS=/AL /W3 /G2sw $(INC) /Ox $(PRECOMP) /Dwx_msw
LINKFLAGS=/NOD /ONERROR:NOEXE /SEG:256
!endif
HEADERS = resource.h
SOURCES = resource.$(SRCSUFF)
OBJECTS = resource.obj
resource: resource.exe
all: wx resource.exe
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.dos FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.dos clean
cd $(THISDIR)
resource.exe: $(DUMMY) $(WXLIB) resource.obj resource.def resource.res
link $(LINKFLAGS) @<<
$(DUMMY) resource.obj,
resource,
NUL,
$(LIBS),
resource.def
;
<<
rc -31 -K resource.res
resource.obj: resource.h resource.$(SRCSUFF) dialog1.wxr $(DUMMY)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<
resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
rc -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb

View File

@@ -70,7 +70,7 @@ bool MyApp::OnInit(void)
frame->SetMenuBar(menuBar); frame->SetMenuBar(menuBar);
// Create the toolbar // Create the toolbar
frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT|wxTB_DOCKABLE, ID_TOOLBAR); frame->CreateToolBar(wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT|wxTB_DOCKABLE, ID_TOOLBAR);
frame->GetToolBar()->SetMargins( 2, 2 ); frame->GetToolBar()->SetMargins( 2, 2 );

View File

@@ -1,4 +1,3 @@
* Last change: JS 13 Mar 97 5:02 pm
NAME Events NAME Events
DESCRIPTION 'Event tester' DESCRIPTION 'Event tester'
EXETYPE WINDOWS EXETYPE WINDOWS

View File

@@ -429,7 +429,6 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
} }
return FALSE; return FALSE;
} }
void wxEvtHandler::Connect( int id, int lastId, void wxEvtHandler::Connect( int id, int lastId,
wxEventType eventType, wxEventType eventType,
wxObjectEventFunction func, wxObjectEventFunction func,

View File

@@ -39,6 +39,7 @@
#include "wx/prntbase.h" #include "wx/prntbase.h"
#include "wx/dcprint.h" #include "wx/dcprint.h"
#include "wx/printdlg.h" #include "wx/printdlg.h"
#include "wx/module.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -66,6 +67,7 @@ IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow)
IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow) IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow)
IMPLEMENT_CLASS(wxPreviewFrame, wxFrame) IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject) IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog) BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
@@ -758,3 +760,121 @@ void wxPrintPreviewBase::SetZoom(int percent)
m_previewCanvas->Refresh(); m_previewCanvas->Refresh();
} }
} }
/*
* Paper size database for PostScript or where the generic page setup dialog is
* needed
*/
wxPrintPaperType::wxPrintPaperType(const char *name, int wmm, int hmm, int wp, int hp)
{
widthMM = wmm;
heightMM = hmm;
widthPixels = wp;
heightPixels = hp;
pageName = copystring(name);
}
wxPrintPaperType::~wxPrintPaperType()
{
delete[] pageName;
}
/*
* Print paper database for PostScript
*/
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase*) NULL;
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
wxPrintPaperDatabase::wxPrintPaperDatabase():wxList(wxKEY_STRING)
{
DeleteContents(TRUE);
}
wxPrintPaperDatabase::~wxPrintPaperDatabase()
{
}
void wxPrintPaperDatabase::CreateDatabase()
{
// Need correct values for page size in pixels.
// Each unit is one 'point' = 1/72 of an inch.
// NOTE: WE NEED ALSO TO MAKE ADJUSTMENTS WHEN TRANSLATING
// in wxPostScriptDC code, so we can start from top left.
// So access this database and translate by appropriate number
// of points for this paper size. OR IS IT OK ALREADY?
// Can't remember where the PostScript origin is by default.
// Heck, someone will know how to make it hunky-dory...
// JACS 25/5/95
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 595, 842);
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 842, 1191);
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 612, 791);
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 612, 1009);
/*
This is for 100 ppi
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 210*4, 297*4 );
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 297*4, 420*4 );
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 216*4, 279*4 );
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 216*4, 356*4 );
*/
}
void wxPrintPaperDatabase::ClearDatabase()
{
Clear();
}
void wxPrintPaperDatabase::AddPaperType(const char *name, int wmm, int hmm, int wp, int hp)
{
Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp));
}
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
{
wxNode *node = Find(name);
if (node)
return (wxPrintPaperType *)node->Data();
else
return (wxPrintPaperType *) NULL;
}
// A module to allow initialization/cleanup of print paper
// things without calling these functions from app.cpp.
class WXDLLEXPORT wxPrintBaseModule: public wxModule
{
DECLARE_DYNAMIC_CLASS(wxPrintBaseModule)
public:
wxPrintBaseModule() {}
bool OnInit();
void OnExit();
};
IMPLEMENT_DYNAMIC_CLASS(wxPrintBaseModule, wxModule)
/*
* Initialization/cleanup module
*/
bool wxPrintBaseModule::OnInit()
{
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
return TRUE;
}
void wxPrintBaseModule::OnExit()
{
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
}

View File

@@ -66,6 +66,7 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos
m_yMargin = 0; m_yMargin = 0;
m_toolPacking = 1; m_toolPacking = 1;
m_toolSeparation = 5; m_toolSeparation = 5;
SetCursor(*wxSTANDARD_CURSOR);
return TRUE; return TRUE;
} }

View File

@@ -134,7 +134,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
wxString val(control->GetValue()); wxString val(control->GetValue());
bool ok = true; bool ok = TRUE;
// this format string should contian exactly one '%s' // this format string should contian exactly one '%s'
const char *errormsg = _("'%s' is invalid"); const char *errormsg = _("'%s' is invalid");
@@ -143,37 +143,37 @@ bool wxTextValidator::Validate(wxWindow *parent)
{ {
if ( !m_includeList.Member(val) ) if ( !m_includeList.Member(val) )
{ {
ok = false; ok = FALSE;
} }
} }
else if ( m_validatorStyle & wxFILTER_EXCLUDE_LIST ) else if ( m_validatorStyle & wxFILTER_EXCLUDE_LIST )
{ {
if ( m_excludeList.Member(val) ) if ( m_excludeList.Member(val) )
{ {
ok = false; ok = FALSE;
} }
} }
else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() ) else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
{ {
ok = false; ok = FALSE;
errormsg = _("'%s' should only contain ASCII characters."); errormsg = _("'%s' should only contain ASCII characters.");
} }
else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) ) else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
{ {
ok = false; ok = FALSE;
errormsg = _("'%s' should only contain alphabetic characters."); errormsg = _("'%s' should only contain alphabetic characters.");
} }
else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val)) else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
{ {
ok = false; ok = FALSE;
errormsg = _("'%s' should only contain alphabetic or numeric characters."); errormsg = _("'%s' should only contain alphabetic or numeric characters.");
} }
else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val)) else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
{ {
ok = false; ok = FALSE;
errormsg = _("'%s' should be numeric."); errormsg = _("'%s' should be numeric.");
} }

View File

@@ -203,7 +203,7 @@ IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
int n, const wxString *choices, char **clientData, long style, const wxPoint& pos): int n, const wxString *choices, char **clientData, long style, const wxPoint& pos):
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL) wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{ {
Create(parent, message, caption, n, choices, clientData, style); Create(parent, message, caption, n, choices, clientData, style);
} }

View File

@@ -1837,10 +1837,8 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const
wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL; wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL;
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC) IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
#endif #endif
// Redundant now I think // Redundant now I think
@@ -2338,86 +2336,19 @@ void wxInitializePrintSetupData(bool init)
} }
} }
/* // A module to allow initialization/cleanup of PostScript-related
* Paper size database for PostScript // things without calling these functions from app.cpp.
*/
wxPrintPaperType::wxPrintPaperType(const char *name, int wmm, int hmm, int wp, int hp) class WXDLLEXPORT wxPostScriptModule: public wxModule
{ {
widthMM = wmm; DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
heightMM = hmm; public:
widthPixels = wp; wxPostScriptModule() {}
heightPixels = hp; bool OnInit();
pageName = copystring(name); void OnExit();
} };
wxPrintPaperType::~wxPrintPaperType() IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
{
delete[] pageName;
}
/*
* Print paper database for PostScript
*/
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
wxPrintPaperDatabase::wxPrintPaperDatabase():wxList(wxKEY_STRING)
{
DeleteContents(TRUE);
}
wxPrintPaperDatabase::~wxPrintPaperDatabase()
{
}
void wxPrintPaperDatabase::CreateDatabase()
{
// Need correct values for page size in pixels.
// Each unit is one 'point' = 1/72 of an inch.
// NOTE: WE NEED ALSO TO MAKE ADJUSTMENTS WHEN TRANSLATING
// in wxPostScriptDC code, so we can start from top left.
// So access this database and translate by appropriate number
// of points for this paper size. OR IS IT OK ALREADY?
// Can't remember where the PostScript origin is by default.
// Heck, someone will know how to make it hunky-dory...
// JACS 25/5/95
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 595, 842);
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 842, 1191);
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 612, 791);
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 612, 1009);
/*
This is for 100 ppi
AddPaperType(_("A4 210 x 297 mm"), 210, 297, 210*4, 297*4 );
AddPaperType(_("A3 297 x 420 mm"), 297, 420, 297*4, 420*4 );
AddPaperType(_("Letter 8 1/2 x 11 in"), 216, 279, 216*4, 279*4 );
AddPaperType(_("Legal 8 1/2 x 14 in"), 216, 356, 216*4, 356*4 );
*/
}
void wxPrintPaperDatabase::ClearDatabase()
{
Clear();
}
void wxPrintPaperDatabase::AddPaperType(const char *name, int wmm, int hmm, int wp, int hp)
{
Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp));
}
wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
{
wxNode *node = Find(name);
if (node)
return (wxPrintPaperType *)node->Data();
else
return (wxPrintPaperType *) NULL;
}
/* /*
* Initialization/cleanup module * Initialization/cleanup module
@@ -2426,8 +2357,6 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
bool wxPostScriptModule::OnInit() bool wxPostScriptModule::OnInit()
{ {
wxInitializePrintSetupData(); wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
return TRUE; return TRUE;
} }
@@ -2435,8 +2364,6 @@ bool wxPostScriptModule::OnInit()
void wxPostScriptModule::OnExit() void wxPostScriptModule::OnExit()
{ {
wxInitializePrintSetupData(FALSE); wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
} }
#endif #endif

View File

@@ -39,12 +39,21 @@
#endif #endif
#include "wx/generic/prntdlgg.h" #include "wx/generic/prntdlgg.h"
#if wxUSE_POSTSCRIPT
#include "wx/generic/dcpsg.h" #include "wx/generic/dcpsg.h"
#endif
#include "wx/printdlg.h" #include "wx/printdlg.h"
// For print paper things
#include "wx/prntbase.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if wxUSE_POSTSCRIPT
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog) IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog) IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
@@ -69,7 +78,7 @@ extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data): wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
wxDialog(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL) wxDialog(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{ {
if ( data ) if ( data )
printData = *data; printData = *data;
@@ -274,7 +283,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC(void)
*/ */
wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data): wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data):
wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL) wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{ {
if ( data ) if ( data )
printData = *data; printData = *data;
@@ -408,6 +417,8 @@ wxChoice *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
choice->SetSelection(sel); choice->SetSelection(sel);
return choice; return choice;
} }
#endif
// wxUSE_POSTSCRIPT
/* /*
* Generic page setup dialog * Generic page setup dialog
@@ -429,33 +440,10 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
printDialog->ShowModal(); printDialog->ShowModal();
printDialog->Destroy(); printDialog->Destroy();
#if 0
if (wxTheApp->GetPrintMode() == wxPRINT_POSTSCRIPT)
{
wxGenericPrintSetupDialog *genericPrintSetupDialog =
new wxGenericPrintSetupDialog(this, wxThePrintSetupData);
int ret = genericPrintSetupDialog->ShowModal();
if (ret == wxID_OK)
*wxThePrintSetupData = genericPrintSetupDialog->GetPrintData();
genericPrintSetupDialog->Close(TRUE);
}
#ifdef __WXMSW__
else
{
wxPrintData data;
data.SetSetupDialog(TRUE);
wxPrintDialog printDialog(this, & data);
printDialog.ShowModal();
}
#endif
#endif
// 0
} }
wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data): wxGenericPageSetupDialog::wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data):
wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE) wxDialog(parent, -1, _("Page Setup"), wxPoint(0, 0), wxSize(600, 600), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
{ {
if ( data ) if ( data )
pageData = *data; pageData = *data;
@@ -583,12 +571,16 @@ bool wxGenericPageSetupDialog::TransferDataFromWindow(void)
int sel = orientationRadioBox->GetSelection(); int sel = orientationRadioBox->GetSelection();
if (sel == 0) if (sel == 0)
{ {
#if wxUSE_POSTSCRIPT
wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT); wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT);
#endif
pageData.SetOrientation(wxPORTRAIT); pageData.SetOrientation(wxPORTRAIT);
} }
else else
{ {
#if wxUSE_POSTSCRIPT
wxThePrintSetupData->SetPrinterOrientation(wxLANDSCAPE); wxThePrintSetupData->SetPrinterOrientation(wxLANDSCAPE);
#endif
pageData.SetOrientation(wxLANDSCAPE); pageData.SetOrientation(wxLANDSCAPE);
} }
} }

View File

@@ -79,7 +79,7 @@ static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption, wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const wxString& value, long style, const wxPoint& pos): const wxString& value, long style, const wxPoint& pos):
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL) wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{ {
m_dialogStyle = style; m_dialogStyle = style;
m_value = value; m_value = value;

View File

@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
/* For printing several pages */ /* For printing several pages */
int wxPageNumber; int wxPageNumber;
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
// Now in prntbase.cpp
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
/* GDI Object Lists */ /* GDI Object Lists */
wxBrushList *wxTheBrushList = (wxBrushList *) NULL; wxBrushList *wxTheBrushList = (wxBrushList *) NULL;

View File

@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
/* For printing several pages */ /* For printing several pages */
int wxPageNumber; int wxPageNumber;
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
// Now in prntbase.cpp
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
/* GDI Object Lists */ /* GDI Object Lists */
wxBrushList *wxTheBrushList = (wxBrushList *) NULL; wxBrushList *wxTheBrushList = (wxBrushList *) NULL;

View File

@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
const char *wxFloatToStringStr = "%.2f"; const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f"; const char *wxDoubleToStringStr = "%.2f";
#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
#if wxUSE_SHARED_LIBRARY #if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries) ///// Event tables (also must be in one, statically-linked file for shared libraries)

View File

@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
const char *wxFloatToStringStr = "%.2f"; const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f"; const char *wxDoubleToStringStr = "%.2f";
#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
#if wxUSE_SHARED_LIBRARY #if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries) ///// Event tables (also must be in one, statically-linked file for shared libraries)

View File

@@ -128,10 +128,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
const char *wxFloatToStringStr = "%.2f"; const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f"; const char *wxDoubleToStringStr = "%.2f";
#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
#if wxUSE_SHARED_LIBRARY #if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries) ///// Event tables (also must be in one, statically-linked file for shared libraries)

View File

@@ -491,6 +491,7 @@ void wxApp::CleanUp()
// (double deletion of the cursor). // (double deletion of the cursor).
wxSetCursor(wxNullCursor); wxSetCursor(wxNullCursor);
delete g_globalCursor; delete g_globalCursor;
g_globalCursor = NULL;
wxDeleteStockObjects() ; wxDeleteStockObjects() ;
@@ -932,6 +933,7 @@ void wxApp::Dispatch()
* the message. Some may have accelerator tables, or have * the message. Some may have accelerator tables, or have
* MDI complications. * MDI complications.
*/ */
bool wxApp::ProcessMessage(WXMSG *wxmsg) bool wxApp::ProcessMessage(WXMSG *wxmsg)
{ {
MSG *msg = (MSG *)wxmsg; MSG *msg = (MSG *)wxmsg;

View File

@@ -78,11 +78,6 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL); wxGetInstance(), NULL);
#if wxUSE_CTL3D
// if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
// Ctl3dSubclassCtl(wx_button);
#endif
m_hWnd = (WXHWND)wx_button; m_hWnd = (WXHWND)wx_button;
// Subclass again for purposes of dialog editing mode // Subclass again for purposes of dialog editing mode

View File

@@ -53,6 +53,7 @@ wxControl::wxControl(void)
m_backgroundColour = *wxWHITE; m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK; m_foregroundColour = *wxBLACK;
m_callback = 0; m_callback = 0;
// m_windowCursor = wxNullCursor; // To avoid the standard cursor being used
} }
wxControl::~wxControl(void) wxControl::~wxControl(void)

View File

@@ -24,6 +24,8 @@
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#include "wx/prntbase.h"
#define _MAXPATHLEN 500 #define _MAXPATHLEN 500
// Useful buffer, initialized in wxCommonInit // Useful buffer, initialized in wxCommonInit
@@ -154,11 +156,6 @@ const char *wxDoubleToStringStr = "%.2f";
const char *wxUserResourceStr = "TEXT"; const char *wxUserResourceStr = "TEXT";
#endif #endif
#if wxUSE_POSTSCRIPT
class wxPrintPaperDatabase;
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
#if wxUSE_SHARED_LIBRARY #if wxUSE_SHARED_LIBRARY
/* /*
* For wxWindows to be made into a dynamic library (e.g. Sun), * For wxWindows to be made into a dynamic library (e.g. Sun),
@@ -319,9 +316,10 @@ IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC) IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList) IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
#if wxUSE_WX_RESOURCES #if wxUSE_WX_RESOURCES
#include "wx/resource.h" #include "wx/resource.h"

View File

@@ -70,6 +70,7 @@ GENERICOBJS= \
$(GENDIR)\statusbr.obj \ $(GENDIR)\statusbr.obj \
$(GENDIR)\tabg.obj \ $(GENDIR)\tabg.obj \
$(GENDIR)\textdlgg.obj\ $(GENDIR)\textdlgg.obj\
$(GENDIR)\prntdlgg.obj \
$(GENDIR)\treectrl.obj $(GENDIR)\treectrl.obj
# Don't need these generic objects for Windows # Don't need these generic objects for Windows
@@ -77,7 +78,6 @@ GENERICOBJS= \
# $(GENDIR)\fontdlgg.obj \ # $(GENDIR)\fontdlgg.obj \
# $(GENDIR)\colrdlgg.obj \ # $(GENDIR)\colrdlgg.obj \
# $(GENDIR)\printps.obj \ # $(GENDIR)\printps.obj \
# $(GENDIR)\prntdlgg.obj \
# $(GENDIR)\helpxlp.obj \ # $(GENDIR)\helpxlp.obj \
COMMONOBJS = \ COMMONOBJS = \

View File

@@ -289,53 +289,6 @@ void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
// Do nothing // Do nothing
} }
#if WXWIN_COMPATIBILITY
/*
void wxMDIParentFrame::OldOnSize(int x, int y)
{
#if WXWIN_COMPATIBILITY == 1
wxSizeEvent event(wxSize(x, y), m_windowId);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
#else
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
int x = 0;
int y = 0;
int width, height;
GetClientSize(&width, &height);
if ( GetToolBar() )
{
int wt, ht;
GetToolBar()->GetSize(&wt, &ht);
height -= ht;
y += ht;
}
if ( GetClientWindow() )
GetClientWindow()->SetSize(x, y, width, height);
#endif
}
// Default activation behaviour - nothing.
// Default activation behaviour - override dedault wxFrame behaviour
void wxMDIParentFrame::OldOnActivate(bool flag)
{
#if WXWIN_COMPATIBILITY == 1
wxActivateEvent event(wxEVT_ACTIVATE, flag, m_windowId);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
#else
#endif
}
*/
#endif
// Returns the active MDI child window // Returns the active MDI child window
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{ {

View File

@@ -54,10 +54,12 @@
#endif // Win32/16 #endif // Win32/16
// wnd proc for radio buttons // wnd proc for radio buttons
#ifdef __WIN32__
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hWnd, LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hWnd,
UINT message, UINT message,
WPARAM wParam, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
#endif
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// global vars // global vars
@@ -706,14 +708,19 @@ void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
if ( !s_wndprocRadioBtn ) if ( !s_wndprocRadioBtn )
s_wndprocRadioBtn = (WNDPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC); s_wndprocRadioBtn = (WNDPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
// No GWL_USERDATA in Win16, so omit this subclassing.
#ifdef __WIN32__
::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc); ::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc);
::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this); ::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this);
#endif
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// window proc for radio buttons // window proc for radio buttons
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#ifdef __WIN32__
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
UINT msg, UINT msg,
WPARAM wParam, WPARAM wParam,
@@ -777,4 +784,5 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
else else
return 0; return 0;
} }
#endif

View File

@@ -151,10 +151,18 @@ bool wxToolBar95::Create(wxWindow *parent,
msflags |= TBSTYLE_FLAT; msflags |= TBSTYLE_FLAT;
} }
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
// Even with extended styles, need to combine with WS_BORDER
// for them to look right.
if ( want3D || wxStyleHasBorder(m_windowStyle) )
msflags |= WS_BORDER;
// Create the toolbar control. // Create the toolbar control.
HWND hWndToolbar = CreateWindowEx HWND hWndToolbar = CreateWindowEx
( (
0L, // No extended styles. exStyle, // Extended styles.
TOOLBARCLASSNAME, // Class name for the toolbar. TOOLBARCLASSNAME, // Class name for the toolbar.
"", // No default text. "", // No default text.
msflags, // Styles msflags, // Styles
@@ -428,7 +436,8 @@ void wxToolBar95::GetSize(int *w, int *h) const
wxWindow::GetSize(w, h); wxWindow::GetSize(w, h);
// For some reason, the returned height is several pixels bigger than that // For some reason, the returned height is several pixels bigger than that
// displayed! // displayed!
*h -= 2; // Taking this fudge factor out now, it seems fine without it.
// *h -= 2;
} }
// The button size is bigger than the bitmap size // The button size is bigger than the bitmap size

View File

@@ -465,12 +465,20 @@ void wxToolBarMSW::Layout(void)
node = node->Next(); node = node->Next();
} }
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL ) if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
{
m_maxWidth += maxToolWidth; m_maxWidth += maxToolWidth;
else
m_maxHeight += maxToolHeight; m_maxHeight += maxToolHeight;
}
else
{
m_maxWidth += maxToolWidth;
m_maxHeight += maxToolHeight;
}
m_maxWidth += m_xMargin; m_maxWidth += m_xMargin;
m_maxHeight += m_yMargin; m_maxHeight += m_yMargin;
SetSize(m_maxWidth, m_maxHeight);
} }

View File

@@ -971,8 +971,11 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
case WXK_RETURN: case WXK_RETURN:
{ {
/* Oh yes it will, because we also specify DLGC_WANTCHARS
wxASSERT_MSG( m_windowStyle & wxTE_PROCESS_ENTER, wxASSERT_MSG( m_windowStyle & wxTE_PROCESS_ENTER,
"this text ctrl should never receive return" ); "this text ctrl should never receive return" );
*/
if ( (m_windowStyle & wxTE_MULTILINE) == 0 ) if ( (m_windowStyle & wxTE_MULTILINE) == 0 )
{ {
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
@@ -1007,8 +1010,8 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
// don't just call event.Skip() because this will cause TABs and ENTERs // don't just call event.Skip() because this will cause TABs and ENTERs
// be passed upwards and we don't always want this - instead process it // be passed upwards and we don't always want this - instead process it
// right here // right here
//Default(); Default();
event.Skip(); // event.Skip();
} }
long wxTextCtrl::MSWGetDlgCode() long wxTextCtrl::MSWGetDlgCode()

View File

@@ -59,6 +59,8 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/textctrl.h"
#include <string.h> #include <string.h>
#ifndef __GNUWIN32__ #ifndef __GNUWIN32__
@@ -234,6 +236,7 @@ void wxWindow::Init()
m_isWindow = TRUE; m_isWindow = TRUE;
// Generic // Generic
// m_windowCursor = * wxSTANDARD_CURSOR;
m_windowId = 0; m_windowId = 0;
m_isShown = TRUE; m_isShown = TRUE;
m_windowStyle = 0; m_windowStyle = 0;
@@ -938,7 +941,7 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
#define DIMENSION_TYPE int #define DIMENSION_TYPE int
#endif #endif
// Main Windows 3 window proc // Main Windows window proc
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{ {
wxASSERT( m_lastMsg == message && wxASSERT( m_lastMsg == message &&
@@ -1176,6 +1179,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
return MSWOnSysCommand(wParam, lParam); return MSWOnSysCommand(wParam, lParam);
break; break;
} }
case WM_COMMAND: case WM_COMMAND:
{ {
#ifdef __WIN32__ #ifdef __WIN32__
@@ -1227,7 +1231,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
return MSWOnMeasureItem((int)wParam, (WXMEASUREITEMSTRUCT *)lParam); return MSWOnMeasureItem((int)wParam, (WXMEASUREITEMSTRUCT *)lParam);
break; break;
} }
case WM_KEYDOWN: case WM_KEYDOWN:
// If this has been processed by an event handler, // If this has been processed by an event handler,
// return 0 now (we've handled it). // return 0 now (we've handled it).
@@ -1288,7 +1291,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
} }
break; break;
case WM_KEYUP: case WM_KEYUP:
{ {
if (!MSWOnKeyUp((WORD) wParam, lParam)) if (!MSWOnKeyUp((WORD) wParam, lParam))
@@ -1301,7 +1303,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
return Default(); return Default();
break; break;
} }
case WM_HSCROLL: case WM_HSCROLL:
{ {
#ifdef __WIN32__ #ifdef __WIN32__
@@ -1479,7 +1480,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
return 1L; return 1L;
break; break;
} }
case WM_GETMINMAXINFO: case WM_GETMINMAXINFO:
{ {
MINMAXINFO *info = (MINMAXINFO *)lParam; MINMAXINFO *info = (MINMAXINFO *)lParam;
@@ -1494,10 +1494,10 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
return MSWDefWindowProc(message, wParam, lParam ); return MSWDefWindowProc(message, wParam, lParam );
break; break;
} }
case WM_GETDLGCODE: case WM_GETDLGCODE:
{
return MSWGetDlgCode(); return MSWGetDlgCode();
}
case WM_SETCURSOR: case WM_SETCURSOR:
{ {
// don't set cursor for other windows, only for this one: this // don't set cursor for other windows, only for this one: this
@@ -1551,7 +1551,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
} }
} }
} }
return MSWDefWindowProc(message, wParam, lParam ); return MSWDefWindowProc(message, wParam, lParam );
default: default:
@@ -2147,6 +2146,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
if ( ::IsDialogMessage((HWND)GetHWND(), msg) ) if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
return TRUE; return TRUE;
} }
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
if ( m_tooltip ) if ( m_tooltip )
{ {
@@ -2157,6 +2157,15 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
} }
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
// In case we don't have wxTAB_TRAVERSAL style on.
// If we don't call this, we may never process Enter correctly.
if ( m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL) == 0 )
{
MSG *msg = (MSG *)pMsg;
if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
return TRUE;
}
return FALSE; return FALSE;
} }

View File

@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
const char *wxFloatToStringStr = "%.2f"; const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f"; const char *wxDoubleToStringStr = "%.2f";
#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
#if wxUSE_SHARED_LIBRARY #if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries) ///// Event tables (also must be in one, statically-linked file for shared libraries)