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:
@@ -131,18 +131,17 @@ otherwise.
|
||||
|
||||
\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}
|
||||
|
||||
\constfunc{wxWindow *}{GetTopWindow}{\void}
|
||||
|
||||
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}
|
||||
|
||||
\helpref{wxApp::SetTopWindow}{wxappsettopwindow}
|
||||
@@ -271,7 +270,7 @@ Under Windows, OnEndSession is called in response to the WM\_ENDSESSION message.
|
||||
\func{bool}{OnInit}{\void}
|
||||
|
||||
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.
|
||||
|
||||
@@ -423,31 +422,16 @@ deleted. If FALSE, the application will continue to run.}
|
||||
|
||||
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}
|
||||
|
||||
\func{void}{SetTopWindow}{\param{wxWindow* }{window}}
|
||||
|
||||
Sets the `top' window. You should normally call this from within \helpref{wxApp::OnInit}{wxapponinit} to
|
||||
let wxWindows know which is the main window.
|
||||
Sets the `top' window. You can call this from within \helpref{wxApp::OnInit}{wxapponinit} to
|
||||
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}
|
||||
|
||||
|
@@ -3,11 +3,11 @@
|
||||
wxArrayString is an efficient container for storing
|
||||
\helpref{wxString}{wxstring} objects. It has the same features as all
|
||||
\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
|
||||
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
|
||||
doesn't take more space than a C array {\it wxString[]} type (wxArrayString
|
||||
uses its knowledge of internals of wxString class to achieve this).
|
||||
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
|
||||
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
|
||||
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},
|
||||
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
|
||||
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
|
||||
specialization of \helpref{wxArray}{wxarray} class for the wxString member
|
||||
@@ -42,8 +42,7 @@ functions.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxArray}{wxarray}, \helpref{wxString}{wxstring}, \helpref{wxString
|
||||
overview}{wxstringoverview}
|
||||
\helpref{wxArray}{wxarray}, \helpref{wxString}{wxstring}, \helpref{wxString overview}{wxstringoverview}
|
||||
|
||||
\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
|
||||
second one.
|
||||
|
||||
Example: sorting strings by their length:
|
||||
\wxheading{Example}
|
||||
|
||||
The following example sorts strings by their length.
|
||||
|
||||
\begin{verbatim}
|
||||
|
||||
static int CompareStringLen(const wxString& first, const wxString& second)
|
||||
{
|
||||
return first.length() - second.length();
|
||||
@@ -243,7 +243,7 @@ array.Add("three");
|
||||
array.Add("four");
|
||||
|
||||
array.Sort(CompareStringLen);
|
||||
|
||||
\end{verbatim}
|
||||
|
||||
See also: \helpref{Sort}{wxarraystringsort}
|
||||
|
||||
|
@@ -11,16 +11,17 @@ headerRule = yes
|
||||
footerRule = yes
|
||||
useHeadingStyles = yes
|
||||
listItemIndent=40
|
||||
generateHPJ = no
|
||||
generateHPJ = yes
|
||||
htmlBrowseButtons = bitmap
|
||||
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"
|
||||
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}}
|
||||
;\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}}
|
||||
\overview [2] {\helpref{#1}{#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}}}}
|
||||
\const [0] {{\bf const}}
|
||||
|
@@ -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
|
||||
facilities for the messages translation with its
|
||||
\helpref{wxLocale}{wxlocale} class and is itself fully translated into several
|
||||
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
|
||||
languages. Please consult wxWindows home page for the most up-to-date
|
||||
translations - and if you translate it into one of the languages not done
|
||||
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
|
||||
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
|
||||
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
|
||||
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:
|
||||
|
||||
\begin{enumerate}\itemsep=0pt
|
||||
|
||||
\item Translating the strings in the program text using
|
||||
\helpref{wxGetTranslation}{wxgettranslation} or equivalently the \_() macro.
|
||||
|
||||
\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
|
||||
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.
|
||||
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
|
||||
all. This will create a text message catalog - a .po file.
|
||||
|
||||
\item Translating the strings extracted in the previous step to other
|
||||
language(s). It involves editing the .po file.
|
||||
|
||||
\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
|
||||
given language: see \helpref{wxLocale}{wxlocale}.
|
||||
|
||||
\end{enumerate}
|
||||
|
||||
See also the GNU gettext documentation linked from {\tt docs/html/index.htm} in
|
||||
your wxWindows distribution.
|
||||
|
||||
|
@@ -56,4 +56,3 @@ please look at the printout sample code.
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
|
@@ -62,7 +62,7 @@ only thing to remember is that the {\it cookie} passed to
|
||||
\helpref{GetNextChild}{wxtreectrlgetnextchild} should be the same variable (and
|
||||
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
|
||||
function \helpref{OnCompareItems}{wxtreectrloncompareitems} (by default the
|
||||
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
|
||||
the first/last sibling of the current item. '+', '-' and '*' expand, collapse
|
||||
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
|
||||
a tree and inserting a new one in it.
|
||||
nothing by default, but it is usual to associate them with deleting item from
|
||||
a tree and inserting a new one into it.
|
||||
|
||||
|
@@ -1,14 +1,8 @@
|
||||
; This file is maintained by HCW. Do not modify this file directly.
|
||||
|
||||
|
||||
[OPTIONS]
|
||||
COMPRESS=60 Hall Zeck
|
||||
LCID=0x409 0x0 0x0 ; English (United States)
|
||||
REPORT=Yes
|
||||
CONTENTS=Contents
|
||||
BMROOT=d:\wx2\wxwind~1\docs/latex/wx ; Assume that bitmaps are where the source is
|
||||
TITLE=wxWindows Manual
|
||||
BMROOT=.
|
||||
HLP=wx.hlp
|
||||
CONTENTS=Contents
|
||||
COMPRESS=HIGH
|
||||
|
||||
[FILES]
|
||||
wx.rtf
|
||||
@@ -16,3 +10,8 @@ wx.rtf
|
||||
[CONFIG]
|
||||
CreateButton("Up", "&Up", "JumpId(`wx.hlp', `Contents')")
|
||||
BrowseButtons()
|
||||
|
||||
[MAP]
|
||||
|
||||
[BITMAPS]
|
||||
|
||||
|
@@ -3,6 +3,8 @@
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}%
|
||||
|
||||
This addendum is written by Robin Dunn, author of the wxPython wrapper
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\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.
|
||||
|
||||
Currently wxPython is available for Win32 platforms and the GTK
|
||||
toolkit (wxGTK) on most *nix/X-windows platforms. The effort to
|
||||
enable wxPython for wxMotif will begin shortly. See \helpref{Building
|
||||
Python}{wxpbuild} for details about getting wxPython working for you.
|
||||
toolkit (wxGTK) on most Unix/X-windows platforms. The effort to
|
||||
enable wxPython for wxMotif will begin shortly. See \helpref{Building Python}{wxpbuild} for
|
||||
details about getting wxPython working for you.
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\section{Why use wxPython?}\label{wxpwhy}
|
||||
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
should be a straight forward task.
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\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}
|
||||
for a listing of a few of them.
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\section{Building wxPython}\label{wxpbuild}
|
||||
|
||||
@@ -150,7 +149,6 @@ However, you may prefer to use something that is already on your
|
||||
\tt{PYTHONPATH}, such as the \tt{site-packages} directory on Unix
|
||||
systems.
|
||||
|
||||
|
||||
\wxheading{Win32}
|
||||
|
||||
These instructions assume that you have Microsoft Visual C++ 5.0 or
|
||||
@@ -163,22 +161,16 @@ specified below.
|
||||
\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
|
||||
there, make sure \tt{wxUSE_OWNER_DRAWN} is also set to 1.
|
||||
|
||||
\item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory.
|
||||
|
||||
\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
|
||||
above.
|
||||
|
||||
\item Run \tt{nmake -f makefile.vc}
|
||||
|
||||
\item If it builds successfully, congratulations! Move on to the next
|
||||
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
|
||||
\urlref{http://alldunn.com/wxPython}{http://alldunn.com/wxPython}.
|
||||
|
||||
\item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory.
|
||||
|
||||
\item Try executing the test programs. Note that some of these print
|
||||
diagnositc or test info to standard output, so they will require the
|
||||
console version of python. For example:
|
||||
@@ -187,10 +179,8 @@ console version of python. For example:
|
||||
|
||||
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.
|
||||
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
\wxheading{Unix}
|
||||
|
||||
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
|
||||
\item Change into the \tt{\$(WXWIN)/utils/wxPython/src} directory.
|
||||
|
||||
\item Edit \tt{Setup.in} and ensure that the flags, directories, and toolkit
|
||||
options are correct, (hopefully this will be done by \tt{configure}
|
||||
soon.) See the above commentary about \tt{TARGETDIR}. There are a
|
||||
few sample Setup.in.[platform] files provided.
|
||||
|
||||
\item Run this command to generate a makefile:
|
||||
|
||||
\tt{make -f Makefile.pre.in boot}
|
||||
|
||||
\item Once you have the \tt{Makefile}, run \bftt{make} to build and then
|
||||
\bftt{make install} to install the wxPython extension module.
|
||||
|
||||
\item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory.
|
||||
|
||||
\item Try executing the test programs. For example:
|
||||
|
||||
\tt{python test1.py}
|
||||
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\section{Using wxPython}\label{wxpusing}
|
||||
|
||||
@@ -325,13 +309,14 @@ it by issuing this command:
|
||||
\end{verbatim}
|
||||
\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
|
||||
into the current module's namespace. If you prefer to reduce
|
||||
namespace polution you can use "\tt{from wxPython import wx}" and
|
||||
then access all the wxPython identifiers through the wx module, for
|
||||
example, "\tt{wx.wxFrame}".
|
||||
|
||||
\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
|
||||
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
|
||||
that the first arguemnt to the event helpers is always the window that
|
||||
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
|
||||
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
|
||||
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
|
||||
\em{standard} events are attached to windows that have the associated
|
||||
\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
|
||||
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
|
||||
the panel or the static text items that are created. Those of you
|
||||
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
|
||||
attached to their parents, the parents manage them and delete them
|
||||
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
|
||||
the Destroy() method as shown on line 36.
|
||||
|
||||
\item Just like wxWindows in C++, wxPython apps need to create a class
|
||||
derived from \tt{wxApp} (line 56) that implements a method named
|
||||
\tt{OnInit}, (line 59.) This method should create the application's
|
||||
main window (line 62) and use \tt{wxApp.SetTopWindow()} (line 66) to
|
||||
inform wxWindows about it.
|
||||
|
||||
\item And finally, at line 72 an instance of the application class is
|
||||
created. At this point wxPython finishes initializing itself, and calls
|
||||
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
|
||||
loop which continues until the application terminates or all the top
|
||||
level windows are closed.
|
||||
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
\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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -267,46 +267,6 @@ private:
|
||||
WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
|
||||
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
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
|
@@ -340,5 +340,47 @@ public:
|
||||
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
|
||||
// _WX_PRNTBASEH__
|
||||
|
@@ -95,7 +95,9 @@ public:
|
||||
void OnSetFont( wxCommandEvent &event );
|
||||
void OnPageChanged( wxNotebookEvent &event );
|
||||
void OnSliderUpdate( wxCommandEvent &event );
|
||||
#ifndef __WIN16__
|
||||
void OnSpinUpdate( wxSpinEvent &event );
|
||||
#endif
|
||||
void OnPasteFromClipboard( wxCommandEvent &event );
|
||||
void OnCopyToClipboard( wxCommandEvent &event );
|
||||
void OnMoveToEndOfText( wxCommandEvent &event );
|
||||
@@ -108,7 +110,9 @@ public:
|
||||
wxGauge *m_gauge;
|
||||
wxSlider *m_slider;
|
||||
wxButton *m_fontButton;
|
||||
#ifndef __WIN16__
|
||||
wxSpinButton *m_spinbutton;
|
||||
#endif
|
||||
wxTextCtrl *m_spintext;
|
||||
MyTextCtrl *m_multitext;
|
||||
MyTextCtrl *m_textentry;
|
||||
@@ -336,7 +340,9 @@ EVT_BUTTON (ID_RADIOBOX_FONT, MyPanel::OnRadioButtons)
|
||||
EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons)
|
||||
EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont)
|
||||
EVT_SLIDER (ID_SLIDER, MyPanel::OnSliderUpdate)
|
||||
#ifndef __WIN16__
|
||||
EVT_SPIN (ID_SPIN, MyPanel::OnSpinUpdate)
|
||||
#endif
|
||||
EVT_BUTTON (ID_PASTE_TEXT, MyPanel::OnPasteFromClipboard)
|
||||
EVT_BUTTON (ID_COPY_TEXT, MyPanel::OnCopyToClipboard)
|
||||
EVT_BUTTON (ID_MOVE_END_ZONE, MyPanel::OnMoveToEndOfText)
|
||||
@@ -541,8 +547,10 @@ m_text(NULL), m_notebook(NULL)
|
||||
);
|
||||
#endif
|
||||
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->SetRange(0,100);
|
||||
#endif
|
||||
m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge);
|
||||
}
|
||||
|
||||
@@ -873,12 +881,14 @@ void MyPanel::OnSliderUpdate( wxCommandEvent &WXUNUSED(event) )
|
||||
m_gauge->SetValue( m_slider->GetValue() );
|
||||
}
|
||||
|
||||
#ifndef __WIN16__
|
||||
void MyPanel::OnSpinUpdate( wxSpinEvent &event )
|
||||
{
|
||||
wxString value;
|
||||
value.sprintf( "%d", (int)event.GetPosition() );
|
||||
m_spintext->SetValue( value );
|
||||
}
|
||||
#endif
|
||||
|
||||
MyPanel::~MyPanel()
|
||||
{
|
||||
|
@@ -1,88 +1,17 @@
|
||||
#
|
||||
# File: makefile.dos
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds printing example (DOS).
|
||||
# Makefile : Builds 16-bit sample, VC++ 1.5
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info.
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\makemsc.env
|
||||
|
||||
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
|
||||
TARGET=printing
|
||||
OBJECTS=$(TARGET).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.msc
|
||||
|
||||
|
@@ -1,86 +1,17 @@
|
||||
#
|
||||
# File: makefile.dos
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds resource example (DOS).
|
||||
# Makefile : Builds 16-bit sample, VC++ 1.5
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info.
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\makemsc.env
|
||||
TARGET=resource
|
||||
OBJECTS=$(TARGET).obj
|
||||
|
||||
THISDIR = $(WXDIR)\samples\resource
|
||||
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
|
||||
!include $(WXDIR)\src\makeprog.msc
|
||||
|
||||
# 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
|
||||
|
@@ -70,7 +70,7 @@ bool MyApp::OnInit(void)
|
||||
frame->SetMenuBar(menuBar);
|
||||
|
||||
// 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 );
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
* Last change: JS 13 Mar 97 5:02 pm
|
||||
NAME Events
|
||||
DESCRIPTION 'Event tester'
|
||||
EXETYPE WINDOWS
|
||||
|
@@ -429,7 +429,6 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxEvtHandler::Connect( int id, int lastId,
|
||||
wxEventType eventType,
|
||||
wxObjectEventFunction func,
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "wx/prntbase.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -66,6 +67,7 @@ IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow)
|
||||
IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow)
|
||||
IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
|
||||
IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
|
||||
EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
|
||||
@@ -758,3 +760,121 @@ void wxPrintPreviewBase::SetZoom(int percent)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -66,6 +66,7 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos
|
||||
m_yMargin = 0;
|
||||
m_toolPacking = 1;
|
||||
m_toolSeparation = 5;
|
||||
SetCursor(*wxSTANDARD_CURSOR);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -134,7 +134,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
|
||||
wxString val(control->GetValue());
|
||||
|
||||
bool ok = true;
|
||||
bool ok = TRUE;
|
||||
|
||||
// this format string should contian exactly one '%s'
|
||||
const char *errormsg = _("'%s' is invalid");
|
||||
@@ -143,37 +143,37 @@ bool wxTextValidator::Validate(wxWindow *parent)
|
||||
{
|
||||
if ( !m_includeList.Member(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
else if ( m_validatorStyle & wxFILTER_EXCLUDE_LIST )
|
||||
{
|
||||
if ( m_excludeList.Member(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain ASCII characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain alphabetic characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should only contain alphabetic or numeric characters.");
|
||||
}
|
||||
else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
|
||||
{
|
||||
ok = false;
|
||||
ok = FALSE;
|
||||
|
||||
errormsg = _("'%s' should be numeric.");
|
||||
}
|
||||
|
@@ -203,7 +203,7 @@ IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
|
||||
|
||||
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
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);
|
||||
}
|
||||
|
@@ -1837,10 +1837,8 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const
|
||||
wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL;
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
#endif
|
||||
|
||||
// Redundant now I think
|
||||
@@ -2338,86 +2336,19 @@ void wxInitializePrintSetupData(bool init)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Paper size database for PostScript
|
||||
*/
|
||||
// A module to allow initialization/cleanup of PostScript-related
|
||||
// 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;
|
||||
heightMM = hmm;
|
||||
widthPixels = wp;
|
||||
heightPixels = hp;
|
||||
pageName = copystring(name);
|
||||
}
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
|
||||
public:
|
||||
wxPostScriptModule() {}
|
||||
bool OnInit();
|
||||
void OnExit();
|
||||
};
|
||||
|
||||
wxPrintPaperType::~wxPrintPaperType()
|
||||
{
|
||||
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;
|
||||
}
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
|
||||
|
||||
/*
|
||||
* Initialization/cleanup module
|
||||
@@ -2426,8 +2357,6 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name)
|
||||
bool wxPostScriptModule::OnInit()
|
||||
{
|
||||
wxInitializePrintSetupData();
|
||||
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
||||
wxThePrintPaperDatabase->CreateDatabase();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2435,8 +2364,6 @@ bool wxPostScriptModule::OnInit()
|
||||
void wxPostScriptModule::OnExit()
|
||||
{
|
||||
wxInitializePrintSetupData(FALSE);
|
||||
delete wxThePrintPaperDatabase;
|
||||
wxThePrintPaperDatabase = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -39,12 +39,21 @@
|
||||
#endif
|
||||
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/generic/dcpsg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/printdlg.h"
|
||||
|
||||
// For print paper things
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
|
||||
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
|
||||
@@ -69,7 +78,7 @@ extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
|
||||
|
||||
|
||||
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 )
|
||||
printData = *data;
|
||||
@@ -274,7 +283,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC(void)
|
||||
*/
|
||||
|
||||
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 )
|
||||
printData = *data;
|
||||
@@ -408,6 +417,8 @@ wxChoice *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
||||
choice->SetSelection(sel);
|
||||
return choice;
|
||||
}
|
||||
#endif
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
/*
|
||||
* Generic page setup dialog
|
||||
@@ -429,33 +440,10 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
|
||||
printDialog->ShowModal();
|
||||
|
||||
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):
|
||||
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 )
|
||||
pageData = *data;
|
||||
@@ -583,12 +571,16 @@ bool wxGenericPageSetupDialog::TransferDataFromWindow(void)
|
||||
int sel = orientationRadioBox->GetSelection();
|
||||
if (sel == 0)
|
||||
{
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT);
|
||||
#endif
|
||||
pageData.SetOrientation(wxPORTRAIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxThePrintSetupData->SetPrinterOrientation(wxLANDSCAPE);
|
||||
#endif
|
||||
pageData.SetOrientation(wxLANDSCAPE);
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *
|
||||
|
||||
wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
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_value = value;
|
||||
|
@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
|
||||
|
||||
/* For printing several pages */
|
||||
int wxPageNumber;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
// Now in prntbase.cpp
|
||||
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
/* GDI Object Lists */
|
||||
wxBrushList *wxTheBrushList = (wxBrushList *) NULL;
|
||||
|
@@ -59,7 +59,9 @@ char *wxOsVersion = (char *) NULL;
|
||||
|
||||
/* For printing several pages */
|
||||
int wxPageNumber;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
// Now in prntbase.cpp
|
||||
// wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase *) NULL;
|
||||
|
||||
/* GDI Object Lists */
|
||||
wxBrushList *wxTheBrushList = (wxBrushList *) NULL;
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -128,10 +128,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
@@ -491,6 +491,7 @@ void wxApp::CleanUp()
|
||||
// (double deletion of the cursor).
|
||||
wxSetCursor(wxNullCursor);
|
||||
delete g_globalCursor;
|
||||
g_globalCursor = NULL;
|
||||
|
||||
wxDeleteStockObjects() ;
|
||||
|
||||
@@ -932,6 +933,7 @@ void wxApp::Dispatch()
|
||||
* the message. Some may have accelerator tables, or have
|
||||
* MDI complications.
|
||||
*/
|
||||
|
||||
bool wxApp::ProcessMessage(WXMSG *wxmsg)
|
||||
{
|
||||
MSG *msg = (MSG *)wxmsg;
|
||||
|
@@ -78,11 +78,6 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
|
||||
wxGetInstance(), NULL);
|
||||
|
||||
#if wxUSE_CTL3D
|
||||
// if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
|
||||
// Ctl3dSubclassCtl(wx_button);
|
||||
#endif
|
||||
|
||||
m_hWnd = (WXHWND)wx_button;
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
|
@@ -53,6 +53,7 @@ wxControl::wxControl(void)
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
m_callback = 0;
|
||||
// m_windowCursor = wxNullCursor; // To avoid the standard cursor being used
|
||||
}
|
||||
|
||||
wxControl::~wxControl(void)
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
#define _MAXPATHLEN 500
|
||||
|
||||
// Useful buffer, initialized in wxCommonInit
|
||||
@@ -154,11 +156,6 @@ const char *wxDoubleToStringStr = "%.2f";
|
||||
const char *wxUserResourceStr = "TEXT";
|
||||
#endif
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
class wxPrintPaperDatabase;
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
/*
|
||||
* 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(wxPrintSetupData, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
|
||||
#endif
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
#include "wx/resource.h"
|
||||
|
@@ -70,6 +70,7 @@ GENERICOBJS= \
|
||||
$(GENDIR)\statusbr.obj \
|
||||
$(GENDIR)\tabg.obj \
|
||||
$(GENDIR)\textdlgg.obj\
|
||||
$(GENDIR)\prntdlgg.obj \
|
||||
$(GENDIR)\treectrl.obj
|
||||
|
||||
# Don't need these generic objects for Windows
|
||||
@@ -77,7 +78,6 @@ GENERICOBJS= \
|
||||
# $(GENDIR)\fontdlgg.obj \
|
||||
# $(GENDIR)\colrdlgg.obj \
|
||||
# $(GENDIR)\printps.obj \
|
||||
# $(GENDIR)\prntdlgg.obj \
|
||||
# $(GENDIR)\helpxlp.obj \
|
||||
|
||||
COMMONOBJS = \
|
||||
|
@@ -289,53 +289,6 @@ void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
|
||||
// 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
|
||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
|
||||
{
|
||||
|
@@ -54,10 +54,12 @@
|
||||
#endif // Win32/16
|
||||
|
||||
// wnd proc for radio buttons
|
||||
#ifdef __WIN32__
|
||||
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hWnd,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global vars
|
||||
@@ -706,14 +708,19 @@ void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
|
||||
if ( !s_wndprocRadioBtn )
|
||||
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_USERDATA, (long)this);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// window proc for radio buttons
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
UINT msg,
|
||||
WPARAM wParam,
|
||||
@@ -777,4 +784,5 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -151,10 +151,18 @@ bool wxToolBar95::Create(wxWindow *parent,
|
||||
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.
|
||||
HWND hWndToolbar = CreateWindowEx
|
||||
(
|
||||
0L, // No extended styles.
|
||||
exStyle, // Extended styles.
|
||||
TOOLBARCLASSNAME, // Class name for the toolbar.
|
||||
"", // No default text.
|
||||
msflags, // Styles
|
||||
@@ -428,7 +436,8 @@ void wxToolBar95::GetSize(int *w, int *h) const
|
||||
wxWindow::GetSize(w, h);
|
||||
// For some reason, the returned height is several pixels bigger than that
|
||||
// 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
|
||||
|
@@ -465,12 +465,20 @@ void wxToolBarMSW::Layout(void)
|
||||
node = node->Next();
|
||||
}
|
||||
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
|
||||
{
|
||||
m_maxWidth += maxToolWidth;
|
||||
else
|
||||
m_maxHeight += maxToolHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maxWidth += maxToolWidth;
|
||||
m_maxHeight += maxToolHeight;
|
||||
}
|
||||
|
||||
m_maxWidth += m_xMargin;
|
||||
m_maxHeight += m_yMargin;
|
||||
|
||||
SetSize(m_maxWidth, m_maxHeight);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -971,8 +971,11 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
|
||||
case WXK_RETURN:
|
||||
{
|
||||
/* Oh yes it will, because we also specify DLGC_WANTCHARS
|
||||
wxASSERT_MSG( m_windowStyle & wxTE_PROCESS_ENTER,
|
||||
"this text ctrl should never receive return" );
|
||||
*/
|
||||
|
||||
if ( (m_windowStyle & wxTE_MULTILINE) == 0 )
|
||||
{
|
||||
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
|
||||
// be passed upwards and we don't always want this - instead process it
|
||||
// right here
|
||||
//Default();
|
||||
event.Skip();
|
||||
Default();
|
||||
// event.Skip();
|
||||
}
|
||||
|
||||
long wxTextCtrl::MSWGetDlgCode()
|
||||
|
@@ -59,6 +59,8 @@
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifndef __GNUWIN32__
|
||||
@@ -234,6 +236,7 @@ void wxWindow::Init()
|
||||
m_isWindow = TRUE;
|
||||
|
||||
// Generic
|
||||
// m_windowCursor = * wxSTANDARD_CURSOR;
|
||||
m_windowId = 0;
|
||||
m_isShown = TRUE;
|
||||
m_windowStyle = 0;
|
||||
@@ -938,7 +941,7 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
|
||||
#define DIMENSION_TYPE int
|
||||
#endif
|
||||
|
||||
// Main Windows 3 window proc
|
||||
// Main Windows window proc
|
||||
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
wxASSERT( m_lastMsg == message &&
|
||||
@@ -1176,6 +1179,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWOnSysCommand(wParam, lParam);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -1227,7 +1231,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWOnMeasureItem((int)wParam, (WXMEASUREITEMSTRUCT *)lParam);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_KEYDOWN:
|
||||
// If this has been processed by an event handler,
|
||||
// return 0 now (we've handled it).
|
||||
@@ -1288,7 +1291,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_KEYUP:
|
||||
{
|
||||
if (!MSWOnKeyUp((WORD) wParam, lParam))
|
||||
@@ -1301,7 +1303,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return Default();
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_HSCROLL:
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -1479,7 +1480,6 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return 1L;
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
MINMAXINFO *info = (MINMAXINFO *)lParam;
|
||||
@@ -1494,10 +1494,10 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
return MSWDefWindowProc(message, wParam, lParam );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
{
|
||||
return MSWGetDlgCode();
|
||||
|
||||
}
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
// 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 );
|
||||
|
||||
default:
|
||||
@@ -2147,6 +2146,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
if ( m_tooltip )
|
||||
{
|
||||
@@ -2157,6 +2157,15 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
||||
}
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@@ -131,10 +131,6 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||
#endif
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
|
Reference in New Issue
Block a user