Commit Graph

61801 Commits

Author SHA1 Message Date
Lauri Nurmi
84969ba00d Prevent assignment to wxString::const_iterator from compiling
Make const_reference const and dereference const_iterator into a
const_reference to ensure that the code trying to assign to a (dereferenced)
const_iterator doesn't compile.

Closes https://github.com/wxWidgets/wxWidgets/pull/316
2016-08-27 17:51:37 +02:00
arata, mizuki
23527a5f81 Fix wxCHECK_VISUALC_VERSION macro to correctly detect VC14 2016-08-27 17:45:12 +02:00
Lauri Nurmi
394ce5f631 Add C++11-style cbegin, cend, etc. to wxString's iterator interface
These c-prefixed functions always return a const_iterator.
The full list of functions added: cbegin(), cend(), crbegin(), crend().

Closes https://github.com/wxWidgets/wxWidgets/pull/314
2016-08-25 18:54:05 +02:00
Artur Wieczorek
e68bd5a319 Fix compilation breakage due to missing FLT_MAX, FLT_MIN
Include <float.h> header file unconditionally.
2016-08-22 21:04:38 +02:00
samurajj
a93dcc531c Fix error reporting for wxCopyFile() under Unix
Check if copying file actually succeeded, any IO errors that could happen in
it were previously just completely ignored.

Closes #17638.
2016-08-22 14:17:43 +02:00
Artur Wieczorek
1222a9d769 Fix for PCH-less build for wxGDIPlusContext
Including <float.h> header is required for FLT_MAX, FLT_MIN.
2016-08-22 00:03:28 +02:00
Artur Wieczorek
92557dad1c Define REAL_MIN, REAL_MAX if GDI+ headers don't do it
This should fix compilation with MinGW.
2016-08-21 23:44:59 +02:00
Artur Wieczorek
d66ff48fb4 Add new tests to check clipping region with rotated wxDC/wxGCDC
See #17636.
2016-08-21 21:23:01 +02:00
Artur Wieczorek
acc57fccc7 Fix wxDC::Clear
When complex transformation (including e.g. rotation) is applied to DC then coordinates of the clip box return by GetClipBox() API can be inaccurate due to the rounding errors.
To compensate these errors we need to fill rectangle which is slightly larger then just retrieved clip box.

Closes #17636.
2016-08-21 21:22:05 +02:00
Artur Wieczorek
12eaa61930 Fix wxGCDC::Clear
If underlying graphics context is rotated then drawing a rectangle with origin at (0,0) doesn't cover all the drawing area. To draw over entire area we need to get extents of the actual clipping region (with applied all transformations) and use it as coordinates of the drawn rectangle.

See #17636.
2016-08-21 21:03:17 +02:00
Artur Wieczorek
78f00da98a Fix wxGraphicsMatrix::TransformDistance for Direct2D implementation
Current transformation matrix without translation component should be used in calculations.
2016-08-21 21:01:52 +02:00
Artur Wieczorek
6ca5c894cd Add tests of setting clipping regions with wxGraphicsContext
The scope of tests corresponds to the scope of existing wxDC/wxGCDC tests. Additionally, newly introduced wxGraphicsContext::GetClipBox() function is tested too.
2016-08-21 21:00:13 +02:00
Artur Wieczorek
a29e6922cf Implement wxGraphicsContext::GetClipBox for Core Graphics 2016-08-21 20:58:56 +02:00
Artur Wieczorek
480a003c00 Add wxGraphicsContext::GetClipBox() function
This method returns bounding box of the current clipping region.
Added declaration, documentation and implemented for GDI+, Direct2D, Cairo renderers.
2016-08-21 20:57:40 +02:00
Gideon van Melle
1927a2f8a0 Update Dutch translations
Closes https://github.com/wxWidgets/wxWidgets/pull/313
2016-08-21 18:08:11 +02:00
Vadim Zeitlin
f9740e8180 Fix wxBitmap ctor from XBM in wxGTK
Width and height were exchanged in the loops, so the conversion code didn't
work correctly and overflowed the pixel buffer (due to extra padding in the
row stride) for non-square bitmaps. It also resulted in a completely wrong
bitmap appearance, but somehow this managed to go unnoticed, unlike the memory
errors.

Closes #17633.
2016-08-21 14:46:16 +02:00
Kolya Kosenko
3fe7be374d Fix wxSecretStore compilation in wxMSW UTF-8 build
We need to explicitly cast wxScopedWCharBuffer to TCHAR* before casting away
constness from it in this case, unfortunately.

Closes #17634.
2016-08-21 14:43:00 +02:00
Vadim Zeitlin
ec8d0c6e78 Fix recent compilation breakage by not using INT32_MAX
Apparently stdint.h doesn't define it on all platforms, even in 2016, so just
hardcode 2147483647 instead.

See #17629.
2016-08-20 00:12:06 +02:00
David Hart
34d39c9dfb Fix use of dangling reference in wxFileSystemWatcher Unix code
Don't reference the "watch" object after possibly destroying it when handling
IN_DELETE_SELF inotify notification.

Closes #17122.
2016-08-19 23:19:14 +02:00
David Hart
6537356236 Make failure to remove an inotify watch a warning
Apparently this can happen when a directory is deleted just before the watch
is removed and it is impossible to avoid it, so just send a warning message so
that the program could react to this, if necessary, but don't annoy the user
with an error in this case.

See #17122.
2016-08-19 23:15:53 +02:00
Jeff Hostetler
534899baa2 Work around unwanted MacOpenFiles() calls in wxOSX applications
Don't try to open any command line arguments as files by using the workaround
from Colin Barrett (see https://bugzilla.mozilla.org/show_bug.cgi?id=366009).
2016-08-19 23:03:47 +02:00
brawer
7f10d1fa8a Add wxSYS_CARET_{ON,OFF,TIMEOUT}_MSEC system settings
Provide a way to retrieve the caret blink times from wxSystemSe and implement
it for wxOSX and wxGTK.

Closes #17629.
2016-08-19 22:55:20 +02:00
Andy Robinson
75e254fce7 Fix format specifiers used for size_t values in wxFileConfig
Fix assert failures when reporting errors in config files under 64 bit systems
where "%d" can't be used to output a "size_t" value.

Closes #17630.
2016-08-19 22:44:23 +02:00
Artur Wieczorek
c9a8dbedc8 Add a test of storing/restoring clipping regions with wxGraphicsContext.
See #17626.
2016-08-12 23:22:34 +02:00
Artur Wieczorek
d9193d5368 Fix saving/restoring drawing state for wxGraphicsContext with Direct2D
Native ID2D1RenderTarget::SaveDrawingState method stores in ID2D1DrawingStateBlock only transform, antialiasing mode, text-rendering options and tags but not currently set ID2D1Layers (which are used in wxD2DContext for clipping purposes). Therefore current stack of layers has to be stored "manually" alongside ID2D1DrawingStateBlock in a dedicated data structure (LayerData) in PushState() and restored also "manually" in PopState().

Closes #17626.
2016-08-12 23:16:09 +02:00
Vadim Zeitlin
7d9d5934b5 Document all the strings supported as menu accelerators
This wasn't documented anywhere until now, so copy the contents of the table
in src/common/accelcmn.cpp to the documentation to have them all in one place.
2016-08-10 22:58:14 +02:00
Scott Talbert
dbe2a1c2fd Fix wxNativeFontInfo::InitFromFont() when using Pango
Use pango_font_description_copy() to make a lossless copy of the original font
instead of doing it using wxWidgets API which is less direct and, in addition,
currently is completely broken as SetXXX() methods don't create the Pango font
description if it doesn't exist as they ought to.

Closes https://github.com/wxWidgets/wxWidgets/pull/312
2016-08-10 15:03:49 +02:00
Artur Wieczorek
b078e348b7 Fix minor typo in wxPGProperty documentation 2016-08-09 20:56:27 +02:00
Artur Wieczorek
c96aec4d44 Don't initialize variable twice 2016-08-09 20:54:47 +02:00
Artur Wieczorek
a1682a4568 Revert to the legacy implementation of setting clipping region given in device coordinates for WXOSX
Solution with full conversion from device to logical coordinates in wxGCDCImpl::DoSetDeviceClippingRegion doesn't seem to work under WXOSX (wxMacCoreGraphics) so we have to use for this port legacy implementation without full conversion of coordinates. Only offset of the origin is taken into account in this case (but not e.g. scale) but this should be enough for simple cases.

Closes #17609
2016-08-09 20:53:13 +02:00
Artur Wieczorek
e3be67a756 Add test of setting clipping region for transformed (rotated) wxGraphicsContext
See #17622
2016-08-09 20:49:58 +02:00
Artur Wieczorek
0f31e05cb8 Adopt clipping box tests for GTK+ 3 environment
1. Under GTK+ 3 wxDC is implemented as wxGCDC (with underlying Cairo renderer) and hence there is no need to test wxDC individually.
2. wxRegion is implemented under GTK+ 2 using GdkRegion but under GTK+ 3 it is implemented using cairo_region_t so some region attributes can be slightly different in some circumstances for both ports. This happens e.g. for non-rectangular regions which can have slightly different clip extents for GTK+ 2 and 3. We have to take this into account in the tests of non-rectangular clipping region and accept that actual clipping box position can differ of few pixels from expected position (so comparing clipping box positions shouldn't be exact but with some error tolerance).
2016-08-09 20:48:43 +02:00
Artur Wieczorek
c468dd67cb Fix setting rectangular clipping region for Direct2D
If transformation matrix of wxGraphicsContext with Direct2D renderer is e.g. rotated then rectangular clipping region represented by layer created with ID2D1RenderTarget::PushAxisAlignedClip is invalid because this kind of layers create axis-aligned clipping regions which edges are always horizontal or vertical (not e.g. rotated).
To take into account current transformation matrix when clipping region is set there is necessary to represent all clipping regions (even rectangular) by generic layers (ID2D1Layer) created with ID2D1RenderTarget::CreateLayer.

Closes #17622
2016-08-09 20:47:57 +02:00
Vadim Zeitlin
85c9e06a29 Remove wxGridTableMessage and wxGridStringTable documentation
This skeleton of documentation was replaced by (minimal but still more
valuable) real documentation in fcd5284aed but
the old classes were accidentally left in.
2016-08-09 01:12:32 +02:00
Vadim Zeitlin
1c4e20d870 Fix documentation of {From,To}DIP() overloads taking int
They were mistakenly using wxSize (already documented just above).
2016-08-09 01:10:24 +02:00
Vadim Zeitlin
985ff1e26e Check for self-assignment in wxArrayString
Assigning array to itself destroyed its contents -- check for this now.

Closes #17619.
2016-08-09 01:07:59 +02:00
Scott Talbert
3572c2c654 Fix the stop function of wxFontEnumerator for wxGTK
In a wxFontEnumerator, if false is returned from OnFacename() or
OnFontEncoding(), the enumeration is supposed to stop.  This was not happening
on wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/311
2016-08-08 14:06:42 +02:00
David Vanderson
e2a846e182 Fix correct screen DPI and not hard-coded 72 in wxOSX
Don't hard-code screen DPI as 72, use the real number instead (which is now
returned correctly, after the last commit).

Closes #17615.
2016-08-08 14:03:12 +02:00
David Vanderson
49801e57f1 Implement wxGetDisplaySizeMM() correctly in wxOSX
Return the real screen size instead of hard-coding 72 DPI.

Closes #17614.
2016-08-08 14:00:07 +02:00
rom
e300f28976 Fix handler for wxEVT_MENU from dropdowns in wxAuiToolBar
Send this event to the toolbar own event handler instead of sending it to the
parent, the event will be propagated upwards anyhow, but doing it like this
also allows to process it in the toolbar itself and is consistent with the
other events generated in this code.

Closes #17613.
2016-08-04 23:47:21 +02:00
Václav Slavík
a352e95a30 wxMSW: Restore window focus after wxExecute
If wxExecute() is called without the wxEXEC_NODISABLE flag, it disables
all toplevel windows and then creates a helper dummy window. This moves
focus to the helper window and when it's destroyed, back to the first(?)
of the re-enabled application windows, thus loosing original focus.

Remember previously focused window instead and try to restore focus to
it. This still results in some flicker, but is better than completely
changing focus and e.g. even changing the currently active window
without user's input.
2016-08-01 18:10:37 +02:00
Artur Wieczorek
ea8cb7a24a Fix setting wxGCDC clipping region with device coordinates
Currently region given in device coordinates is decomposed into the stripes which are next transformed to the logical coordinates required by underlying wxGraphicsContext::Clip() function. Some of these stripes given in device coordinates can have 1-pixel height what after transformation to logical coordinates can give zero-height stripes (after rounding). This can lead to the situation that in the region transformed to logical coordinates some stripes can disappear and final transformed region shape is different from the source shape (it has gaps).
To fix this issue device coordinates of the region are not manually transformed to the logical coordinates but instead wxGraphicsContext's is temporarily set to the state where its logical coordinates are equivalent to device coordinates and thus clipping region can be applied directly.

Closes #17609
2016-08-01 00:05:31 +02:00
Artur Wieczorek
0fc246176a Add to the test suite a test of setting non-rectangular clipping region
Added a test of creating triangular clipping region (with wxDC::SetDeviceClippingRegion).

See #17609
2016-07-31 23:57:03 +02:00
Dévai Tamás
29c81ad515 Allow wxwin.m4 finding and using a base-only library
Although "base" is not actually a toolkit, allow both the automatic toolkit
detection and the configure flag --with-toolkit=base find and use a base-only
library.

Closes https://github.com/wxWidgets/wxWidgets/pull/310
2016-07-30 23:02:43 +02:00
Bryan Petty
e11bbb1afc Re-enable features in AppVeyor builds
Build boxes have been upgraded, and should be able to handle the
extra time required to build these features now.

Closes https://github.com/wxWidgets/wxWidgets/pull/309
2016-07-30 23:00:48 +02:00
Vadim Zeitlin
a8fbe51b45 Fix leak of GdkPixbufLoader in wxGTK wxAnimation
Use wxGtkObject<> to ensure that the loader object is unref'd.

Also add a missing call to gdk_pixbuf_loader_close() for consistency.

Closes #17607.
2016-07-28 00:38:46 +02:00
Vadim Zeitlin
9dc7a89ccd Check if widget is still valid in wxGTK size reset callback
The transient top-level window might have been already deleted by the time the
idle callback is executed, so check that the widget still exists before using
it.

This fixes multiple GTK+ errors on startup of an application showing any kind
of temporary windows (e.g. a splash screen) since the changes of the commit
bc4df78421.
2016-07-28 00:04:30 +02:00
Artur Wieczorek
cf033b47b1 Editorial corrections to the documentation.
Added section to group similar functions in the documentation of wxGraphicsContext.
Fixed references to the section describing wxPGProperty attributes.
2016-07-24 21:08:54 +02:00
Artur Wieczorek
cd96c664dd Updated documentation for some wxPropertyGrid classes.
Updated documentation for wxPGEditor, wxPropertyGridPage, wxPropertyGridManager, wx*Property classes.
Removed doxygen-style comments from header files.
2016-07-23 23:38:39 +02:00
Artur Wieczorek
b3d4c870da Update changelog
Mention of recent wxPG-related fixes 6e97a2cb i c3fa684a.
2016-07-22 23:12:35 +02:00