Commit Graph

66409 Commits

Author SHA1 Message Date
Artur Wieczorek
fcc961b379 Reset the flag only if it is necessary 2019-04-21 23:39:26 +02:00
Artur Wieczorek
e6e8f45051 Fix setting wxPG_PROP_STRING_PASSWORD attribute
For built-in attributes (like wxPG_PROP_STRING_PASSWORD) wxPGProperty::DoSetAttribute() should return true to give the option (controlled by wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES style) to prevent the attribute from being stored into property's attribute storage.
2019-04-21 23:39:26 +02:00
Artur Wieczorek
01e21b4f38 Use predefined constants to represent wxPGProperty attribute identifiers
Use predefined constants representing attribute identifiers instead of specific strings.
2019-04-21 23:39:25 +02:00
Vadim Zeitlin
aeef082e47 Update year in various copyrights to 2019
This is the equivalent of c8b6ca308b for
2019, except that it was produced by running misc/scripts/inc_year and
not manually now.

See https://github.com/wxWidgets/wxWidgets/pull/1302
2019-04-21 20:39:28 +02:00
Vadim Zeitlin
0a81d7eb8b Add a script to update copyright years
Now we just have to not forget to run it every year in January.

See https://github.com/wxWidgets/wxWidgets/pull/1302
2019-04-21 20:37:44 +02:00
Vadim Zeitlin
8d7f97a141 Refactor inc_release script to allow reusing parts of it
No real changes, just extract the useful helpers from this script into
another file.
2019-04-21 20:26:07 +02:00
Vadim Zeitlin
f28224dfad Avoid infinite loops when decoding fails in wxTextInputStream
wxTextInputStream::ReadLine() must set stream error to indicate to the
caller that it failed to decode its input, otherwise there is no way to
know about the error and the caller risks to keep calling ReadLine()
forever, as it happened in ReadAll() helper used by wxExecute(), for
example.

See #18382.
2019-04-21 20:10:49 +02:00
Vadim Zeitlin
7d3687f515 Restore wxConvAuto in wxTextInputStream used by wxExecute()
This reverts commit a05ae051d8 and allows
to correctly decode UTF-8 output of child processes again.

Also add a (disabled by default) test allowing to verify that this does
work now.

Closes #14720, #18382.
2019-04-21 20:10:30 +02:00
Vadim Zeitlin
731b3a804f Return error from wxConvAuto if not given enough bytes
Instead of falling back on Latin-1 if we fail to decode the input as
UTF-8, check if we have enough bytes for the latter and just return an
error if we don't.

This ensures that wxTextInputStream::GetChar() and similar code will
retry with a longer byte sequence, allowing wxConvAuto to be used for
decoding UTF-8 contents on the fly, which didn't work before.

See #14720.
2019-04-21 20:05:37 +02:00
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
Vadim Zeitlin
807d95e07d Add wxEVT_COLOURPICKER_CURRENT_CHANGED and DIALOG_CANCELLED events
Send events from generic wxColourPickerCtrl when the currently selected
colour in the dialog shown by it changes and when this dialog is
cancelled.

Notice that currently this only works on wxMSW as it relies on
wxEVT_COLOUR_CHANGED support in wxColourDialog which is only available
there.

Based on work of Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
2019-04-21 01:53:14 +02:00
Vadim Zeitlin
35c16935f1 Send wxEVT_COLOUR_CHANGED from wxColourDialog under MSW
Add support for a new event sent by wxColourDialog, currently only under
MSW, when the colour currently selected in it changes.

Based on work by Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
2019-04-21 01:53:14 +02:00
Vadim Zeitlin
5b7114b4d7 Send correct event directly from wxGenericColourButton
Instead of sending wxEVT_COLOURPICKER_CHANGED event from the button
itself and then catching it in wxColourPickerCtrl and resending an event
from the control from there, just send the event originating from the
correct object directly.

This allows to slightly simplify the code and will be especially useful
for other events, to be added in the upcoming commits, to avoid having
to write the same forwarding code for all of them.
2019-04-21 01:53:14 +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
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