Can now switch between PostScript and WIN32 print dialogs

by setting the value of wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW.
Added first part of Peter Lenhard's WinCE DrawEllipticArc
implementation.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-08-15 10:17:14 +00:00
parent e32f486958
commit 12bdd77c85
11 changed files with 383 additions and 10 deletions

View File

@@ -301,6 +301,54 @@ public:
void DrawSpline(wxList *points) { DoDrawSpline(points); }
#endif // wxUSE_SPLINES
// Eventually we will have wxUSE_GENERIC_DRAWELLIPSE
#ifdef __WXWINCE__
//! Generic method to draw ellipses, circles and arcs with current pen and brush.
/*! \param x Upper left corner of bounding box.
* \param y Upper left corner of bounding box.
* \param w Width of bounding box.
* \param h Height of bounding box.
* \param sa Starting angle of arc
* (counterclockwise, start at 3 o'clock, 360 is full circle).
* \param ea Ending angle of arc.
* \param angle Rotation angle, the Arc will be rotated after
* calculating begin and end.
*/
void DrawEllipticArcRot( wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double sa = 0, double ea = 0, double angle = 0 )
{ DoDrawEllipticArcRot( x, y, width, height, sa, ea, angle ); }
void DrawEllipticArcRot( const wxPoint& pt,
const wxSize& sz,
double sa = 0, double ea = 0, double angle = 0 )
{ DoDrawEllipticArcRot( pt.x, pt.y, sz.x, sz.y, sa, ea, angle ); }
void DrawEllipticArcRot( const wxRect& rect,
double sa = 0, double ea = 0, double angle = 0 )
{ DoDrawEllipticArcRot( rect.x, rect.y, rect.width, rect.height, sa, ea, angle ); }
virtual void DoDrawEllipticArcRot( wxCoord x, wxCoord y,
wxCoord w, wxCoord h,
double sa = 0, double ea = 0, double angle = 0 );
//! Rotates points around center.
/*! This is a quite straight method, it calculates in pixels
* and so it produces rounding errors.
* \param points The points inside will be rotated.
* \param angle Rotating angle (counterclockwise, start at 3 o'clock, 360 is full circle).
* \param center Center of rotation.
*/
void Rotate( wxList* points, double angle, wxPoint center = wxPoint() );
// used by DrawEllipticArcRot
// Careful: wxList gets filled with points you have to delete later.
void CalculateEllipticPoints( wxList* points,
wxCoord xStart, wxCoord yStart,
wxCoord w, wxCoord h,
double sa, double ea );
#endif
// global DC operations
// --------------------

View File

@@ -16,6 +16,15 @@
* disable the settings which don't work for some compilers
*/
/*
* If using PostScript-in-MSW in Univ, must enable PostScript
*/
#if defined(__WXUNIVERSAL__) && wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW && !wxUSE_POSTSCRIPT
#undef wxUSE_POSTSCRIPT
#define wxUSE_POSTSCRIPT 1
#endif
#ifndef wxUSE_NORLANDER_HEADERS
#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1200)) || ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
# define wxUSE_NORLANDER_HEADERS 1

View File

@@ -874,7 +874,7 @@
#define wxUSE_POSTSCRIPT 0
// Set to 1 to use font metric files in GetTextExtent
#define wxUSE_AFM_FOR_POSTSCRIPT 0
#define wxUSE_AFM_FOR_POSTSCRIPT 1
// Set to 0 to disable PostScript print/preview architecture code under Windows
// (just use Windows printing).

View File

@@ -1,7 +1,7 @@
#ifndef _WX_PRINT_H_BASE_
#define _WX_PRINT_H_BASE_
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#if defined(__WXMSW__) && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
#include "wx/msw/printwin.h"
#ifndef wxPrinter

View File

@@ -1,7 +1,7 @@
#ifndef _WX_PRINTDLG_H_BASE_
#define _WX_PRINTDLG_H_BASE_
#if defined(__WXUNIVERSAL__) /* && !defined(__WXMSW__) */
#if defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXMSW__)
#include "wx/msw/printdlg.h"
@@ -19,7 +19,7 @@
#include "wx/generic/prntdlgg.h"
#endif
#if (defined(__WXUNIVERSAL__) /* && !defined(__WXMSW__) */ ) || (!defined(__WXMSW__) && !defined(__WXMAC__))
#if (defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) ) || (!defined(__WXMSW__) && !defined(__WXMAC__))
#define wxPrintDialog wxGenericPrintDialog
#define sm_classwxPrintDialog sm_classwxGenericPrintDialog

View File

@@ -818,8 +818,7 @@
// Set to 0 to disable print/preview architecture code
//
// (doesn't compile anyhow right now (Aug 2003))
#define wxUSE_PRINTING_ARCHITECTURE 0
#define wxUSE_PRINTING_ARCHITECTURE 1
// wxHTML sublibrary allows to display HTML in wxWindow programs and much,
// much more.