Commit Graph

66175 Commits

Author SHA1 Message Date
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
a8262abc11 Simplify MacHasScrollBarCorner() by removing pre-10.7 code
We don't support macOS versions earlier than 10.7 any longer, so there
is no need to check for 10.7 during run-time and all the code checking
for the resize box presence can be completely removed as, according to
the preexisting comment, the resize box is never present in the
currently supported versions.
2019-04-17 19:44:30 +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
Vadim Zeitlin
22369e97fc Use correct enum in wxOSX wxMediaCtrl code
The values we check for are elements of AVPlayerItemStatus enum and not
AVPlayerStatus, so use the correct type for the variable.

This actually doesn't change anything and the enum elements have the
same values anyhow, but the code makes more sense now and avoids
-Wenum-compare-switch warnings from Xcode 10 compiler.
2019-04-17 18:52:43 +02:00
Artur Wieczorek
e41f219131 Notify wxPropertyGrid about selected property while restoring editable state
Grid should be notified about selected property on actually selected page
to e.g. update property description.
2019-04-17 18:25:19 +02:00
Artur Wieczorek
6bcf1bad71 Fix restoring width of first wxPropertyGrid column
While restoring editable state also the position of the first splitter
should be set.
2019-04-17 18:12:01 +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
Artur Wieczorek
b63e89db92 Simplify calculation of wxPropertyGrid header position
We can just query the grid its for actual border width instead of
calculating it on our own.
2019-04-15 18:31:02 +02:00
Vadim Zeitlin
6cc1d63d68 Add a comment to wxToolBar::DoGetBestSize()
No real changes, just explain one of the changes done in the commit
909adbb6bf a bit better.
2019-04-14 18:25:56 +02:00
Artur Wieczorek
e6a7267811 Fix calculation of spin button size in wxSpinCtrl editor
Under GTK+ 3 wxSpinButton (being a part wxSpinCtrl editor) is always
displayed horizontally and its minimal width is greater than 18 pixels
so its best width has to be left unmodified and we can only attempt
to fit its height to the height of the wxSpinCtrl property cell.
For other ports wxSpinButton can be displayed vertically and scaled as
necessary.

Closes #18385.
2019-04-14 12:02:51 +02:00
Vadim Zeitlin
445e320df2 Avoid use of C++11 range-based for loop in wxOSX code
This results in clang -Wc++11-extensions warning if -std=c++1x (for some
value of "x") is not used.
2019-04-13 19:42:33 +02:00
Maarten Bent
7e49a3e6c0 Update wxSVGFileDC documentation 2019-04-10 23:45:27 +02:00
Maarten Bent
310b06402e Remove unused variable in wxSVGFileDC 2019-04-10 23:44:26 +02:00
Maarten Bent
b7bf6640ed Restore original wxSVGBitmapFileHandler behaviour
Save the embedded images in the same directory as the SVG file, not in the
runtime directory.
2019-04-10 23:41:58 +02:00
Maarten Bent
19c66c780d White-space only changes in wxSVGFileDC code 2019-04-10 23:37:34 +02:00
milotype
755906a431 Update Croation translations
Closes https://github.com/wxWidgets/wxWidgets/pull/1284
2019-04-08 14:33:26 +02:00
Paul Cornett
0aa8b5874f Fix setting markup on a wxButton that was initially created with an empty label
See #18378
2019-04-07 15:01:04 -07:00
Vadim Zeitlin
909adbb6bf Use correct separator sizes in MSW wxToolBar best size calculation
Don't assume that all the items (except for the controls) have the same
size in wxToolBar::DoGetBestSize(), this is manifestly not true at least
for the separators and resulted in too much space left over at the end
of the toolbar.
2019-04-07 13:25:25 +02:00
Paul Cornett
955a60a3e1 Avoid possible memory leak 2019-04-05 11:10:03 -07: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
fe1737d399 Reduce the scope of some local variables 2019-04-05 10:44:02 -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
691521e411 Avoid comparing unsigned values with < 0 2019-04-05 10:12:27 -07:00
Paul Cornett
1bba25c7ee Avoid out-of-bounds array index 2019-04-05 10:10:07 -07:00
Paul Cornett
9299f9f1d8 Avoid left shift of 32-bit value by more than 31 2019-04-05 10:02:51 -07:00
Paul Cornett
7cbe23830f Avoid truncation of expression assigned to larger type 2019-04-05 09:55:49 -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
628e7af79e Check for self-assignment in operator=() 2019-04-05 09:27:15 -07:00
Paul Cornett
8791313aff Add defaults to switch statements to avoid many warnings about unhandled enum values 2019-04-05 09:26:05 -07:00
Paul Cornett
67773f58f1 Avoid immediate destruction of temporary wxBusyInfo object 2019-04-05 09:23:40 -07:00
Paul Cornett
210e162302 Use newer wxDECLARE_* macros 2019-04-05 09:21:29 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
d52acfe469 Use correct printf format specifier 2019-04-05 09:09:53 -07:00
Paul Cornett
6a35140686 Remove redundant conditionals 2019-04-05 09:06:06 -07:00
Vadim Zeitlin
0dfe0d0a9c Don't add extra padding in wxMSW wxToolBar best size calculation
DoGetBestSize() mistakenly added extra (half of) padding for each tool
explicitly when the padding is already taken into account of by
GetToolSize() itself, so this resulted in extra space at the end of the
toolbar proportional to the number of buttons in it.
2019-04-05 13:39:31 +02: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
Paul Cornett
90ce6a4334 Remove unused variables 2019-04-04 10:40:45 -07:00
Paul Cornett
5629f71c32 Remove unused/redundant assignments 2019-04-04 10:28:42 -07:00
Paul Cornett
ff01f4a5a8 Avoid uninitialized variables 2019-04-04 10:17:21 -07:00
Paul Cornett
e89cd4f2dd Fix unintentional self-assignment
Assume what it was meant to be
2019-04-04 10:09:21 -07:00
Paul Cornett
ea5cf38d62 Fix unused variables
Infer from context how they were meant to be used
2019-04-04 09:59:01 -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
1f64877ca4 Merge branch 'msw-display-refresh'
Fixes for display information refreshing under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/1282
2019-04-02 17:19:01 +02:00
Vadim Zeitlin
b0ad9ccffd Use control current, not best, size in wxMSW wxToolBar layout code
Avoid allocating too much space to the control in the toolbar, it may
have been made smaller than its best size on purpose and, in any case,
we don't resize the control, so it's useless to allocate more space to
it than it's going to use.

See #18294.
2019-03-31 13:39:57 +02:00
Vadim Zeitlin
3959810d42 Avoid unnecessary cached display information updates
Only invalidate display cache when something related to the displays has
changed and not whenever any system option has.

This should avoid completely unnecessary refreshes when a UAC prompt is
shown, for example: even if doing this works now, after the previous
commit, we still don't have to do it at all.
2019-03-31 13:22:30 +02:00
dasimx
f3c5923e1a Fix refreshing display information in wxMSW in some special cases
Passing screen HDC to EnumDisplayMonitors() doesn't work if we do it
while a UAC prompt is shown or during log-off process, so change the
code enumerating the displays to use monitor-appropriate HDC instead.

This fixes the problem with losing display information entirely if
WM_SETTINGSCHANGE was generated when showing UAC prompt, as it happens
when "automatic background color" option is set under Windows 10.
2019-03-31 13:18:41 +02:00
Vadim Zeitlin
8927d7b092 Update displays sample correctly when displays change
wxEVT_DISPLAY_CHANGED notifies not only about the change of resolution
of a display, but also about removal or addition of a new display, so we
need to completely repopulate the notebook showing the displays on
receiving it.
2019-03-31 13:04:43 +02:00
dasimx
e9ca12aaac Remove the now unnecessary wxDisplayFactoryMSW::RefreshMonitors()
wxDisplay::InvalidateCache() does the same thing this function does, so
just remove it to avoid confusion.

This also allows to get rid of ms_factory duplicating the factory
pointer stored at wxDisplay level.

See https://github.com/wxWidgets/wxWidgets/pull/1281
2019-03-30 14:15:14 +01:00