Commit Graph

62685 Commits

Author SHA1 Message Date
ARATA Mizuki
90c990cf83 Add some functions to handle supplementary characters
The added functions are:

- wxUniChar::IsBMP()
- wxUniChar::IsSupplementary()
- wxUniChar::HighSurrogate()
- wxUniChar::LowSurrogate()
2017-05-01 18:00:21 +09:00
ARATA Mizuki
61f0e0ce22 Add wxUSE_UNICODE_UTF16 macro to represent if the internal representation of wxString is UTF-16 or not
The value of this macro is equal to (wxUSE_UNICODE_WCHAR && SIZEOF_WCHAR_T == 2).
2017-05-01 13:55:26 +09:00
Artur Wieczorek
365f8e6f37 Fix PCH-less build
Add missing header to fix compilation after changes of
b1fad4da44 (see #17640).
2017-04-30 23:14:15 +02:00
Artur Wieczorek
6f59c756f6 Fix inserting items to wxRearrangeList (wxGTK)
Order array cannot be extended both in DoInsertItems() and DoInsertOneItem()
functions because DoInsertOneItem() is invoked indirectly from DoInsertItems()
(through the call to wxCheckListBox::DoInsertItems() and DoInsertItemsInLoop())
and therefore order array would be eventually extended by two items for one
inserted list item. To avoid this duplicated actions, we should resign from
overriding DoInsertOneItem().
2017-04-30 21:42:41 +02:00
Artur Wieczorek
15e2dcc38d Fix adding bitmap to clipboard when wxUSE_OLE == 0 (wxMSW)
When CF_DIB object is placed to the clipboard, a handle to the memory
object containing a BITMAPINFO structure followed by the bitmap bits should
be passed to SetClipboardData(), not a handle to a DIB section.
Also, wxClipboard is the owner of the wxDataObject being added, so it
should release passed object.
2017-04-30 21:39:50 +02:00
Artur Wieczorek
b1fad4da44 Convert 0RGB wxBitmaps to RGB when copying them to clipboard
Not all applications recognize properly 0RGB bitmap format so for the sake
of interoperability bitmaps in such format should be converted to plain
24 bpp RGB format prior to being copied to the clipboard.

Closes #17640.
2017-04-30 21:35:01 +02:00
Vadim Zeitlin
063681162a Merge branch 'pvs-fixes'
Closes https://github.com/wxWidgets/wxWidgets/pull/470
2017-04-29 13:56:47 +02:00
tommash
5e24bd162c Don't send unnecessary events when wxSpinCtrlDouble loses focus
Only send the event when the control loses focus if its value has really
changed.

Closes https://github.com/wxWidgets/wxWidgets/pull/436
2017-04-29 13:50:45 +02:00
Ilya Ivanov
6697a7e49a Fix wrong variable name in assignment in wxRichTextSizePage dtor
The "sm_showMinMaxSizeControls" was assigned twice, while
"sm_enablePositionAndSizeUnits" was not assigned at all, apparently by
mistake.

Thanks to PVS-Studio for finding this issue (V519 The
'sm_showMinMaxSizeControls' variable is assigned values twice successively).
2017-04-29 13:44:14 +02:00
Ilya Ivanov
ab7c39fddb Check for variable being non-NULL before using it
The "buffer" argument can apparently be null, as there is a check for this on
the next line, but it was used without checking that this is the case.

Fix this, although it's not totally clear if "buffer" can really be null at
all and maybe the check below should have been removed instead -- but prefer
to err on the side of caution.

Thanks to PVS-Studio for finding this issue (V595 The 'buffer' pointer was
utilized before it was verified against nullptr).
2017-04-29 13:39:19 +02:00
Ilya Ivanov
b65a3ad736 Use VARIANT_TRUE and VARIANT_FALSE correctly
VARIANT_TRUE (-1) must be used with VARIANTs of boolean type, instead of TRUE
(1) which has a different value and can result in interoperability problems.

Thanks to PVS-Studio for finding this issue (V721 The VARIANT_BOOL type is
utilized incorrectly).
2017-04-29 13:35:45 +02:00
Ilya Ivanov
5d7726e3f1 Fix check for wxACC_STATE_SYSTEM_MARQUEED in accessibility code
wxACC_STATE_SYSTEM_INVISIBLE was checked twice, by mistake, while
wxACC_STATE_SYSTEM_MARQUEED was never checked at all.

Thanks to PVS-Studio for finding this issue (V581: The conditional expressions
of the 'if' operators situated alongside each other are identical).
2017-04-29 13:34:12 +02:00
Artur Wieczorek
d5c46e87a6 Fix inserting multiple items to wxRearrangeList
In wxRearrangeList implementations (like wxMSW) where DoInsertItemsInLoop()
and DoInsertOneItem() are not used to insert multiple items, DoInsertItems()
has to be overriden to do this insertion.

See #17836.
2017-04-28 23:57:36 +02:00
Artur Wieczorek
2cf3a3d1c5 Update mailmap file 2017-04-28 21:06:52 +02:00
Artur Wieczorek
88b1699b69 Add demonstration of wxRearrangeList to widgets sample
Add wxRearrangeList as another option on wxListBox page.
2017-04-28 21:05:46 +02:00
Artur Wieczorek
7e1b64a2eb Order array has to have the same size as item list in wxRearrangeList
Number of indices stored in the internal order array has to be the same as
number of the items, so whenever item is added or removed, order array
has to be adjusted accordingly.

Closes #17836.
2017-04-28 21:03:23 +02:00
Vadim Zeitlin
7542632302 Fix keyboard event key codes when using Wayland
Correct the confusion between compile- and run-time checks for X11.

Closes #17848.
2017-04-26 22:30:36 +02:00
Vadim Zeitlin
0975228809 Fix build problem with "override" on wxApp::GetXVisualInfo()
This method doesn't override any virtual method in the base class, so
wxOVERRIDE can't be used here.

In fact, this method doesn't seem to be used at all, but keep it for
compatibility and in case we want to use it later, as wxGTK does.
2017-04-26 14:42:38 +02:00
Jouk
0c748453e7 make compile work again when wxUSE_UNICODE is not defined 2017-04-26 11:24:33 +02:00
Artur Wieczorek
37ecd7b760 Fix displaying labels of wxRadioBox items
Labels containing mnemonic prefixes (&) and literal underscore characters
have to be converted to the proper GTK labels where underscore
characters act as mnemonic markers. If label contains mnemonic then
dedicated function gtk_radio_button_new_with_mnemonic() should be used
to create radio button item.

Closes #17419.
2017-04-25 18:15:34 +02:00
Lauri Nurmi
148e8971c7 Fix the integer value in events generated by generic wxSpinCtrl
This notably fixes the problem with changing the year using spin control
arrows under macOS, where this control is used as part of
wxGenericCalendarCtrl, as not having the correct value in the event object
resulted in bogus events with dates in the year 0 there.

Closes http://trac.wxwidgets.org/ticket/17193
2017-04-25 13:08:14 +02:00
Jouk
e5f5cdb5f0 Synchronize setup for OpenVMS 2017-04-25 11:57:42 +02:00
Vadim Zeitlin
b502a5c44d Fix wxMotif build after recent argv changes
Update wxMotif too after 70a499f635.
2017-04-23 16:20:13 +02:00
Vadim Zeitlin
7fb926c664 Always use wxGTK, not wxMotif, by default under Unix systems
wxMotif is not in a shape to be really for anything currently.
2017-04-23 16:13:40 +02:00
Steven Lamerton
00ddcfa18a Add WebKit2 description to docs 2017-04-23 08:39:33 +01:00
Scott Talbert
cbe0a1f049 Add support for WebKit2GTK+ in wxWebView 2017-04-22 20:00:48 +01:00
Vadim Zeitlin
d10c600773 Add instructions for checking ABI compatibility to release HOWTO
Explain how to use abi-compliance-checker.
2017-04-22 15:58:13 +02:00
Vadim Zeitlin
7d2bc0fc89 Merge branch 'xlocale-checks'
Fix build on systems which don't have full x-locale support even though they
do have <xlocale.h>, such as OpenIndiana.

Closes https://github.com/wxWidgets/wxWidgets/pull/461
2017-04-20 15:56:05 +02:00
Vadim Zeitlin
259b55a17c Rename wx_cv_use_xlocale_local to wx_cv_func_strtod_l
No real changes, just use more standard naming convention for a variable
containing the cached value in configure.
2017-04-20 15:55:33 +02:00
Vadim Zeitlin
9c35db85d1 Use symbolic constant for DST shift
No real changes, just use DST_OFFSET constant instead of 3600 and remove the
"FIXME" comments as we're not actually going to fix anything here but will
just continue to assume 1 hour shift for DST.
2017-04-19 17:07:44 +02:00
Vadim Zeitlin
f6d9d7962e Revert wrong fix for wxDateTime timezone conversion to/from local
This reverts commit aaddf6be7f as it broke
handling of dates when local time zone is BST, whose offset not counting DST
is 0, as for UTC, but which still should be handled as local timezone,
see #17220.

With the current wxDateTime handling of time zones, FromTimezone(Local)
doesn't make much sense anyhow, so abandon attempts to try making it work as
to really do it we need to specify the time zone being converted from too, as
explained in the second point of #10445.

See #16585.
2017-04-19 17:07:44 +02:00
Vadim Zeitlin
dd134b9534 Fix wrong example using printf() in wxDateTime overview
Use wxPrintf() and remove the c_str() call which is redundant with it instead
of using printf() which can't be used with non-POD objects like wxCStrData
returned by c_str() in wx 3.0+.
2017-04-19 17:07:44 +02:00
Lauri Nurmi
9507bc430e Determine availability of the required xlocale API by compiling
Even if <xlocale.h> exists, the whole API that wx requires (specifically
strtod_l() and similar) may not be available. This is the case
on e.g. OpenIndiana (SunOS).
2017-04-19 15:31:02 +03:00
Lauri Nurmi
aa5af25870 Compile the check for ICONV_CONST as C++
On OpenIndiana (SunOS) the result is different when compiled as C,
and the C++ result is what matters to wxWidgets.

Fixes compilation of src/common/strconv.cpp on OpenIndiana.
2017-04-19 15:30:41 +03:00
Metallicow
8c8d8c4d3a Fix "ont" (instead of "one") typo in wxSTC
Correct "ont" to "one" in several places.
2017-04-18 12:25:46 +02:00
Jens Göpfert
7e530e23e1 Update selection in wxAuiNotebook correctly after tab move
Update the selected state of the tab with the index corresponding to the old
index of the tab which was moved.

Closes #16605.
2017-04-18 03:36:16 +02:00
Artur Wieczorek
06963940fb Change current font only if new graphics font is successfully created
If new graphics font couldn't be created successfully there is no need
to reset current font by updating it to wxNullGraphicsFont.

Closes #17790.
2017-04-17 18:57:31 +02:00
Artur Wieczorek
7f9453dfdf Handle unsuccessful creation of graphics font in Direct2D
Apparently, DirectWrite fonts can be created only from TrueType fonts and
therefore only such fonts can be used with Direct2D-based wxGraphicsContext.
When unsuported GDI font is passed to CreateFont() then no graphics font is
created and this unsuccessful attempt is signalled by returning
wxNullGraphicsFont. This null object can be used in e.g. wxGC::SetFont()
to check if font was actually created.

See #17790.
2017-04-17 18:57:02 +02:00
Vadim Zeitlin
5bf8fb1879 Fix fatal bug in the last commit: restore setting argc
Initialization of wxApp::argc was mistakenly removed, breaking the code
iterating over wxApp::argv from 0 to it.

See https://github.com/wxWidgets/wxWidgets/pull/462
2017-04-16 18:06:03 +02:00
Vadim Zeitlin
70a499f635 Don't rely on argv being NULL-terminated under MSW
Since the changes of c9a458bfe8 ("Use Win32
::CommandLineToArgvW() to tokenize command line"), this is not guaranteed any
more as this Win32 function doesn't necessarily ensure it under older MSW
versions such as XP.

Just use "argc" explicitly instead of relying on this in wxCmdLineArgsArray to
fix crashing under XP.
2017-04-16 17:50:22 +02:00
Scott Talbert
ed577b7099 Add autoconf support for building with SDL2
Adds support for finding SDL2 when running configure (support for actually
using SDL2 was added back in cb50bdc075).
2017-04-16 17:49:44 +02:00
Lauri Nurmi
4cdc1f5ba8 Compilation fix for narrowing conversions in XBM files in wxMotif
The same fix as in commit 3704547684 for ticket #12575.
2017-04-15 14:31:30 +02:00
Artur Wieczorek
2e9e3f5c31 Copy reference images required to execute unit test
Reference images necessary to run a test (see ef46f24f37) have to be copied to the target folder.
2017-04-15 00:13:13 +02:00
Artur Wieczorek
003cb8a9ce Document recent wxMemoryDC::Blit() fix in changelog
Document changes introduced in 0ac0f4b259.
2017-04-14 18:31:26 +02:00
Artur Wieczorek
0ac0f4b259 Fix wxMemoryDC::Blit() with itself as source in wxGTK3
Drawing on the Cairo surface itself can give invalid results when source and destination regions overlap.
To avoid this problem we have to copy actual source surface to the temporary one and use this copy in drawing operations.

Closes #17666.
2017-04-14 09:33:20 +02:00
Artur Wieczorek
f171d48be4 Disable antialiasing in unit test
In order to examine real colors of pixels we need to have unmodified (aliased) edges between regions drawn with different colors.
For for wxDCs backed by wxGraphicsContext (e.g. under wxGTK3) antialiasing is enabled by default and to prevent falsifying pixel colors we have to disable it prior to drawing operations.

See #17666.
2017-04-14 09:15:04 +02:00
Artur Wieczorek
34e19a7449 Prevent unit test from crashing under wxGTK3
Under wxGTK3 default color depth for wxBitmap is 24 bpp and therefore wxAlphaPixelData cannot be used to get access to wxBitmap's internal data in this case.

See #17666.
2017-04-14 09:13:36 +02:00
Dimitri Schoolwerth
5a7570bf7d Fix failing unit test in MarkupTestCase
One of the wxMarkupParser tests expects "&amp;" to map to "&&" however
this, purposefully, is not the case any longer since
60bd6842e4. Fix by changing the expected
result to contain a single ampersand instead of double.
2017-04-13 00:27:41 +04:00
Václav Slavík
c7a6cb9c2e Fix missing virtual dtor warning for wxMarkupText
Changes from 60bd6842 introduced a warning about not having a virtual
destructor despite having virtual methods.
2017-04-11 15:34:50 +02:00
Artur Wieczorek
d0a07b665f Fix MSVC14 warnings about shadowed variables in wxSTC
Just to suppress harmless warnings.
2017-04-09 21:29:31 +02:00