Commit Graph

66061 Commits

Author SHA1 Message Date
Artur Wieczorek
d0a84a6266 Update some strings and labels to the more current values in propgrid sample 2019-04-21 23:39:36 +02:00
Artur Wieczorek
ac22b5924f Reduce the scope of local variables 2019-04-21 23:39:35 +02:00
Artur Wieczorek
fc7d8090cf Put header into separate line in wxPG dump in propgrid sample 2019-04-21 23:39:34 +02:00
Artur Wieczorek
ecb711d2b3 Remove obsolete code from propgrid sample
This is code for v3.x so it doesn't make sense to check version against v2.8.
2019-04-21 23:39:33 +02:00
Artur Wieczorek
f6e05f4ed9 Update documentation regarding wxPGProperty attributes
Add explicit notes which attributes are built-in and what it functionally means.
2019-04-21 23:39:33 +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
1ee97383f7 Make wxPG_COLOUR_HAS_ALPHA a built-in attribute
wxPG_COLOUR_HAS_ALPHA attribute is used only in wxSystemColourProperty (and derived properties) to set respective internal flag so it doesn't have to be stored in the property's attribute store.
2019-04-21 23:39:31 +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
Artur Wieczorek
76584e2d3c Use dedicated function to get rounded value of wxFloatProperty
wxFloatProperty::ValueToString() returns string representing value rounded with required precision so we don't need to retrieve wxPG_FLOAT_PRECISION attribute and do rounding on our own.
2019-04-21 23:39:29 +02:00
Artur Wieczorek
2898e8136a Cast to wxFileProperty* only once
Result of wxDynamicCast can be used directly, no need to cast once again in case of success.
2019-04-21 23:39:29 +02:00
Artur Wieczorek
9e71598dd1 Explicitly return Boolean value as declared 2019-04-21 23:39:28 +02:00
Artur Wieczorek
c5cdb66c82 Use dedicated function to retrieve Boolean value from wxVariant
GetBool() is dedicated for this purpose.
2019-04-21 23:39:27 +02:00
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
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