Commit Graph

63015 Commits

Author SHA1 Message Date
Paul Cornett
0b2ec56ae3 Simplify wxMacConvertNewlines helper functions
One is not used at all, two are only used in one place. Make the remaining
two return a wxString instead of taking a wxString pointer parameter.
2017-10-01 10:44:35 -07:00
Paul Cornett
37e29d3451 Use wx prefix for global names 2017-10-01 10:03:48 -07:00
Paul Cornett
63a8a852f9 Avoid unused variable warning 2017-10-01 09:46:56 -07:00
Paul Cornett
7816ca6538 Fix building tests with wxUSE_XRC==0 2017-10-01 09:46:03 -07:00
Paul Cornett
a87599b127 Fix building tests with wxUSE_UIACTIONSIMULATOR==0 2017-10-01 09:44:53 -07:00
Paul Cornett
fc7f20c419 Fix some memory leaks in the tests 2017-10-01 09:41:49 -07:00
Paul Cornett
8c353236ac Fix ifdef for TGA 2017-10-01 09:38:47 -07:00
Paul Cornett
5cd5c878ee Avoid using wxString::ReadAll() on a file containing binary data
ReadAll() does character set conversion, which will likely fail
2017-10-01 09:17:49 -07:00
Paul Cornett
db29d5efba Fix incorrect pointer indirection in sort callback function 2017-10-01 09:11:45 -07:00
Paul Cornett
29e1f1e9ce Avoid deleting object of different size than what was allocated 2017-10-01 09:02:11 -07:00
Paul Cornett
591da5dcc4 Fix memory leak of wxClientData when wxChoice is deleted 2017-10-01 08:55:57 -07:00
Paul Cornett
6a75c8f484 Fix invalid memory access beyond end of image data 2017-10-01 08:41:14 -07:00
orbitcowboy
9416e00abe No real changes, just enclosed macro arguments in parentheses.
I
2017-09-28 19:21:22 +02:00
Artur Wieczorek
c6938e9f97 Fix setting transparency flag for wxBitmap created from wxIcon
wxBitmap should be made transparency-capable before copying wxIcon bits to it. Doing so when wxIcon bits are already copied seems to work fine for OSX 10.8, but not for newer versions. 

Closes #17953.
2017-09-28 19:08:50 +02:00
PB
229c69d891 Czech translations update from pbfordev
Closes https://github.com/wxWidgets/wxWidgets/pull/559
2017-09-27 14:26:07 +02:00
Stefan Csomor
dfed16a792 Adding intrinsics for ARM 64 bit ios png builds 2017-09-26 20:09:24 +02:00
Stefan Csomor
032b718f88 Merge branch 'master' of https://github.com/wxWidgets/wxWidgets 2017-09-25 21:57:36 +02:00
Stefan Csomor
560676a393 Missing chanaged typedef for OpenGLES / iOS 2017-09-25 21:55:34 +02:00
Vadim Zeitlin
81304fcafd Fix linking console applications with MinGW in monolithic build
Do compile wxEntry(void) overload used in wxIMPLEMENT_WXWIN_MAIN_CONSOLE
expansion by non-MSVC compilers under MSW inside the monolithic library
too by replacing the "#if !wxUSE_GUI" check guarding it with "#if
wxUSE_BASE" one.

It's not really clear how could this have ever worked without this fix
before, although it apparently did, but stopped with gcc 7.
2017-09-25 19:01:12 +02:00
Stefan Csomor
3063ea6ca9 Fixing Creation of wxGLCanvas on iOS 2017-09-25 17:42:11 +02:00
Stefan Csomor
9e88518eb2 Emulating proper Left Down State for Mouse Events on iPhone 2017-09-25 17:40:36 +02:00
Artur Wieczorek
53718ac4af Change alignment style dynamically for wxTextCtrl in widgets sample also under wxOSX 2017-09-25 15:51:43 +02:00
Andreas Falkenhahn
ccc513bca9 Allow changing alignment styles after wxTextCtrl creation (wxOSX)
Update NSTextView/NSTextField alignment mode when wxTextCtrl alignment styles are changed with SetWindowStyleFlag().

Closes #17952.
2017-09-25 15:38:24 +02:00
Paul Cornett
cd1c3fab0c Use static linkage for various local names 2017-09-24 09:29:26 -07:00
Paul Cornett
925a1c0734 Avoid assert when deleting last item from wxListCtrl
See #17959
2017-09-24 08:51:48 -07:00
Artur Wieczorek
086793ceef Fix sending SPIN_UP/DOWN events when value wraps around (wxGTK)
SPIN_UP/DOWN events should represent the arrow being pressed,
not a direction in which the value changed (see documentation).

Closes #17957.
2017-09-23 19:08:29 +02:00
Paul Cornett
fd33fcf191 Use static linkage for various local names 2017-09-22 10:45:56 -07:00
Paul Cornett
18edcfab00 Fix memory leak when wxDataViewCtrl is deleted (wxGTK)
Need to delete wxGtkTreeModelNode structure
2017-09-22 10:29:52 -07:00
Artur Wieczorek
3b0a539045 Ensure that new value sent in EVT_SPIN_UP/DOWN is never out the range (wxMSW)
The new value sent in the event cannot be just set to the current value +/- 1. Wrapping and actual limits has to be taken into account.

See #17957.
2017-09-22 15:39:16 +02:00
Artur Wieczorek
a9843a7492 Send EVT_SPIN_UP/DOWN events also when wxSpinButton value wraps around (wxOSX)
EVT_SPIN events should be sent at every value change, not only if it's changed by +/- 1.

See #17957.
2017-09-22 15:28:12 +02:00
Artur Wieczorek
3d5e84b229 Update transparency flag for wxBitmap created from wxIcon
Just created wxBitmap has "hasAlpha" flag set to false so it needs to be modified if source wxIcon contains transparency values.

Closes #17953.
2017-09-22 09:44:10 +02:00
Vadim Zeitlin
4d388e351c Fix Direct2D graphics context after wxPenInfo changes
At least in wxMSW wxPen::GetStipple() returns a non-null (but invalid)
bitmap even when pen style is not wxPENSTYLE_STIPPLE, so don't test for
this bitmap when creating a wxGraphicsPen from a wxPen but for the style
directly.

This avoids using this invalid bitmap later in D2D code, where it
resulted in assert failures.

Also add a similar style test before calling wxPen::GetDashes() for
consistency, even if it doesn't seem to be strictly necessary.

See https://github.com/wxWidgets/wxWidgets/pull/553

Closes #17958.
2017-09-21 18:04:24 +02:00
Václav Slavík
c515c43fd5 Fix wxDataViewCtrl::ClearColumns() crash on macOS 10.13
When replacing m_OutlineView with a new one in ClearColumns(), we must
explicitly remove the old one from its superview to ensure that no more
drawing operations are pending for it. Without this change, Cocoa
drawing code would occasionally crash on attempting to message the
now-zombie m_OutlineView instance. This happened in older macOS
versions too, but became much more frequent in 10.13 High Sierra.
2017-09-21 14:02:41 +02:00
Václav Slavík
03e93b277e Fix wxCommandLinkButton explicit initial size 2017-09-21 14:02:41 +02:00
Artur Wieczorek
e2bfba21fe Fix sending EVT_SPIN_DOWN/UP events in Cocoa implementation of wxSpinButton
To determine which wxSpinButton arrow was clicked, in the action handler there is compared current NSStepper value (after the actual change) with the value before the change. This former value is fetched in the internal mouse click event handler which is invoked before the action handler. This method of determining a delta works fine as long as the current value remains unchanged between the execution of the internal mouse click event handler and the action handler. But if the current value is explicitly changed (by calls to SetValue(), SetRange()) in some handler(s) invoked between these two (like e.g. bound EVT_LEFT_DOWN handler), calculated delta can be invalid and therefore wrong EVT_SPIN_DOWN/UP events can be sent.
To get correct delta value we should to keep track of all explicit changes made to the current value starting from the mouse click and up to the entry to the action handler.

Closes #17955.
2017-09-21 13:45:13 +02:00
Anil Kumar
22a4feea53 Update current item in generic wxDataViewCtrl::SetSelections()
SetSelections was clearing the previous selection, invalidating the
current item, but didn't set it after selecting the new items.

This was causing issues in keyboard selection, e.g. pressing Shift+click
didn't select all the items between the selected and the clicked ones.

Fix this by making the last item of the new selection current, which is
the expected behaviour considering that SetSelections() should be
equivalent to calling SetSelection() with all items one by one.

Signed-off-by: Anil Kumar <anilkumar8753@gmail.com>

Closes https://github.com/wxWidgets/wxWidgets/pull/557
2017-09-19 22:32:21 +02:00
Vadim Zeitlin
78fdea89b1 Fix wxGetWinVersion() description in a comment
No real changes, just update the comment after the changes of commit
dcf95e1cdc to avoid saying that
wxWinVersion_Unknown is 0.
2017-09-18 17:51:25 +02:00
Vadim Zeitlin
5db73ec9b1 Use wxScopedArray<> instead of wxScopeGuard in wxTGAHandler
Using smart array class is better than using ad hoc scope guards for
freeing memory in any case, but in this particular case it also helps to
avoid g++ 7 -Wnoexcept-type warnings due to type of free() changing to
become "void(*)() noexcept" in C++17.
2017-09-17 18:17:58 +02:00
Vadim Zeitlin
dcf95e1cdc Change MSW version checks to work for yet unreleased versions
wxGetWinVersion() will return wxWinVersion_Unknown for any MSW version
not recognized by the version of wxWidgets used when building the
application, so it makes sense to use a value higher than all currently
known ones for this constant, so that the checks comparing the result of
wxGetWinVersion() with any known version would still work correctly.

E.g. comparisons like wxGetWinVersion() >= wxWinVersion_Vista will now
continue to work for binaries built using the current wxWidgets even
under some future Windows 11 OS version, unlike before.
2017-09-17 13:16:14 +02:00
Gian-Carlo Pascutto
a8b33bf08e Make the private.h header compatible with Clang.
The include/wx/msw/private.h header contains a violation of the C++
standards that MSVC tolerates but Clang/LLVM does not.

WinBase.h contains the definition:
    #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)

Which wxWidgets uses in:
    template <wxUIntPtr INVALID_VALUE =
        (wxUIntPtr)INVALID_HANDLE_VALUE>

The (effective) reinterpret_cast-ing of INVALID_HANDLE_VALUE in
WinBase.h means that the define isn't actually usable as a constant
expression for the template parameter.

Clang has indicated they have no intention of adding an MSVC
compatibility workaround for this problem. See LLVM bug 12116:
https://bugs.llvm.org/show_bug.cgi?id=12116

Given this, rework the wxWidgets header to remove the default
template parameter value (it is not used anywhere).
With this change, it's possible to compile wxWidgets applications
using Clang/LLVM (5.0) under MSVC.
2017-09-17 13:12:30 +02:00
New Pagodi
33ad8063d6 Add Scintilla FineTicker methods to wxSTC
Starting with version 3.5, Scintilla implemented a newer method for
handling timers and used this method in its Windows, GTK+, Cocoa, and Qt
ports. This patch attempts to bring the timer handling for wxSTC in line
with those other ports.

Closes #17949.
2017-09-17 11:12:34 +02:00
Artur Sochirca
6c01707627 Don't use wxTreeCtrl item insertion workaround under modern MSW
Don't refresh the control unnecessarily after inserting the first child
node when using modern (i.e. post-XP) MSW version, this just slows down
inserting of the first child item in big trees.

Closes https://github.com/wxWidgets/wxWidgets/pull/555
2017-09-13 17:32:25 +02:00
Vadim Zeitlin
81d9952dfe Really fix spurious asserts in wxGTK wxDataViewCtrl::EditItem()
This replaces the changes of 24c0401e81
which, for some reason, used a global variable for storing whether the
selection function had been already set or not, when this clearly is a
per-control (or per-selection, but this seems one and the same) bit of
information.

Replace global ms_firstTime with a wxDataViewCtrlInternal field to avoid
asserts as soon as EditItem() is called on more than one wxDataViewCtrl.

Closes #17946.
2017-09-13 17:25:48 +02:00
Vadim Zeitlin
e48676cf4a Fix input buffer overflow in wxZip code
Don't crash when reading malformed ZIP files with incorrect field
lengths for the extra fields.

Closes #17947.
2017-09-13 14:46:11 +02:00
Vadim Zeitlin
d25d2400fc Fix crash in wxGraphicsPen::CreatePen() after wxPenInfo changes
Don't unconditionally dereference the result of wxPen::GetStipple()
which can (and often is) null.

This fixes crash introduced in 40f8403f5d.
2017-09-13 14:02:45 +02:00
Paul Cornett
85ea9c180d Use ctor-initializer for non-trivial members 2017-09-12 09:51:53 -07:00
Paul Cornett
a357fefaf4 Use const_cast in new code 2017-09-12 09:47:55 -07:00
Vadim Zeitlin
97dcc02db5 Fix wxQt compilation after first week day changes
Fix typo in its version of wxCalendarCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/522
2017-09-11 19:48:09 +02:00
Vadim Zeitlin
40f8403f5d Merge branch 'peninfo'
Add wxPenInfo and wxGraphicsPenInfo which allows to specify fractional
pen widths when using wxGraphicsContext.

Closes #17087.

Closes https://github.com/wxWidgets/wxWidgets/pull/472
2017-09-10 21:45:47 +02:00
Vadim Zeitlin
f19012c62c Merge branch 'firstweekday' of https://github.com/lanurmi/wxWidgets
Add API for determining the first day of the week and use it in
wxCalendarCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/522
2017-09-10 21:41:36 +02:00