Commit Graph

18124 Commits

Author SHA1 Message Date
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Vadim Zeitlin
5d770e5cbe Use "m_" prefix for wxExecuteData members
No real changes, just rename the members to use the standard prefix
which is more consistent with the rest of wxWidgets and also allows to
avoid both the hacks with "foo_" names for the arguments of some
functions that were used to avoid the conflicts with member "foo" and
at least one remaining shadowing warning for "exitcode".
2019-04-22 14:09:28 +02:00
Stefan Csomor
5020a810db Fix macOS memory leaks, also avoid false positive warnings from clang analyzer
__clang_analyzer__ is a constant that only is defined during analyze build, this helps avoiding false positives as long as there is no specific way to silence analyzer messages
2019-04-21 23:52:37 +02:00
Artur Wieczorek
b35170dc61 Make wxPG_BOOL_USE_CHECKBOX and wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING built-in attributes
Both attributes are used only in wxBoolProperty and wxFlagsProperty to set respective internal flags and don't have to be stored in the property's attribute store.
2019-04-21 23:39:32 +02:00
Artur Wieczorek
ccd877c458 Make wxPG_FLOAT_PRECISION a built-in wxFloatProperty attribute
wxPG_FLOAT_PRECISION value is used only internally in wxFloatProperty and there is no need to make it readable via getter function.
2019-04-21 23:39:30 +02:00
Vadim Zeitlin
9a9c845289 Add wxSystemAppearance to check for dark mode under macOS
Provide a way to retrieve the name of the current system appearance
(mostly for diagnostic purposes) and check if it uses predominantly dark
colours.

Currently this class has a non-trivial (but still very simple)
implementation under macOS only and simply checks whether the default
text colour is brighter than the default background colour under the
other platforms, but other platform-specific implementations could be
added later.

Also update the drawing sample "system colours" page to show the system
appearance as well.
2019-04-21 02:11:07 +02:00
Vadim Zeitlin
d662a2223e Add wxColour::GetLuminance()
This method can be used to return the perceived brightness of the
colour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1300
2019-04-21 02:09:42 +02:00
Vadim Zeitlin
b6477e0b9c Merge branch 'stcpopup'
Many usability and appearance improvements for autocompletion popups and
call tips in wxSTC.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-04-21 02:03:32 +02:00
Vadim Zeitlin
1f15b41f55 Merge branch 'osx-warnings'
Fix a few warnings with Xcode 10 and start using __builtin_available for
macOS version checks.

See https://github.com/wxWidgets/wxWidgets/pull/1299
2019-04-18 22:58:23 +02:00
Vsevolod V Gromov
20c7421a67 Add Get{Min,Max,Range}() to numeric validator classes
Just provide accessors matching the existing setters.

Closes https://github.com/wxWidgets/wxWidgets/pull/1287,
https://github.com/wxWidgets/wxWidgets/pull/1288
2019-04-18 16:47:02 +02:00
Vsevolod V Gromov
3674bd1c1f Add wxDCTextBgColourChanger and wxDCTextBgModeChanger helpers
These classes are similar to the existing wxDCTextColourChanger and
allow temporarily changing other wxDC attributes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1298
2019-04-18 16:34:38 +02:00
Vadim Zeitlin
fe311b9cc5 Use __builtin_available() when available in wxMac builds
The advantage of using this compiler builtin instead of our own platform
checks is that the compiler will warn us (if -Wunguarded-availability is
turned on for APIs introduced before 10.13 or by default for later ones)
if a check is forgotten, which is not the case for the manual checks.

Update the code to use WX_IS_MACOS_AVAILABLE() macro, which expands to
__builtin_available() when supported, and also use API_AVAILABLE() where
it makes sense to avoid having too many checks.
2019-04-18 00:02:34 +02:00
Vadim Zeitlin
b53c516564 Add more wxOVERRIDE to avoid clang warnings
This fixes several thousands of -Winconsistent-missing-override warnings
given by Xcode 10 when building the library.
2019-04-17 19:05:31 +02:00
orbitcowboy
d82de6b5bf Fix a typo in wxWindow::CaptureMouse() comment
There are no functional changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1291
2019-04-16 02:04:56 +02:00
Paul Cornett
9511ab08f1 More use of wxOVERRIDE 2019-04-05 11:08:53 -07:00
Paul Cornett
794c1374b8 Remove unneeded overrides
These just forward to the base class
2019-04-05 10:54:54 -07:00
Paul Cornett
af1cf0a5f3 Use ctor-initializer rather than assignment for non-POD class members 2019-04-05 10:21:04 -07:00
Paul Cornett
1a90833839 Avoid 31-bit left shift of 32-bit signed values 2019-04-05 09:48:35 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
25e9be6873 Avoid binding reference to NULL pointer when wxUSE_VALIDATORS==0
Undefined behavior sanitizer complains about it
2019-04-04 10:56:14 -07:00
Vadim Zeitlin
9f95e86e76 Fix apparent activation loss after hiding previous popup
Commit 58d4b0e209 introduced a regression:
if a previous popup still existed when the new one was shown, dismissing
the second popup would result in the owner window losing its "active"
appearance.

This was due to the fact that ::GetActiveWindow() still returned the
former popup when it was about to be dismissed, so it was too early to
call it in WM_NCACTIVATE handler. Do it now in DismissOnDeactivate()
itself which is both simpler and more correct.
2019-04-02 18:13:27 +02:00
Vadim Zeitlin
58d4b0e209 Fix for showing multiple popups in a row in wxMSW
There were at least 2 problems when showing a transient popup while
another one was already shown in wxMSW, as could be seen by showing
several wxRichToolTips in a row from a timer event handler, for example:

First problem was that wxCurrentPopupWindow was incorrectly reset in
this case by the old popup window when it was hidden, even though it
should have been remaining set to the new popup window. Fix this by
checking that we only reset wxCurrentPopupWindow when hiding the popup
if it still points to this popup, but not if it has been changed to
point to another one in the meanwhile.

Second problem was more mysterious and resulted in simply not receiving
the activation events for the new popup when showing it resulted in
hiding the previous one. The working hypothesis is that hiding a window,
which changes activation on its own, from WM_NCACTIVATE handler in our
code confused ShowWindow(), which handles switching activation, which
didn't expect this to happen, so the fix is to avoid doing anything
immediately from this handler and wait until the next idle event to do
it instead.

These fixes ensure that showing several popups in a row works correctly,
i.e. hides the previous popup when a new one is shown and also keeps the
parent window appearing active during all the time and deactivates it if
the focus switches to another top level window at the end.
2019-03-30 04:11:46 +01:00
dasimx
a15004fc5f Fix handling display disconnection under wxMSW
Information about display cached in wxDisplayFactory::m_impls and in
wxDisplayFactoryMSW::m_displays could get out of sync after removing a
display from the system, resulting in failures when calling various
wxDisplay functions later.

To fix this, reuse InvalidateCache() to invalidate the cache in
wxDisplayFactoryMSW too, making it virtual in order to allow overriding
it there. Also call InvalidateCache() from wxDisplayFactoryMSW itself
instead of doing it from wxWindow, as this works even when the
application isn't showing any windows (and also keeps all
display-related code together).

Closes https://github.com/wxWidgets/wxWidgets/pull/1246
2019-03-29 23:19:59 +01:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

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

Closes #18294.
2019-03-29 19:16:40 +01:00
Paul Cornett
b8789b9d6f Fix drag move of wxMiniFrame under Wayland
Use gtk_window_begin_move_drag() instead of trying to do it manually
See #18372
2019-03-26 10:04:35 -07:00
Vadim Zeitlin
39380847da Avoid redundant declarations for wxQsort()
This works around gcc -Wredundant-decls warning that was given (if
explicitly enabled) when both wx/vector.h and wx/utils.h were included.

The workaround is ugly, but it doesn't seem worth it to introduce a
separate wx/qsort.h header just for this single function, which seems to
be the only other way to fix this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1271
2019-03-21 02:44:27 +01:00
New Pagodi
fe7b332b7b Regenerate STC files after recent changes 2019-03-20 00:15:44 -05:00
Vadim Zeitlin
626a96058f Fix clang -Winconsistent-missing-override when not using RTTI
In this case wx-specific RTTI is used and GetWxTypeId() method was
overridden without using wxOVERRIDE, which resulted in dozens of
warnings for each translation unit.
2019-03-19 02:12:01 +01:00
Vadim Zeitlin
6e949961ef Detect wxNO_RTTI automatically for clang too
This has been already done for gcc and MSVC, add clang-specific check as
well.
2019-03-19 02:10:53 +01:00
Vadim Zeitlin
1cdc0acfbe Merge branch 'stcxpm' of https://github.com/NewPagodi/wxWidgets
Improve XPM images handling in wxStyledTextCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1215
2019-03-18 22:36:25 +01:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

Closes https://github.com/wxWidgets/wxWidgets/pull/1257

Closes #18341.
2019-03-18 18:29:19 +01:00
exprosic
7a2d9d0d10 Fix compilation of MFC support code in MSVS conformance mode
Allow the code to be compilable with /permissive-, which is on by
default in VS2017.

Closes https://github.com/wxWidgets/wxWidgets/pull/1263
2019-03-18 18:11:42 +01:00
New Pagodi
f4e0c1aaee Regenerate wxSTC files after recent changes 2019-03-17 01:49:30 -05:00
Stefan Csomor
f163578c94 macOS expose scroll invertion in event
applied patch from #18358, thanks for the patch Andy
2019-03-12 12:22:41 +01:00
Artur Wieczorek
86af7d5ee9 Get rid of unnecessary overriding function
OnValidationFailure() in derived class wxEnumProperty has the same implementation (empty body) as the implementation in the base class wxPGProperty so overriding this function in derived class is not necessary.
2019-03-09 18:57:56 +01:00
Vadim Zeitlin
5a78b82673 Add support for passing nullptr to wx pseudo-vararg functions
Allow passing literal nullptr as an argument corresponding to "%p" in
the format string.

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

Closes #18355.
2019-03-09 01:14:31 +01:00
Paul Cornett
61d59dfc85 non-pch build fix 2019-03-06 08:49:05 -08:00
Vadim Zeitlin
d841f7b34e Merge branch 'wxQt-memory-leaks' of https://github.com/catalinr/wxWidgets
Fix many memory leaks in wxQt port.

See https://github.com/wxWidgets/wxWidgets/pull/1243
2019-03-05 23:36:41 +01:00
Cătălin Răceanu
934698d8ac Change Qt smart pointers with wx ones to fix compilation 2019-02-27 22:06:47 +02:00
Cătălin Răceanu
1578240b6e Change a couple of data types and simplify code a bit 2019-02-27 17:42:01 +02:00
Cătălin Răceanu
113822d024 Change member variable type 2019-02-27 16:58:35 +02:00
Cătălin Răceanu
315a9460c0 Remove memory leaks by using smart pointers or explicit delete 2019-02-27 01:12:03 +02:00
Cătălin Răceanu
595a9945b5 Do not leak the list of panes 2019-02-26 23:13:12 +02:00
Paul Cornett
7c3ce912e0 Use ctor-initializer rather than assignment for non-POD class members 2019-02-25 10:23:35 -08:00
Paul Cornett
5e3c39043d Fix wxQT monolithic build on Linux
- Remove duplicate wxConsoleAppTraits::CreateEventLoop()
  It's already defined for Unix as well as Windows

- Remove wxEventLoop AddSourceForFD() "override"
  the base version is static and therefore clearly not meant to be overridden
2019-02-25 00:35:27 -08:00
Cătălin Răceanu
cb74819562 Don't leak QApplication and command line arguments 2019-02-24 23:45:46 +02:00
Vadim Zeitlin
7c8ba45705 Reuse helper MSWGetFittingtSizeForControl() in a couple of places
Refactor the code to reuse the same function for determining the size
needed by an embedded control in the toolbar, including its label.
2019-02-24 18:19:49 +01:00
Vadim Zeitlin
82857cfa9d Add small helper function to wxMSW wxToolBar code
Encapsulate the logic for deciding whether we should show the labels for
the embedded controls or not in a small helper function, to make it
simpler to change it in the future if needed and also to have a single
place to explain why do we do what we do now.

No real changes.
2019-02-24 02:04:55 +01:00
Cătălin Răceanu
0e3784c46e Implement support for value range in wxQt wxSpinButton
Closes https://github.com/wxWidgets/wxWidgets/pull/1237
2019-02-22 19:49:06 +01:00
Vadim Zeitlin
38d7ba21e2 Merge branch 'tglbtn' of https://github.com/catalinr/wxWidgets
Reimplement wxToggleButton correctly for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1228
2019-02-21 04:33:56 +01:00