Commit Graph

145 Commits

Author SHA1 Message Date
Vadim Zeitlin
e29bf4b056 Add wxDC::GetFontMetrics() and implement it for wxMSW.
Add a new wxDC method allowing to retrieve the font characteristics not
available from GetTextExtent(), notably the internal leading (and also the
average font width).

Currently this is implemented for wxMSW only, the internal leading is always 0
in the other ports.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 12:48:13 +00:00
Paul Cornett
081d8d96db Move wxColourData and wxFontData into separate files.
This eliminates a linking dependency that would drag in the printing
code for any program that used wxColourDialog or wxFontDialog (which
is currently all of them, due to more link dependencies...)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-07 05:26:57 +00:00
Vadim Zeitlin
ca4adfd062 Added wxDCFontChanger ctor not changing font.
This is similar to the existing wxDCTextColourChanger ctor not changing colour
and is useful in the same kind of situations: when the font may or not be
changed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:13 +00:00
Vadim Zeitlin
942d5e2d72 Replaced GraphicsHDC from src/msw/renderer.cpp with wxDC::GetTempHDC().
wxDC::GetTempHDC() method provides a convenient and safe way to retrieve HDC
from a wxDC object, whether it is using GDI or GDI+. It is implemented using
(MSW-specific) virtual functions in wxDC and so doesn't need ugly hacks like
wxDynamicCast which were used in src/msw/renderer.cpp to achieve the same
effect.

Also, we now use GetTempHDC() consistently in all wxMSW rendering methods as
the old GraphicsHDC was only used in some of them meaning that many methods
didn't work at all with wxGCDC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-05 22:56:58 +00:00
Vadim Zeitlin
4feecbb929 added wxDC::CopyAttributes() and use it in wxBufferedDC to ensure that wxAutoBufferedPaintDC font is correctly initialized from the window font, as it already happens with wxPaintDC that it mimics
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-31 19:40:04 +00:00
Francesco Montorsi
e65a6cc1ec try to clear the device/logical unit fog; remove unused and unsupported (an assertion fails if they are used) wxMM_ constants; better docs for the supported wxMM_ constants; use MM_ANISOTROPIC in old win16 metafile code instead of wxMM_ANISOTROPIC since it's not supported by wx code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-25 12:08:12 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Vadim Zeitlin
713e92905e don't deprecate the entire wxDrawObject class, this results in warnings when we just declare wxDC::DrawObject(); instead deprecate just its ctor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-25 12:01:35 +00:00
Vadim Zeitlin
0a0e498415 deprecate wxDrawObject (#9860)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-25 11:32:41 +00:00
Francesco Montorsi
79bd5e982b use #if instead of #ifdef for WX_COMPAT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-09 12:40:11 +00:00
Francesco Montorsi
89efaf2b65 change generic ints to enums in wxDC (closes #9959)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-08 14:21:53 +00:00
Francesco Montorsi
c48d6cdf1f documented the wxDCBrushChanger, wxDCPenChanger, wxDCTextColourChanger; introduced a wxDCFontChanger
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-26 15:54:08 +00:00
Francesco Montorsi
6d52ca536a make GetPaperRect() and GetResolution() const functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-15 11:10:34 +00:00
Vadim Zeitlin
f57258724a added wxDC::GetHDC() for backwards compatibility with the existing wxMSW code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-08 16:09:09 +00:00
Václav Slavík
12ca55868c wxGTK: Fixed printing to use fonts sizes adjustment consistent with wxMSW. In
particular, screen resolution no longer affects text size in printed output
when using wx's map-screen-to-paper approach to printing.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-28 09:33:04 +00:00
Vadim Zeitlin
edc5134402 initialize wx{Client,Paint,Window}DC with fonts/colours of its window
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-21 17:17:00 +00:00
Vadim Zeitlin
9928536b3a remove Create{Window,Client,Paint}DC() methods without window parameter -- they don't make sense as these DCs must always be associated with a window and are unusable if created without it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-21 17:05:45 +00:00
Vadim Zeitlin
fdaad94e75 deprecate wxDC::SetClippingRegion(wxRegion) overload and replace it with SetDeviceClippingRegion() to avoid confusion due to use of different kind of coordinates in this and other overloads of the same function; also rename wxDCImpl::DoSetClippingRegionAsRegion() to DoSetDeviceClippingRegion(); finally use bounding box of the region passed to wxDCClipper ctor to avoid interpreting coordinates differently for different ctors of the same class (see #8970)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-08 01:45:56 +00:00
Vadim Zeitlin
7210c3a12c fix confusion with (Do)DrawSplines() overloads; don't allocate points on the heap unnecessarily when we can just do it on the stack
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-08 14:12:38 +00:00
Robert Roebling
0b822969a6 Added new wxGraphicsContext:Create( wxPrinterDC ) instead of wxDC:CreateGraphicsContext
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-28 20:39:57 +00:00
Robert Roebling
2b44ffc0e7 Added wxDC::CreateGraphicsContext and implemented it for a few DCs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-25 11:05:16 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Vadim Zeitlin
2261baf7a4 restore generic DrawEllipticArc() used by CE which was lost during the great wxDC refactoring somehow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-02-21 16:13:39 +00:00
Stefan Csomor
1f991c9d52 keeping the constness
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-22 09:05:13 +00:00
Chris Elliott
243ef54b39 fix bug VC6 with returning void function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-16 20:10:17 +00:00
Vadim Zeitlin
4a624f6ed3 fixed wxDFB compilation after wxDC-related changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-14 22:41:07 +00:00
Vadim Zeitlin
477c48bf58 add wxPrintData forward declaration (blind fix for Mac compilation)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-01 20:04:53 +00:00
Vadim Zeitlin
f2498c4e33 free wxDCFactory::m_factory; also renamed SetDCFactory() to just Set()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 21:11:00 +00:00
Vadim Zeitlin
f087550131 remove default wxDC ctor to make it impossible to construct DCs without the associated wxDCImpl (this breaks compilation of classes such as wxMirrorDC instead of crashing at run-time); fixed wxMirrorDC compilation after breaking it; renamed wxDCFactory::GetFactory() to just Get(), no need to be repetitive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 20:56:12 +00:00
Robert Roebling
6b4f4d4731 Compile with printarch off
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 19:59:43 +00:00
Robert Roebling
888dde65f4 DC reorganization
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-30 13:48:22 +00:00
Robert Roebling
4f37154e98 Further wxDC changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-14 14:49:40 +00:00
Robert Roebling
c8ddadff84 More DC changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-13 13:20:15 +00:00
Robert Roebling
3204315276 add const overload for GetImpl()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-12 19:03:03 +00:00
Stefan Csomor
cc18b1c7af forward port from 2.8
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-09 20:25:57 +00:00
Robert Roebling
b0d7707bc4 Use wxPointList instead of wxList in wxDC code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-19 14:53:55 +00:00
Robert Roebling
ab171e9502 Converted wxGTK's basic DC classes to new DC code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-23 11:27:41 +00:00
Robert Roebling
ca7db61eac more work on wxDC reorganizing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-21 10:59:21 +00:00
Robert Roebling
da249bc359 First update patch for GTK+ print
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-13 12:23:39 +00:00
Robert Roebling
02255e07d7 Rewrote scaling code for GNOME print backend. The inverted Y axis is now handled internally. Resulotion is not set to 600 dpi
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-10 14:00:44 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Robert Roebling
2970ae54d3 Beginning to make wxDC code compile both before
and after the DC reorg to make the transition
    smoother (indeed possible).
  Move the wxImplDC code to its future place in
    dcbase.cpp and wx/dc.h


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-08 23:47:43 +00:00
Robert Roebling
cfa87e8121 Moved deprecated code to source file (didn't compile
as inlined, somehow).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-05 15:09:45 +00:00
Robert Roebling
1f540d9658 Added wxDEPRECATED() around old wxDC methods taking
long and not wxCoord.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-05 15:04:24 +00:00
Robert Roebling
ad973712cd Put old wxDC methods using long instead of wxCoord
into WXWIN_COMP_2_8


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-03 22:25:30 +00:00
Robert Roebling
04ab8b6ddf Moved all the coordinate system calculation to wxDCBase
and thus removed all the duplicated code in all wxDC
   classes.
  Problematic is that wxSVGFileDC and wxPostscriptDC inherit
   from wxDC and therefore include platform specific code
   (also before this change) so I chose to override all
   SetLogicalOrigin() etc. methods in these classes and
   call their wxDCBase methods thereby circumventing the
   platform dependent code.
  I'm afraid the Mac code will require updating, too.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-02 11:05:45 +00:00
Robert Roebling
621b83d9b3 Made device to logical and vv conversion methods
virtual and implement them like any other method
    in the wxDC classes, not only in the their files
    but somehow belonging to the wxDCBase class.
  This is required for plugging in differnt DC backends
    with different conversions.
  Ideally (and absolutely possible ) all these methods
    should be removed and just the one in wxDCBase
    should stay using values set in the various
    derived classes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-01 21:28:29 +00:00
Vadim Zeitlin
c94f845b16 changed wxDC::GetTextExtent() and related methods to take const wxFont pointer, for consistency with wxWindow::GetTextExtent() and because it generally doesn't need a non-const font
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-25 01:49:47 +00:00
Vadim Zeitlin
e3b81044ee wxDC::StretchBlit() for wxMac and wxMSW (patch 1611973)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-18 15:32:27 +00:00
Vadim Zeitlin
c1dc9f8394 removed WXWIN_COMPATIBILITY_2_4 from common and wxMSW files (patch 1675546)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-07 11:35:04 +00:00