Commit Graph

17140 Commits

Author SHA1 Message Date
Vadim Zeitlin
41045df7ea Remove extraneous semicolons after wxDECL_FOR_STRICT_MINGW32()
This generated -Wpedantic warning about the duplicate semicolons when
compiling applications using wxWidgets in pedantic mode with gcc.
2017-02-20 15:55:47 +01:00
Paul Cornett
4821bb4072 Use ctor initializer for non-trivial data members 2017-02-18 10:48:27 -08:00
Paul Cornett
c64a4c3224 make wxExecute() argv parameter fully const-qualified 2017-02-18 10:14:25 -08:00
stahta01
c9fad20b7b Fix checks for wxUSE_WEBVIEW in MSW config checks
This fixes -Wundef warnings about "wxUSE_WEB" being not defined when OLE
support is disabled.
2017-02-17 22:02:17 +01:00
New Pagodi
e68cafaf94 Remove references to never generated wxSTC events
EVT_STC_KEY and EVT_STC_URIDROPPED events are never generated so there is no need to reference them in the code and documentation. For backwards compatibility reasons their declarations are not entirely removed but marked as deprecated.

Closes #17688.
2017-02-16 18:18:13 +01:00
New Pagodi
68888ca0a2 Upgrade Scintilla component to 3.7.2
Closes #17705.

Closes https://github.com/wxWidgets/wxWidgets/pull/409
2017-02-12 19:56:21 +01:00
Vadim Zeitlin
e125c3b657 Allow disabling unsafe implicit conversions in wxString
While we have to keep these conversions enabled by default, they are very
dangerous as they can result in silent data loss on any system not using a
locale with UTF-8 encoding, i.e. always under MSW.

Allow mitigating this by defining wxNO_UNSAFE_WXSTRING_CONV when compiling the
application code using the library, which makes these conversions invisible to
the user code, and so can be used without recompiling the library.

Also add wxUSE_UNSAFE_WXSTRING_CONV which can be set to 0 when compiling the
library to disable these conversions globally for all applications using it.

Closes #11830.
2017-02-12 02:29:30 +01:00
Vadim Zeitlin
4cc45797a1 Fix wxUSE_DC_TRANSFORM_MATRIX comment in wx/setup_inc.h
Propagate the change done in 49000defcf to the
generated include/wx/msw/setup0.h file to wx/setup_inc.h, so that this change
won't be lost during future regenerations.
2017-02-12 02:27:22 +01:00
Cătălin Răceanu
05b980aba1 Fix wxMSW wxSpinCtrl appearance: show arrows inside the control
As recommended in the "Spin Controls" MSDN documentation (see
https://msdn.microsoft.com/en-us/library/windows/desktop/dn742439.aspx), put
the spin control inside the associated "buddy" edit control and not near it.

Closes #12297.

Closes https://github.com/wxWidgets/wxWidgets/pull/410
2017-02-11 23:39:31 +01:00
Artur Wieczorek
8e47b3ca97 Support multiline strings in wxPostScriptDC::DrawText() and DrawRotatedText()
'show' operator in PostScript doesn't support printing newlines, so we need to split the string into lines manually and print each line separately.

Closes #17798.
2017-02-11 23:05:37 +01:00
Václav Slavík
288a301b97 Don't corrupt pasted UTF-16 text in wxOSX
Fix breakage introduced by 587067bc68:
pasting text could mangle some Unicode characters if it was in UTF-16.
The code in that commit converted newlines all right, but it also
converted _any_ occurrence of 0x0d to 0x0a, which wasn't very Unicode
friendly.

Fixed by partially reverting the change and adding a dedicated UTF-16
variant of wxMacConvertNewlines13To10() instead.
2017-01-29 13:55:56 +01:00
Artur Wieczorek
cd676d1663 Clean up DrawText() and DrawRotatedText() (wxPostScriptDC)
Move shared code to the separate method DrawAnyText() instead of duplicating it.
2017-01-27 23:02:58 +01:00
Robin Dunn
84c1e48957 Merge pull request #344 from RobinD42/master-cherrypick-wxPy
Docs and other updates for wxPython
2017-01-23 20:05:45 -08:00
Vadim Zeitlin
26c3094932 Add declarations to fix the build with MinGW 5.3.0 in C++11 mode
Fix the build with -std=c++11 (instead of -std=gnu++11) by providing even
more declarations for the functions wrongly excluded from MinGW headers in
"strict ANSI" mode ourselves.
2017-01-20 21:24:40 +01:00
Tobias Taschner
3206df50c4 Add Microsoft Visual Studio 2017 solution file for building wxMSW
Allow building with VS15 out of the box.

Closes https://github.com/wxWidgets/wxWidgets/pull/353
2017-01-16 17:02:10 +01:00
Manuel Martin
b28dd88994 Improve new wxGLCanvas compatibility with old hardware and code
Combined patch with the following changes:
- Don't add wxGLAttributes::Defaults() when the attributes-list is NULL.
- Add display default attributes used in wx versions before 3.1 when the
  attributes-list is NULL. These attributes are different for each platform.
- Fix wxMSW PixelFormatDescriptor initialization.
- Don't set color buffers when RGBA() is used.
- Fix setting colour sizes in OS X and a few other fixes.
- Make documentation more clear about these subjects.

Closes #17425.
2017-01-16 03:25:49 +01:00
Vadim Zeitlin
5ae9694506 Don't use DLL export declarations on wxDoc{Child,Parent}FrameAny
These classes only have inline methods and so don't need to be exported in the
first place and, moreover, doing it results in link problems where these
templates are instantiated for a type not used inside the library itself.

Closes #17777.
2017-01-15 17:07:43 +01:00
Vadim Zeitlin
0b6319b506 Merge branch 'mingw32-5.3-fixes'
Work around several problems in the latest MinGW (not w64) 5.3 release.
2017-01-15 17:00:14 +01:00
Vadim Zeitlin
6c827301d1 Fix regex library compilation after MinGW _stricmp() fixes
Don't use extern "C" in C code.
2017-01-14 01:16:51 +01:00
Vadim Zeitlin
da36cbff06 Don't over promise in wxItemContainer documentation
It only accepts std::vector<wxString>, not std::vector<T> for any type
convertible to wxString as both the documentation and the code misleadingly
claimed.
2017-01-14 00:25:35 +01:00
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
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
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
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
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
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
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
Paul Cornett
42b2675806 Fix build error with wxUSE_DRAG_AND_DROP==0 2016-12-22 22:12:45 -08:00
Vadim Zeitlin
d4e595adb0 Add wxWindow::CreateUsingMSWClass() helper function
This method allows to use the Windows class to use for the window being
created instead of always using "wxWindow" or "wxWindowNR".

This can be useful to make it possible to handle some windows specially from
outside the application, e.g. use specific class names for accessibility
purposes as will be done by the next commit.
2016-12-18 22:39:06 +01:00
Vadim Zeitlin
842c441f01 Allow registering only a single window class in wxMSW
Add a flag to let wxApp::GetRegisteredClassName() register just a single Win32
class instead of always registering two of them: the "normal" (but rarely used)
version and the "NR" version used unless wxFULL_REPAINT_ON_RESIZE style is
specified.

With the new RegClass_OnlyNR, only the latter is registered and used.

This is not used yet, but will be soon.
2016-12-18 22:39:04 +01:00
Vadim Zeitlin
097f8a7f14 Refactor code finding the name of the windows class to use in wxMSW
Determine which class name to use in MSWCreate() caller instead of doing it
partly there and partly in MSWCreate() itself, which used to add the "NR"
suffix if necessary -- now it doesn't do this any more and just really created
the window using the given class.

No real changes, just prepare for future enhancements.
2016-12-18 22:39:02 +01:00
Vadim Zeitlin
34f8ae85e0 Simplify wxPersistentTLW code and avoid warnings in it
Use wxPoint and wxSize instead of individual "int" variables to make the code
slightly shorter and avoid clang warnings about "y" and "h" being possibly
uninitialized (which couldn't happen, but the compiler didn't understand it,
at least in non-optimized builds).
2016-12-14 02:21:40 +01:00
Václav Slavík
8b5387bc3d Enable wxUSE_ACCESSIBILITY by default (MSW)
Compile accessibility support on Windows by default now that the generic
wxDataViewCtrl control implements accessible interface. After the
changes from 7dab555f71, accessibility
support is much more lightweight and doesn't interfere with normal win32
behavior, so this change shouldn't affect accessibility-unaware code in
any way.
2016-12-13 18:56:20 +01:00
Vadim Zeitlin
04428890b7 Fix warning about undefined macro when cross-compiling with MinGW
__USE_MINGW_ANSI_STDIO is apparently not defined when using MinGW as a
cross-compiler from Linux, so 7c730334a2
resulted in -Wundef warning about this.

Fix this by checking if the macro is defined before testing its value.

See #17736.
2016-12-12 23:39:01 +01:00
Václav Slavík
ff1dba498e Add wxDataViewValueAdjuster
Add wxDataViewRenderer:: SetValueAdjuster() and a
wxDataViewValueAdjuster class. This can be used to customize rendering
of values depending on whether they are highlighted (selection) or not,
without having to implement an entire new custom renderer.
2016-12-11 15:20:42 +01:00
Václav Slavík
13862ad8e6 Fix GetInstallPrefix availability check
Add wxHAS_STDPATHS_INSTALL_PREFIX to make checking for
wxStandardPaths::GetInstallPrefix()'s availability simpler, as the
condition under which it is compiled is nontrivial.

Fixes compilation after 2c24ee9216 on
Cygwin, which is a UNIX, but its wxStandardPaths implementation is a
Windows one.
2016-12-11 15:18:24 +01:00
Paul Cornett
d5681ee4a8 Fix infinite sizing loop caused by 3b4ee5a0
Avoid the problems 3b4ee5a0 attempted to address in a much simpler way:
when a "size-allocate" is in progress, call gtk_widget_size_allocate()
directly, rather than deferring a call to gtk_widget_queue_resize().
See #17585
2016-12-09 21:38:35 -08:00
Vadim Zeitlin
9db6f6ca1a Make wx/valnum.h self-contained by including wx/textentry.h
This header uses (i.e. forward declaration wouldn't be sufficient)
wxTextEntry, so it must include the header declaring it.
2016-12-09 01:58:14 +01:00
Václav Slavík
60542745f6 Fix accel handling when removing item from submenu
wxMSW propagates accelerators to the top menu in wxMenu::UpdateAccel(),
but the reverse operation in wxMenu::DoRemove() didn't do it, resulting
in leaked leftover accelerator entries that could prevent the same
accelerator from working if an item using it was later added. Fix by
adding RemoveAccel() helper method that behaves analogously to
UpdateAccel().
2016-12-05 17:59:03 +01:00
Václav Slavík
c9b1ebf816 Remove ATSU-related dead code from wxOSX
ATSU was deprecated for a long time and was finally removed from OS X
SDK in 10.11. wxOSX_USE_ATSU_TEXT was unconditionally disabled already,
so the code was never used and can be safely removed.
2016-12-03 12:44:10 +01:00
Laurent Poujoulat
7c730334a2 Fix long long format specifier when using MinGW with ANSI STDIO
When using MinGW own, more standard-compliant, STDIO library, the correct
format specified to use for long long values is "%lld" and not "%I64d" as when
using MSVC CRT.

Closes #17736.
2016-12-02 20:47:43 +01:00
Tobias Schlager
73f6f622f9 Allow specifying the maximum width of static text in dialogs
This patch allows specification of the maximum width of static texts
created with wxDialog::CreateTextSizer.

The patch preserves backwards compatibility by setting the previous
width value as the default argument value.

Closes https://github.com/wxWidgets/wxWidgets/pull/355
2016-12-01 14:06:43 +01:00
Graham Dawes
d639e4ffce Fix wxQt build errors when using gcc 4.4
Closes #17733.
2016-11-30 16:13:46 +01:00
VZ
5551932c25 Allow using Bind() with non-public inheritance in C++11 code
Using Bind() with a method of the class deriving from wxEvtHandler
non-publicly used to result in a compile-time error, but at least with C++11
we can detect this case and allow the code to compile.

Closes #17623.
2016-11-29 19:32:40 +01:00
VZ
4212202a9a Add support for cache directory to wxStandardPaths::GetUserDir()
This has direct equivalent under macOS and when using XDG.

See #17727.
2016-11-29 19:32:14 +01:00