Commit Graph

61936 Commits

Author SHA1 Message Date
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
Artur Wieczorek
ef46f24f37 Add test of scaling wxImage
Upsampling the image with symmetrical contents to check if symmetry is preserved in rescaling.
2016-07-22 23:00:48 +02:00
Artur Wieczorek
097625de52 Fixed rescaling of wxImage
When wxImage is rescaled with wxIMAGE_QUALITY_BILINEAR, wxIMAGE_QUALITY_BICUBIC or wxIMAGE_QUALITY_BOX_AVERAGE algorithm then for proper interpolation there is necessary to uniformly (linearly) map entire pixel range in the new image to the entire pixel range in the current image, i.e. pixels positions (integer values) in range [0..newDim-1] has to be mapped to "virtual" pixel positions (not necessary integer values) exactly in the range [0..oldDim-1].
[0..oldDim-1] range of target mapping is required because for proper interpolation every "virtual" pixel has to be located between two physical pixels in the current image.
Thus scaling ratio used to find corresponding pixels in the current image should be (oldDim-1)/(newDim-1) and not oldDim/newDim (which is used now).
When image is e.g. upsampled oldDim/newDim ratio then some new rightmost/botommost pixels are mapped to old pixels > (oldDim-1) and their values are improperly interpolated (in the current implementation their positions are just truncated to (oldDim-1) to bypass the problem and upsampled image looks like it was shifted left/up). The larger scaling ratio the effect is more visible.

Note:
Because reference images used currently in the unit tests were created with improper scaling there is necessary to upload new reference images created with fixed scaling.

Closes #17594
2016-07-22 23:00:33 +02:00
Artur Wieczorek
c3fa684a27 Fixed displaying validation error for numeric wxPG properties (wxUIntProperty, etc.)
When entered wxFloatProperty, wxIntProperty or wxUIntProperty is out of range then there is displayed a warning message presenting a valid range. Instead of displaying in this message numeric values in default (and fixed) format we should display values which are formatted based on to the current attributes of the property (like wxPG_UINT_PREFIX, wxPG_UINT_BASE, wxPG_FLOAT_PRECISION).
To do so, we shouldn't format respective values on our own in NumericValidation() but instead call wxPGProperty()::ValueToString() which returns value string formatted in line with attributes.

Closes #17601
2016-07-21 23:13:16 +02:00
Artur Wieczorek
6e97a2cbf2 Fixed displaying wxUIntProperty value
In the edit mode property's value should be displayed in the pure numeric form without any textual prefixes because all non-numeric characters will raise a warning in wxNumericPropertyValidator.
2016-07-21 23:11:33 +02:00
Vadim Zeitlin
e371214cfa Correct wxString(const char*, size_t) ctor documentation
The length passed to this constructor is the number of bytes, i.e. char
elements of the given string, not "characters" in the usual sense of the word.
2016-07-19 20:12:53 +02:00
JulianSmart
22bcdf020e Don't use Cmd+C accelerator in dilogs on Mac by default. 2016-07-17 18:17:42 +01:00
Artur Wieczorek
42b440487d Updated wxGraphicsContext documentation.
Added comment blocks to improve readability.
Enhanced some descriptions (for BeginLayer, PushState).
2016-07-17 18:19:32 +02:00
Artur Wieczorek
874da289ef Modified parameters in clipping box tests.
Some coordinates of clipping regions given in device coordinates has to be slightly modified to avoid rounding errors in conversions from device to logical coordinates.
2016-07-17 18:19:32 +02:00
Artur Wieczorek
902b9a5c56 Fix calculating the extent of clipping box (wxDC, GTK).
While setting a clipping region there is necessary to intersect it either with current clipping region location if such region exists or with wxDC surface extents if no clipping region is set. This way effective clipping box will be always inside the wxDC surface. Effective clipping box can be an empty region.
Clipping box parameters are calculated and stored in logical coordinates.
2016-07-17 17:05:02 +02:00
Artur Wieczorek
c845b953a2 Don't destroy clipping region if empty clipping region is required (wxDC, GTK).
For compatibility with wxGCDC (Cairo and all native MSW renderers) current clipping region shouldn't be explicitly destroyed if empty clipping region is requested. It should be handled as any other region.
2016-07-17 16:43:13 +02:00
Artur Wieczorek
ad9ebd4b54 Fixed setting clipping box with negative size (wxDC, GTK).
Rectangular clipping region with negative size is accepted by wxDC::SetClippingRegion() (for compatibility with wxGCDC and Cairo) but for internal calculations we need to have this box defined by (x,y) at top-left corner and having non-negative size so we need to recalculate box's parameters in wxWindowDCImpl::DoSetClippingRegion() if necessary.
2016-07-17 16:43:13 +02:00
Artur Wieczorek
79ffd029fa Allow creating wxRegion from rectangle with negative size (GTK).
GdkRectangle used to represent a rectangle region should have (x,y) parameters pointing to the top-left corner of the box with non-negative width and height so if a rectangle with negative values of the width or height is passed to wxRegion::InitRect() (what means that (x,y) doesn't represent top-left corner) we need to recalculate passed parameters to get rectangle with (x,y) at the top-left corner.
2016-07-17 16:43:12 +02:00
David Costanzo
ab092c8d13 Don't handle special keys as characters in wxSTC in non-Unicode build
Correct the check for non-special keys when wxUSE_UNICODE==0.

Closes #17598.
2016-07-17 14:15:40 +02:00
Vadim Zeitlin
63944ae9bd Recognize wxAUI_NB_MIDDLE_CLICK_CLOSE in wxAuiNotebook XRC handler
This style was apparently just forgotten, so add it too.

Closes #17597.
2016-07-17 14:03:52 +02:00
Vadim Zeitlin
fe2052fb35 Skip the recently added wxString test broken with libc++
This should have been part of 90eaa1bbe3 and
should finally really fix the build with libc++ after the changes of
14ec2691f6.
2016-07-16 01:46:45 +02:00