Commit Graph

62117 Commits

Author SHA1 Message Date
Vadim Zeitlin
22406c7d86 Fix configure build with MinGW 5.3.0
Provide our own wcsnlen() declaration as the function is detected by configure
but is not declared in MinGW headers.

Closes #17762.
2017-01-14 00:07:44 +01:00
Vadim Zeitlin
7c22e4257b Fix build with MinGW 5.3 in debug mode
Due to a bug in MinGW (see https://sourceforge.net/p/mingw/bugs/2322/),
_stricmp() and _strnicmp() declarations are not visible when compiling without
optimizations. Work around this by declaring them ourselves.

See #17762.
2017-01-13 23:52:13 +01:00
Vadim Zeitlin
7477e94b2d Fix build problems due to "missing" newer MSW APIs with MinGW 5.3.0
Set WINVER/_WIN32_WINNT ourselves before letting MinGW to set them to very low
values corresponding to Windows 2000 on its own and preventing our code from
seeing any later additions to the Windows API, such as AttachConsole()
function used in src/msw/app.cpp.

Closes #17677.
2017-01-13 23:40:37 +01:00
Vadim Zeitlin
572db9c0a1 Extract setting WINVER/_WIN32_WINNT to a separate file
This will allow reusing it from other places.
2017-01-13 23:39:52 +01:00
Václav Slavík
1f56389e8b Fix generic wxDVC::EnsureVisible() to show full row
Generic wxDataViewCtrl's EnsureVisible() previously only ensured that at
least some part of the item (even if just 1px of it) was visible,
instead of being fully shown.
2017-01-12 17:46:29 +01:00
Václav Slavík
195df9af7f Fix incorrect alpha rendering in wxToolBar (MSW)
wxToolBar::Realize() code for handling bitmaps with alpha channel was
incorrectly blending them with the toolbar’s background color, resulting
in much lighter appearance and broken antialiasing.

Fix it by clearing the composite bitmap to be initially transparent if
bitmaps with alpha channel are used. Doing so uncovered another bug in
how the composite RGBA bitmap was passed to native toolbar control, so
fix that as well.
2017-01-12 17:39:08 +01:00
Artur Wieczorek
0649b0d028 Use wxGraphicsContext::CreateFromUnknownDC in the printing sample
Creating graphics context for the various flavors of wxDC can be simplified by using this newly introduced API.
2017-01-11 20:32:43 +01:00
Artur Wieczorek
e5b5049cc3 Make wxGraphicsContext::CreateFromUnknownDC() operational also when C++ RTTI is not used
Use wxDynamicCast() to cast to the various wxDC types if wxNO_RTTI is defined.
2017-01-11 20:31:11 +01:00
Václav Slavík
587067bc68 Fix pasting multiline text in wxOSX to not use \r
Use wxMacConvertNewlines13To10(), not wxMacConvertNewlines10To13() when
copying content from native pasteboard. Perform this conversion not only
for 8bit text, but for UTF-16 one (which is the one actually used on
modern OS X versions) as well.
2017-01-11 16:48:19 +01:00
Václav Slavík
eecf084d4d Implement wxClipboardTextEvent support in wxOSX
Emit wxEVT_TEXT_{COPY,CUT,PASTE} from NSTextView methods, calling native
implementation if not handled. NSTextField-based wxTextCtrl is not
supported, because it doesn't have the copy:/cut:/paste: methods.
2017-01-11 16:46:32 +01:00
Václav Slavík
1a1a2ffdf8 Don't reset firstResponder when a window is deactivated
Don't call makeFirstResponder:nil from windowDidResignKey: because it's
not a native behavior and subtly breaks some things (e.g. paste managers
or keyboard switched under some settings).

This was done to provide the illusion of Windows-like focus behavior
when a TLW is deactivated. macOS separates the concept of active ("key")
window and focus ("first responder") within it and it's possible and
normal to have the latter assigned even in inactive (non-key) windows.
wxOSX reset the responder to trigger wxEVT_KILL_FOCUS.

Instead, keep the first responder untouched and only run wx-side code to
handle focus lost as well as focus set in windowDidBecomeKey: This would
preserve behavior compatibility with other ports, while also playing
nice with macOS.
2017-01-11 12:42:42 +01:00
Václav Slavík
5d87c70eba Mimic native focus handling in wxStatusBar on macOS
Improve the logic for determining whether the statusbar should be
renderer as for active/key window or a background one.
wxTopLevelWindow::IsActive() is not a sufficient test because it returns
false in some situations when the statusbar need to appear as active
(another floating window) and also didn't account for window-modal
sheets (which don't change statusbar appearance either).
2017-01-11 12:42:42 +01:00
René Kijewski
e6274c7dfc Fix PCH-less build
Add missing includes for compiling without WX_PRECOMP.
2017-01-10 22:56:49 +01:00
René Kijewski
9c796670eb Fix wxWindowAccessible compilation with wxUSE_HELP==0
wxWindow::GetHelpTextAtPoint() can't be used in this case, add missing checks
for wxUSE_HELP around it.
2017-01-10 22:48:35 +01:00
Artur Wieczorek
e811c0640a Optimize creating wxCairoContext from wxMemoryDC associated with ARGB wxBitmap (MSW)
Legacy API cairo_win32_surface_create() can create only 24 bpp RGB surfaces but new API cairo_win32_surface_create_with_format() introduced in 1.15.4 supports creating also 32 bpp ARGB surfaces.
So, this new API can be used to create ARGB surface directly from ARGB bitmap (HDC), superseding current implementation based on the access to the bitmap data with cairo_image_surface_create_for_data().
Unfortunately, 0RGB bitmaps are not supported by cairo_win32_surface_create_with_format() and for such bitmaps surface has to be still created from bitmap data.
2017-01-10 21:34:51 +01:00
Artur Wieczorek
6cef4eaa11 Refactor code in wxQuantize() for MSVC to avoid crash
VC++ compilers (at least up to VS 2015) seem to generate incorrect code for the dithering code taken from libjpeg (pass2_fs_dither() function), where it is known to create problems too.
Refactor the code to avoid invalid optimization in this function and turn optimization on.

Closes #17764.
2017-01-10 21:31:59 +01:00
René Kijewski
92f80a18c6 Test for wxUSE_BASE64 in wxRegConfig
When you compile wxWidgets with base64 support disabled, then
wxConfigBase does not declare DoReadBinary and DoWriteBinary.
Add a guard to wxRegConfig, so wxOVERRIDE won't cause an error.
2017-01-10 18:29:33 +01:00
Vadim Zeitlin
d69cfb083e Work around an apparent autoconf bug in WX_CONFIG_CHECK
Don't use "$4" inside m4 comment, as autoconf 2.69 somehow completely mangles
the generated configure when the 4th argument is indeed specified: we end up
with a part of this comment in the generated file.
2017-01-08 15:42:41 +01:00
Vadim Zeitlin
60d33cb165 Merge branch 'travis-script'
Improve Travis CI build script: make build commands easier to read and modify
in .travis.yml and make their output in Travis logs more readable too.

Closes https://github.com/wxWidgets/wxWidgets/pull/388
2017-01-07 23:22:13 +01:00
Vadim Zeitlin
fad9c688e6 Merge branch 'libpng-1.6.28' of https://github.com/catalinr/wxWidgets
This brings in several bug fixes and optimizations (notably the use of SSE),
see src/png/CHANGES for full details.

Closes https://github.com/wxWidgets/wxWidgets/pull/384
2017-01-07 23:20:57 +01:00
Vadim Zeitlin
f08305ae33 Clean before building using installed library in Travis CI
The minimal sample had been already built as part of "make samples", so clean
it before rebuilding it using the installed library version, otherwise we
never do anything in this step.
2017-01-07 23:17:53 +01:00
Vadim Zeitlin
c80440af86 Dont 'include -stdlib=libc++ in CXXFLAGS in Travis build script
There is no need to specify it explicitly any more and it seems to confuse
make because of an apparent problem with (insufficient?) quoting in Mac
builds.
2017-01-07 23:17:53 +01:00
Vadim Zeitlin
dcef4d4a9e Use multiple commands in Travis CI build script
Using a single long command was always inconvenient and started displaying the
build results strangely since starting to build the samples conditionally in
62d2f4e5f5, so try using multiple commands with
"set -e" to ensure that we abort the build as soon as possible.
2017-01-07 23:17:23 +01:00
Catalin
7f54eba05c Define PNG_ZLIB_VERNUM as 0. 2017-01-07 01:12:11 +02:00
René Kijewski
5b88196311 Add missing include utils.h to rgncmn.cpp
When compiling wxWidgets without precompiled headers, src/common/rgncmn.cpp
needs to include wx/utils.h, as it uses wxMin.

Closes https://github.com/wxWidgets/wxWidgets/pull/386
2017-01-06 19:38:03 +01:00
René Kijewski
82de2bba0f Rename variable CHAR_WIDTH in src/msw/msgdlg.cpp
When compiling wxWidgets with MinGW64, CHAR_WIDTH can be already defined as a
macro, avoid clashing with it by renaming our variable with the same name.

Closes https://github.com/wxWidgets/wxWidgets/pull/383
2017-01-06 19:08:44 +01:00
Catalin
72971d3329 Add libpng upgrade example for MSW. 2017-01-06 18:16:00 +02:00
Catalin
e076fec061 Upgrade bundled libpng to 1.6.28. 2017-01-06 18:13:13 +02:00
Václav Slavík
e71be91ebe Add API to create wxGraphicsContext from win32 HDC
Add wxGraphicsContext::CreateFromNativeHDC() and wxGraphicsRenderer::
CreateContextFromNativeHDC() to allow creation not only from native
renderer object, but also from HDC, which is something universally
supported by win32 implementations.
2017-01-06 14:35:09 +01:00
Václav Slavík
e99abe513a Fix wxFULL_REPAINT_ON_RESIZE handling in wxMSW
Fix regression introduced in d4e595adb0
where the wxFULL_REPAINT_ON_RESIZE flag was accidentally ignored in most cases.
2017-01-06 14:33:24 +01:00
Václav Slavík
2b342e8777 Don't leak associations in wxCocoaDataViewControl
Fix ClearColumns() to release associations between m_OutlineView and
native Cocoa control when re-creating the latter. Previously it only
created a new association, but left the old one with no-deleted native
control in the map.

Fixes #17485.
2017-01-05 16:35:04 +01:00
Jouk
062e3c3d32 Adding missing ; 2017-01-05 16:32:42 +01:00
Vadim Zeitlin
038aaa74d1 Fix syntax error in Travis config from the last commit
Add the missing quote.
2017-01-04 22:47:32 +01:00
Vadim Zeitlin
62d2f4e5f5 Don't build sample in macOS Travis CI builds
This takes too much time and the entire build regularly times out, resulting
in spurious errors.
2017-01-04 22:04:05 +01:00
Catalin
2e5968bffc Upgrade bundled zlib to 1.2.10
The changes in 1.2.9 (1.2.10 is just a bug fix release) affecting the use of
zlib in wxWidgets are:

- Improve compress() and uncompress() to support large lengths
- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
- Fix bugs in creating a very large gzip header
- Dramatically speed up deflation for level 0 (storing)

Closes https://github.com/wxWidgets/wxWidgets/pull/380
2017-01-04 21:51:52 +01:00
Vadim Zeitlin
59bd1178f1 Fix build with RTTI turned off using MSVC makefiles
Rebake these makefiles using fixed version of bakefile (pre-0.3.0).

See https://github.com/vslavik/bakefile/pull/85

Closes #17767.
2017-01-04 12:01:14 +01:00
Vadim Zeitlin
395d453c94 Link with oleacc.lib when using MSW gcc makefiles
This library is now required when wxUSE_ACCESSIBILITY==1, but was only linked,
using a compiler-specific pragma, when using MSVC resulting in link errors
with gcc.

Fix this by adding the library to the bakefile for non-MSVC compilers and
rebaking.
2017-01-04 11:50:18 +01:00
Tobias Taschner
e0a2e09031 Update year in copyright notices to 2017
Use 2017 instead of 2016, mostly in version info files.

Closes https://github.com/wxWidgets/wxWidgets/pull/379
2017-01-04 11:25:00 +01:00
Paul Cornett
0a5f6e07f5 build fix for wxUSE_WINRT==0 2017-01-02 20:23:33 -08:00
Vadim Zeitlin
e777bd9ebd Slightly improve comment wording in MSW wxBitmap creation code
No real changes.
2017-01-03 02:54:36 +01:00
Vadim Zeitlin
092e772848 Use wxAlphaPixelData for default native bitmaps in the unit test
The unit test added in 607b800444 didn't work on
the systems using 32 bpp screens, i.e. almost all of them, because it tried to
use 24 bpp wxNativePixelData with them.

Fix this by using wxAlphaPixelData, which won't work on non 32 bpp systems,
and so is still not ideal, but at least makes the test work on most systems by
default.

See #17666.
2017-01-03 02:51:55 +01:00
Vadim Zeitlin
e3c245c226 Select the bitmap out of wxDC before using it in the unit test
The unit test added in 607b800444 had a bug as
it tried to use the bitmap directly while it was still selected into a
wxMemoryDC, which wasn't guaranteed to work and resulted in an assert.

Fix this by destroying wxMemoryDC earlier.

See #17666.
2017-01-03 02:50:26 +01:00
Vadim Zeitlin
4b4c572d5f Make wxTextCtrl Lines() unit test more robust
Verify that the last logical line was wrapped at least once, not exactly once,
as it could be wrapped more times depending on the font size.
2017-01-03 02:39:57 +01:00
Paul Cornett
c15d804197 Different fix for GetBordersForSizer()
Try to determine the borders the same way GTK+ does it.
This seems to avoid incorrect results before widget is realized.
See #17239, #15872
2017-01-02 08:31:35 -08:00
Paul Cornett
5e906d80d8 Fix build with wxNO_RTTI
Since CreateFromUnknownDC() can return NULL anyway, just always define it,
and have it always return NULL with wxNO_RTTI
See #17765
2017-01-01 11:01:49 -08:00
Eric Jensen
caaa08be07 Disable optimizations in wxQuantize() for MSVC to avoid crash
Compiler seems to generate incorrect code for the dithering code taken from
libjpeg, where it is known to create problems too, so use the same workaround
as libjpeg uses and disable optimizations for this function.

This is unsatisfactory and it would be great to find a way to tweak the code
to avoid the problem, but it's still better than crashing.

See #17764.
2016-12-31 16:56:18 +01:00
Carl Godkin
0698da3d6b Resize name column in wxFileListCtrl to be as wide as possible
To avoid truncating the names of the files shown in this column, allocate all
the available space to it.

Closes #17757.
2016-12-27 17:23:00 +01:00
Jeff Davidson
6293d7427c Really fix event dispatching in Mac modal event loops
Manually dispatching events to eligible windows is error-prone and
should really be the responsibility of the system. But the old
approach of blocking in nextEventMatchingMask:untilDate:inMode:dequeue
seems to fail because while this blocks, events can't even enter the
queue.

Thus, revert to the old logic, but instead of blocking in
nextEventMatchingMask, first block on processing the input source via
[NSRunLoop runMode:beforeDate].

This resolves the original problem which was also fixed by the commit
4a83fd4696 but doesn't seem to introduce any
regressions, and seems to be a much cleaner fix overall.

See #17737.

Closes https://github.com/wxWidgets/wxWidgets/pull/365
2016-12-27 16:51:24 +01:00
Steve Browne
59d26b0bad Keep disabled status when wxBitmapComboBox is recreated in wxMSW
If a disabled wxBitmapComboBox had to be recreated, it lost its disabled
status and became unexpectedly enabled.

Fix this by explicitly disabling it back in RecreateControl() if necessary.

Closes https://github.com/wxWidgets/wxWidgets/pull/376
2016-12-27 16:40:31 +01:00
Paul Cornett
2a371515df Fix build error with wxUSE_NOTIFICATION_MESSAGE==0 2016-12-22 22:13:34 -08:00