Commit Graph

166 Commits

Author SHA1 Message Date
Vadim Zeitlin
72790218cb Fix wrongly restoring clipping region in wxDCClipper
The change of 2a8c290e0d was wrong as it
unconditionally restored m_oldClipRect in dtor, even when it was empty,
indicating that no clipping had been in effect when wxDCClipper was
constructed. This totally broke all the code using wxDCClipper, notably
generic wxListCtrl which wasn't repainted correctly at all.

Fix this by checking if the clipping rectangle is not empty before
restoring it, this should work as well as we can make it without having
GetClippingRegion() that could return an invalid region if no clipping
is in effect.

See #13834.

Closes #18066.
2018-01-29 15:36:21 +01:00
jonkraber
2a8c290e0d Restore previous clipping box in wxDCClipper
Remember the clipping box of the previously active clipping region in
wxDCClipper ctor and restore it in its dtor.

See #13834.
2017-12-24 15:46:57 +01:00
Artur Wieczorek
277f9c58a1 Fix retrieving bounding box coordinates
Bounding box coordinates have to be calculated and stored internally in device units to be independent on changes of logical coordinates between calls to wxDC::CalcBoundingBox.
These stored coordinates are converted to the logical units on demand when they are retrieved with call to wxDC::MinX, MinY, MaxX or MaxY.

Closes #17667.
2016-09-16 22:04:54 +02:00
Artur Wieczorek
53230aaf4d Fixed retrieving clipping box for transformed wxDC
Because wxDC can be the subject of geometric transformations (like translation, scaling) so we cannot assume in the calculations of the clipping box that DC origin is always at (0,0) and its logical size is the same as physical size. To get correct result we have to use logical coordinates of wxDC area in all clipping box calculations.
2016-07-09 23:38:31 +02:00
Artur Wieczorek
8615921f42 Fixed retrieving clipping box parameters when there is no clipping region set.
When there is no clipping region currently set then current effective clipping region is identical with entire DC surface and therefore DC size should be returned as a region size.

Closes #17013
2016-07-03 22:39:48 +02:00
Tobias Taschner
8282c1be0f Remove Windows CE support
Windows CE doesn't seem to be supported by Microsoft any longer. Last CE
release was in early 2013 and the PocketPC and Smartphone targets supported by
wxWidgets are long gone.

The build files where already removed in an earlier cleanup this commit
removes all files, every #ifdef and all documentation regarding the Windows CE
support.

Closes https://github.com/wxWidgets/wxWidgets/pull/81
2015-09-23 00:52:30 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Dimitri Schoolwerth
aeef5a4c29 Compilation fix for --disable-precomp-headers in combination with --disable-all-features .
Fix an error for compile step of "Linux i386 wxGTK trunk no features" buildbot by forward declaring wxWindow class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 11:25:54 +00:00
Paul Cornett
8b4ae731d3 use wxOVERRIDE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 00:02:23 +00:00
Vadim Zeitlin
ce47b38a84 Don't include wx/cursor.h from wx/dc.h.
This is simply not needed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:28:41 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Stefan Csomor
538a2cfaf2 adding ContentScaleFactor support to dc - defaulting to 1.0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-25 12:24:34 +00:00
Paul Cornett
4787c92d39 use const arrays for wxDC array parameters, closes #10712
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-18 17:27:51 +00:00
Vadim Zeitlin
332afcdb2f Make GetClippingBox() work for wxPrinterDC in wxGTK.
GetClippingBox() implementation relies on wxDCImpl::m_clip[XY][12] being
updated in DoSetClippingRegion() but this wasn't done here. Fix this by adding
the code to do this to the base class version of this method and calling it
from wxGtkPrinterDCImpl.

Also, refactor wxGCDCImpl to reuse the same code instead of duplicating it.

Closes #14697.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-14 14:55:32 +00:00
Robin Dunn
440ddb750f Have wxDCImpl::GetHandle return NULL by default instead of being pure virtual.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-08-02 20:25:06 +00:00
Robin Dunn
9eefb5c14a Adding wxDC::GetHandle for wxOSX-cocoa and wxOSX-carbon
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-28 19:31:03 +00:00
Robin Dunn
932d0768aa * Implement dynamic loading of the Cairo DLL on Windows similar to how it was
done for GDI+.

* Enable the use of the wxCairoContext on MSW.

* Enable creating a wxGCDC from an exisiting wxGraphicsContext.

* Since it's possible for a DLL that is using wx to not be on the PATH nor in
  the same location as the .exe, change the wxDynamicLibrary::RawLoad method to
  explicitly look first in the same place as the main wx-using binary.  This way
  it will find DLLs that are in the same folder as the wx-using binary even if
  that would not be in the normal DLL search path.  

* Change wxDCImpl and wxDC::GetLogicalScale to be const methods.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 23:26:53 +00:00
Stefan Csomor
e516208e3d exposing wxGraphicsContext through an ordinary wxDC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 15:10:07 +00:00
Vadim Zeitlin
53d4bdbc15 Add wxDCImpl::MSWApplyGDIPlusTransform() to formalize wxRendererMSW hack.
Replace the dynamic_cast<> used in wxMSW wxRenderer implementation code with a
virtual function call.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-07 13:05:22 +00:00
Dimitri Schoolwerth
a1b806b982 Replaced Ok() occurrences with IsOk() throughout trunk.
Additionally renamed wxOSX' private wxNativePrinterDC::Ok() function to IsOk().

Didn't deprecate the various Ok() functions: given the amount of changes already introduced in 3.0 a trivial one like this seems more suitable for after 3.0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-03 16:29:04 +00:00
Vadim Zeitlin
e71508e160 Add wxDC::SetTransformMatrix() and related methods and implement them in wxMSW.
Add support for world transformations to wxDC too. Currently this is
implemented in wxMSW only but could be easily provided in the ports that use
wxGraphicsContext for wxDC implementation later.

Closes #13092.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-23 16:03:10 +00:00
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