\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}
\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.
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}
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
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
\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}}}
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}
-\begin{verbatim}
+The following example sorts strings by their length.
+\begin{verbatim}
static int CompareStringLen(const wxString& first, const wxString& second)
{
return first.length() - second.length();
array.Add("four");
array.Sort(CompareStringLen);
-
\end{verbatim}
See also: \helpref{Sort}{wxarraystringsort}
+
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}}
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
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!
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.
+
\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
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.
+
-; 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
[CONFIG]
CreateButton("Up", "&Up", "JumpId(`wx.hlp', `Contents')")
BrowseButtons()
+
+[MAP]
+
+[BITMAPS]
+
\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}
-wxPython is a blending of the wxWindows GUI classes and the
+wxPython is a blending of the wxWindows GUI classes and the
\urlref{Python}{http://www.python.org/} programming language.
\wxheading{Python}
-So what is Python? Go to
+So what is Python? Go to
\urlref{http://www.python.org}{http://www.python.org}
to learn more, but in a nutshell Python is an interpreted,
interactive, object-oriented programming language. It is often
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
+Personally I prefer using Python for everything. I only use C++ when
+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.
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}
link}{http://www.python.org/download/Contributed.html\#Graphics}
for a listing of a few of them.
-
%----------------------------------------------------------------------
\section{Building wxPython}\label{wxpbuild}
I added a few minor features to SWIG to control some of the code
generation. If you want to play around with this the patches are in
wxPython/SWIG.patches and they should be applied to the 1.1p5 version
-of SWIG. These new patches are documented at
+of SWIG. These new patches are documented at
\urlref{this site}{http://starship.skyport.net/crew/robind/python/\#swig},
and they should also end up in the 1.2 version of SWIG.
will dump wxPython by setting the \tt{TARGETDIR} makefile variable.
The default is \tt{\$(WXWIN)/utils/wxPython}. If you leave it here
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
- systems.
-
+systems.
\wxheading{Win32}
\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
+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:
- \tt{python test1.py}
+\tt{python test1.py}
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
\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}
+\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.
-
\item Change to the \tt{\$(WXWIN)/utils/wxPython/tests} directory.
-
\item Try executing the test programs. For example:
- \tt{python test1.py}
-
+\tt{python test1.py}
\end{enumerate}
-
%----------------------------------------------------------------------
\section{Using wxPython}\label{wxpusing}
\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
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
-called? The answer is, yes it does. This is because many of the
+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
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
+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
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}
\section{Where to go for help}\label{wxphelp}
Since wxPython is a blending of multiple technologies, help comes from
-multiple sources. See
+multiple sources. See
\urlref{http://alldunn.com/wxPython}{http://alldunn.com/wxPython} for details on
various sources of help, but probably the best source is the
wxPython-users mail list. You can view the archive or subscribe by
wxpython-users@starship.python.net
-
-
-
-
-
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
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__
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 );
wxGauge *m_gauge;
wxSlider *m_slider;
wxButton *m_fontButton;
+#ifndef __WIN16__
wxSpinButton *m_spinbutton;
+#endif
wxTextCtrl *m_spintext;
MyTextCtrl *m_multitext;
MyTextCtrl *m_textentry;
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)
);
#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);
}
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()
{
#
# 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
#
# 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
-
-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
-
-# 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)
-<<
+TARGET=resource
+OBJECTS=$(TARGET).obj
-resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
- rc -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
+!include $(WXDIR)\src\makeprog.msc
-clean:
- -erase *.obj
- -erase *.exe
- -erase *.res
- -erase *.map
- -erase *.sbr
- -erase *.pdb
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 );
- * Last change: JS 13 Mar 97 5:02 pm
NAME Events
DESCRIPTION 'Event tester'
EXETYPE WINDOWS
}
return FALSE;
}
-
void wxEvtHandler::Connect( int id, int lastId,
wxEventType eventType,
wxObjectEventFunction func,
#include "wx/prntbase.h"
#include "wx/dcprint.h"
#include "wx/printdlg.h"
+#include "wx/module.h"
#include <stdlib.h>
#include <string.h>
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)
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;
+}
+
+
m_yMargin = 0;
m_toolPacking = 1;
m_toolSeparation = 5;
+ SetCursor(*wxSTANDARD_CURSOR);
return TRUE;
}
wxString val(control->GetValue());
- bool ok = true;
+ bool ok = TRUE;
// this format string should contian exactly one '%s'
const char *errormsg = _("'%s' is invalid");
{
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.");
}
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);
}
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
}
}
-/*
- * Paper size database for PostScript
- */
-
-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
- */
-
-#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 );
-*/
-}
+// A module to allow initialization/cleanup of PostScript-related
+// things without calling these functions from app.cpp.
-void wxPrintPaperDatabase::ClearDatabase()
+class WXDLLEXPORT wxPostScriptModule: public wxModule
{
- Clear();
-}
-
-void wxPrintPaperDatabase::AddPaperType(const char *name, int wmm, int hmm, int wp, int hp)
-{
- Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp));
-}
+DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
+public:
+ wxPostScriptModule() {}
+ bool OnInit();
+ void OnExit();
+};
-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
bool wxPostScriptModule::OnInit()
{
wxInitializePrintSetupData();
- wxThePrintPaperDatabase = new wxPrintPaperDatabase;
- wxThePrintPaperDatabase->CreateDatabase();
return TRUE;
}
void wxPostScriptModule::OnExit()
{
wxInitializePrintSetupData(FALSE);
- delete wxThePrintPaperDatabase;
- wxThePrintPaperDatabase = NULL;
}
#endif
#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)
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;
*/
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;
choice->SetSelection(sel);
return choice;
}
+#endif
+ // wxUSE_POSTSCRIPT
/*
* Generic page setup dialog
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;
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);
}
}
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;
/* 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;
/* 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;
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)
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)
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)
// (double deletion of the cursor).
wxSetCursor(wxNullCursor);
delete g_globalCursor;
+ g_globalCursor = NULL;
wxDeleteStockObjects() ;
* the message. Some may have accelerator tables, or have
* MDI complications.
*/
+
bool wxApp::ProcessMessage(WXMSG *wxmsg)
{
MSG *msg = (MSG *)wxmsg;
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
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
m_callback = 0;
+// m_windowCursor = wxNullCursor; // To avoid the standard cursor being used
}
wxControl::~wxControl(void)
#include "wx/wx.h"
#endif
+#include "wx/prntbase.h"
+
#define _MAXPATHLEN 500
// Useful buffer, initialized in wxCommonInit
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),
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"
{
if (event.m_keyCode == WXK_ESCAPE)
{
- // Behaviour changed in 2.0: we'll send a Cancel message
- // to the dialog instead of Close.
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- cancelEvent.SetEventObject( this );
- GetEventHandler()->ProcessEvent(cancelEvent);
+ // Behaviour changed in 2.0: we'll send a Cancel message
+ // to the dialog instead of Close.
+ wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ cancelEvent.SetEventObject( this );
+ GetEventHandler()->ProcessEvent(cancelEvent);
- return;
+ return;
}
}
// We didn't process this event.
else
{
SetReturnCode(wxID_CANCEL);
- this->Show(FALSE);
+ this->Show(FALSE);
}
}
$(GENDIR)\statusbr.obj \
$(GENDIR)\tabg.obj \
$(GENDIR)\textdlgg.obj\
+ $(GENDIR)\prntdlgg.obj \
$(GENDIR)\treectrl.obj
# Don't need these generic objects for Windows
# $(GENDIR)\fontdlgg.obj \
# $(GENDIR)\colrdlgg.obj \
# $(GENDIR)\printps.obj \
-# $(GENDIR)\prntdlgg.obj \
# $(GENDIR)\helpxlp.obj \
COMMONOBJS = \
// 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
{
#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
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,
else
return 0;
}
+#endif
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
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
node = node->Next();
}
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
+ {
m_maxWidth += maxToolWidth;
+ m_maxHeight += maxToolHeight;
+ }
else
+ {
+ m_maxWidth += maxToolWidth;
m_maxHeight += maxToolHeight;
+ }
m_maxWidth += m_xMargin;
m_maxHeight += m_yMargin;
+
+ SetSize(m_maxWidth, m_maxHeight);
}
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);
// 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()
#include "wx/msw/private.h"
+#include "wx/textctrl.h"
+
#include <string.h>
#ifndef __GNUWIN32__
m_isWindow = TRUE;
// Generic
+// m_windowCursor = * wxSTANDARD_CURSOR;
m_windowId = 0;
m_isShown = TRUE;
m_windowStyle = 0;
#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 &&
return MSWOnSysCommand(wParam, lParam);
break;
}
+
case WM_COMMAND:
{
#ifdef __WIN32__
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).
}
break;
-
case WM_KEYUP:
{
if (!MSWOnKeyUp((WORD) wParam, lParam))
return Default();
break;
}
-
case WM_HSCROLL:
{
#ifdef __WIN32__
return 1L;
break;
}
-
case WM_GETMINMAXINFO:
{
MINMAXINFO *info = (MINMAXINFO *)lParam;
return MSWDefWindowProc(message, wParam, lParam );
break;
}
-
case WM_GETDLGCODE:
- return MSWGetDlgCode();
-
+ {
+ return MSWGetDlgCode();
+ }
case WM_SETCURSOR:
{
// don't set cursor for other windows, only for this one: this
}
}
}
-
return MSWDefWindowProc(message, wParam, lParam );
default:
if ( ::IsDialogMessage((HWND)GetHWND(), msg) )
return TRUE;
}
+
#if wxUSE_TOOLTIPS
if ( m_tooltip )
{
}
#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;
}
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)