Commit Graph

66044 Commits

Author SHA1 Message Date
Vadim Zeitlin
af83769bd0 Add wxMBConv::GetMaxCharLen()
This is not used yet, but will be needed soon in order to determine
whether we have sufficiently many to decode them.
2019-04-21 20:04:52 +02:00
PB
bd37af32b1 Improve documentation for file selector functions
Improve wording, add missing parentheses to make a function reference
hyperlinked, and add @header tag where it was missing.

Closes https://github.com/wxWidgets/wxWidgets/pull/1303
2019-04-21 17:58:21 +02:00
PB
21f6c0af1e Update year in string returned by wxGetLibraryVersionInfo()
Change years in the copyright information returned by
wxGetLibraryVersionInfo() from "1995-2018" to "1995-2019".

Closes https://github.com/wxWidgets/wxWidgets/pull/1302
2019-04-21 17:53:50 +02:00
Vadim Zeitlin
025709d18b Merge branch 'sys-appearance'
Add wxSystemAppearance for dark mode checks under macOS.

Closes https://github.com/wxWidgets/wxWidgets/pull/1292
2019-04-21 02:11:18 +02:00
Vadim Zeitlin
16af76e542 Use wxSystemAppearance::IsDark() to check for dark mode in wxOSX
This should be more reliable than simply checking the red component of
the default window background colour.
2019-04-21 02:11:08 +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
eebadf3483 Rename m_UseXXX variables to m_useXXX for consistency
And also to follow the usual naming convention.
2019-04-21 02:03:05 +02:00
New Pagodi
419a053b7d Change names of XXXIsSet variables in wxSTCListBoxVisualData
Instead name the variables useDefaultXXXColour since it more accurately
describes what purpose the variables are serving.
2019-04-20 12:38:29 -05:00
Artur Wieczorek
06d15be780 Notify wxPropertyGrid about selected property only if new page was selected
wxPropertyGridManager::DoSelectPage() returns true also if new page is
the same as the current one so we have to use alternative way to check
whether we really switched to the new page.
2019-04-19 22:24:00 +02:00
Artur Wieczorek
285bedc5e5 Always redraw wxPGProperty after changing its attribute
Because changing some attributes of the property affects the format
of displayed value so the property has to be refreshed whether its
attribute is set through wxPGProperty::SetAttribute()
or wxPropertyGridInterface::SetPropertyAttribute().

Closes #18388.
2019-04-19 22:23:34 +02:00
New Pagodi
9fc8642458 Merge branch 'stcpopup' of https://github.com/NewPagodi/wxWidgets into stcpopup 2019-04-19 10:12:29 -05:00
New Pagodi
9e2089e702 Apply more suggestions from code review
This commit removes an attempt to initially hide a frame which was
unnecessary since frames are initially hidden by defautlt, removes an
unncecessary destructor that only performed actions that would happen
anyway, and replaces a Freeze/Thaw pair with wxWindowUpdateLocker.
2019-04-19 09:55:41 -05:00
Stefan Csomor
26949ce886 Using ‚old‘ constant names, so that SDK 10.7 compilation is still possible 2019-04-19 10:48:54 +02:00
Stefan Csomor
f8bdd27164 Fixing warning when compiling against SDK < 10.14 2019-04-19 09:40:38 +02:00
VZ
a5a44e8bae
Apply suggestions from code review
Co-Authored-By: NewPagodi <NewPagodi@users.noreply.github.com>
2019-04-18 20:57:01 -05:00
Vadim Zeitlin
18afc4d3c1 Select a sans serif font for wxQt by default
Using QFont::AnyStyle could result in some completely inappropriate font
being chosen, try using QFont::SansSerif style hint to select a better
font by default.

Closes #18237.
2019-04-19 00:10:57 +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
Vadim Zeitlin
c65647130b Return 0 for wxSYS_CARET_ON_MSEC in wxGTK if appropriate too
For some reason, 7f10d1fa8a handled
wxSYS_CARET_ON_MSEC and wxSYS_CARET_OFF_MSEC differently in wxGTK, even
though it looks like they should be handled in exactly the same way.

Change the code to do this, which results in returning 0 for the former
setting if the caret doesn't blink at all, just as was already the case
for the latter one.

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

See #17629.
2019-04-18 18:05:10 +02:00
PB
e5d850d76c Improve returning wxSYS_CARET_* metrics in wxMSW
The documentation stated that (a) wxSYS_CARET_{ON|OFF}_MSEC  settings
were not supported on MSW and (b) if a setting was not supported a
negative value was returned. However, when calling
wxSystemSettings::GetMetric(wxSYS_CARET_{ON|OFF}_MSEC), not only the
method asserted but 0 was returned instead of a negative value.

Fix this by using the value returned by ::GetCaretBlinkTime() for
wxSYS_CARET_{ON|OFF}_MSEC.

The documentation for wxSYS_CARET_TIMEOUT_MSEC does not list any
platform limitations; however, attempting to obtain this value resulted
in an assert and 0 returned. Fix this by returning -1. Returning -1 may
not the be the ideal solution, but there is no value reserved for the
setting not being supported and the caret on MSW usually blinks.

Closes https://github.com/wxWidgets/wxWidgets/pull/1285
2019-04-18 17:11:20 +02:00
Maarten Bent
94907d3893 Do not limit label width in wxToolBar by control width
This removes irregular behaviour in setting the label of a control. Creating
a control with label now behaves the same as setting or changing the label
later on. And behaves the same as for other tools in the wxToolBar.

Closes https://github.com/wxWidgets/wxWidgets/pull/1289
2019-04-18 16:51:10 +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
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
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