Commit Graph

69199 Commits

Author SHA1 Message Date
Vadim Zeitlin
5a27ea9a86 Merge branch 'fix_grid_deselect' of https://github.com/swt2c/wxWidgets
Fix regression in wxGrid::DeselectRow() and wxGrid::DeselectCol() and
add unit tests for them.

See https://github.com/wxWidgets/wxWidgets/pull/2017
2020-08-14 19:27:48 +02:00
PB
a4647825cb Do not use wxRegEx in wxCmpNaturalGeneric()
Using wxRegEx in wxCmpNaturalGeneric() introduced a dependency of the
base library on the regex library.

Replace wxRegEx with character classification functions wxIsspace(),
wxIspunct(), and wxIsdigit() to remove this rather unnecessary
dependency.

Closes https://github.com/wxWidgets/wxWidgets/pull/2014
2020-08-14 19:26:33 +02:00
Vadim Zeitlin
8e2aad2621 Merge branch 'webview_ie-js' of https://github.com/MaartenBent/wxWidgets
Fix using JavaScript in wxWebViewIE with custom scheme.

This repairs a regression in 3.1.4 due to the changes of 6787b0548b
(Merge branch 'webview-ie-fixes', 2020-07-23).

See https://github.com/wxWidgets/wxWidgets/pull/2004
2020-08-14 19:23:27 +02:00
Teodor Petrov
90082b002d Fix configure errors when using GTK 2 and ASAN
Memory leaks in the test programs run by configure when using GTK 2
result in configuration failures when using -fsanitize=address in
{CXX,LD}FLAGS, so fix these leaks to allow configuring using
"CXXFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address" together with
--with-gtk=2 (this already worked correctly with the default GTK 3).

Closes https://github.com/wxWidgets/wxWidgets/pull/2001
2020-08-14 19:19:46 +02:00
Teodor Petrov
c924ecb10a Suppress -Wsuggest-override warnings in user code for gcc too
This was already done for clang -Winconsistent-missing-override, but
gcc has a similar warning since 5.1 and, moreover, latest versions of
clang support this gcc warning as well, so add a special macro which
handles both compilers and use it in all wx macros defining virtual
functions instead of just disabling one of the clang warnings.

Closes https://github.com/wxWidgets/wxWidgets/pull/2000
2020-08-14 19:15:03 +02:00
Stefan Csomor
16ff1f8f7c macOS Implementation for wxDisplay::GetScaleFactor 2020-08-14 16:09:27 +02:00
Vadim Zeitlin
f572797965 Use wxDisplay::GetScaleFactor() in wxWindow::GetDPIScaleFactor()
This can be more direct and efficient than computing the ratio of DPIs
in wxWindow.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
19fd0fcfd7 Add wxDisplay::GetScaleFactor()
This is conceptually the same as the ratio of the current DPI to the
standard one, but can be implemented more directly for wxGTK3 and wxOSX
(although the latter doesn't implement it yet).
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
e902050002 Return "logical" PPI from wxDisplay::GetPPI() in wxGTK3
Just scale the standard PPI by the scaling factor instead of trying to
compute the actual physical PPI, as the latter is not useful and is
incompatible with the value used by all the other applications.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
52b25211c8 Add wxDisplay::GetStdPPIValue() and GetStdPPI()
Provide public way to access the default platform DPI, which was
previously a constant private to src/common/wincmn.cpp.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
19db07d668 Fix broken MSW tags generation script
Add "--recursive" option which is needed since the changes of 37cf80240b
(Exclude unwanted files in wxMSW tags script, 2020-01-31) as otherwise
no files were parsed at all.
2020-08-14 15:55:41 +02:00
Vadim Zeitlin
c80e529021 Fix crash when destroying wxPopupWindow without hiding it first
The global wxCurrentPopupWindow used by wxMSW wasn't reset in this case
and resulted in a crash during the next mouse or focus event.

Do it in wxPopupWindow dtor now, and not just when the popup is hidden.
2020-08-14 13:15:49 +02:00
Vadim Zeitlin
bb93682a87 Improve wxGrid selection test slightly
Check that deselecting a row leaves the cells outside of this row
selected.

This requires passing "true" to the previous call of SelectRow() to
prevent it from clearing the existing selection, as it does by default.
2020-08-14 12:41:10 +02:00
Vadim Zeitlin
4475df8264 Add unit tests for wxGrid::Deselect{Row,Col}()
These functions got broken by the changes of cdf3187fe5 (Improve rows,
columns and cells deselection in wxGrid, 2020-03-26), but this went
unnoticed because they were not covered by the unit tests, so add the
tests for them to prevent this from happening again in the future.
2020-08-14 12:36:46 +02:00
Scott Talbert
9be1f86ca0 Fix regression in wxGrid::DeselectRow() and wxGrid::DeselectCol() 2020-08-13 20:01:45 -04:00
Vadim Zeitlin
e96155fece Fix and improve wxDC background mode documentation
Use wxBRUSHSTYLE_SOLID/TRANSPARENT constants instead of wxPENSTYLE_XXX
ones, as even though they have the same values, using brush style for
the background makes more sense.

Also document that the default background mode is transparent.
2020-08-13 23:08:58 +02:00
Vadim Zeitlin
d3cab1bd54 Don't document wxImageList::Replace() as being MSW-only
This method is implemented in the generic version used under the other
platforms as well, but was documented as being MSW-only in 89bb3f0244
(interface revisions, 2008-10-17) for some reason.

Just remove the note added by that commit.
2020-08-13 21:57:18 +02:00
Artur Wieczorek
9018d74e99 Use stock wxBrush
Instead of using dynamically created brushes (implicitly from stock colours)
we should use corresponding stock brushes because once created they are
stored in the cache what can slightly improve performance.
2020-08-08 21:58:14 +02:00
Artur Wieczorek
3d469f3234 Draw shape mask with antialiasing disabled
We need really B/W bitmap to create a mask so antialising should be disabled
in case.
2020-08-08 21:52:13 +02:00
Stefan Brüns
3f9531fe31 Use local static variable for ArtID mapping table
The instantiation of the global static mapping table may happen before
the instantiation of the wxArtIds, i.e. the copy-constructor would
access not yet valid wxArtId/wxString instances.

Delay the instantiation until the first call to wxArtIDToStock call.
This is still not 100% safe, as wxArtIDToStock may be called by a
constructor of a static instance, but hopefully nobody does that.
2020-08-08 12:44:48 +02:00
Vadim Zeitlin
884d2ffd32 Merge branch 'misc-fixes' of https://github.com/MaartenBent/wxWidgets
Enable using PIC by default even for static libraries and several other
build-related fixes (warning fixes etc).

See https://github.com/wxWidgets/wxWidgets/pull/2008
2020-08-08 02:01:06 +02:00
Vadim Zeitlin
f71fbd93b7 Correct documentation of wxUSE_UNICODE-related settings
wxUSE_UNICODE_UTF8 is not default anywhere since a long time.

Also mention that wxUSE_UNICODE==0 build is already deprecated and will
be dropped in the future.
2020-08-07 13:34:46 +02:00
Maarten Bent
4ee04daa7c Enable position independent code by default
Add a build option (--disable-pic, wxBUILD_PIC=OFF) to disable it.

Note that it is always enabled for shared libraries and static third party libraries.
2020-08-06 21:43:41 +02:00
Arrigo Marchiori
f3bd129568 Append WX_FLAVOUR to the name of wxrc executable 2020-08-06 14:03:26 +02:00
Stefan Brüns
128e3ff123 Make the wxART_* constants const wxStrings with static storage duration
The pre-3.1.4 definitions of the constants were just string literals,
while the type were wxString typedefs. To avoid implicit conversion
these were converted to actual wxStrings.

While the interface now matched the implementation, this has several
drawbacks:
- every use of the "constant" now is a string construction at runtime
- the constant now is an rvalue, i.e. it is impossible to take its
  address.

The latter breaks its use from wxPython.

The IDs are moved to a separate file which can be included multiple
times, once from the header to have the declarations in place, and once
to instantiate the wxStrings. Using a common file avoids the declaration
and definition going out of sync.
2020-08-06 12:31:37 +02:00
ali kettab
2256dac384 Enable wxSlider "Thumb" unit test under GTK too
This was disabled, but only didn't work because wxSlider used tiny size
in wxGTK by default previously. After correcting this in aa2d159e8c (Use
more reasonable length for wxSlider in wxGTK by default, 2020-08-04),
the unit test passes with wxGTK too and can be reenabled.

Closes https://github.com/wxWidgets/wxWidgets/pull/1992
2020-08-05 22:46:04 +02:00
Vadim Zeitlin
aa2d159e8c Use more reasonable length for wxSlider in wxGTK by default
Use the same 100 DIPs as in wxMSW, to make the default behaviour more
useful.

Also update documentation to explain which size component should, and
should not, be specified when creating the slider.

Closes https://github.com/wxWidgets/wxWidgets/pull/2012
2020-08-05 00:01:50 +02:00
Hertatijanto Hartono
c695c419d1 Utilise GetZoomFactor() in webview sample
Show example of using GetZoomFactor().

Closes https://github.com/wxWidgets/wxWidgets/pull/1999
2020-08-03 23:58:19 +02:00
Maarten Bent
3328480f78 CMake: use set_target_properties() instead of set_property(TARGET ) 2020-08-03 21:35:13 +02:00
Maarten Bent
6327ab4e5e CMake: link with javascriptcoregtk-4.0 when building static library 2020-08-03 21:35:13 +02:00
Maarten Bent
c2a7e6c946 Fix unused-variable warning in wxListCtrl code 2020-08-03 21:35:13 +02:00
Maarten Bent
5bd35f6c85 Fix unused-function warning in wxSockAddressImpl code 2020-08-03 21:34:45 +02:00
Maarten Bent
81a5efb6ab Fix implicit-int-float-conversion warning in bombs demo 2020-08-03 21:34:45 +02:00
Maarten Bent
3c368408fb CMake: use dedicated function to check function availability 2020-08-03 21:34:44 +02:00
Maarten Bent
cc12eafc34 CMake: fix name clash between folder and application
The test_gui project copies some resource files into image and drawing folders,
so don't use the same name for the sample applications.
2020-08-03 21:33:37 +02:00
Maarten Bent
f25a88a13d CMake: allow to use build-in libraries on Linux
Requires updates of expat and tiff submodules.

Most libraries have their own CMakeLists, add a comment with a suggestion to
use this for implementing build-in support.
2020-08-03 21:33:37 +02:00
Maarten Bent
4cab673556 Make sure generated wxSTC files have LF EOL
Use 'wb' with Python 2 to enforce LF newlines. This does not work with
Python 3, use 'newline':'\n' there (which in turn does not work with 2).
2020-08-03 21:33:33 +02:00
Maarten Bent
755afd9d1b Fix typos in wxSTC interface 2020-08-03 21:32:52 +02:00
Paul Cornett
b1729ed8a0 Improve our estimate of wxNotebook page size with GTK 2020-08-03 10:36:38 -07:00
Maarten Bent
590e32c60b Fix building with wxUSE_STL enabled in VS2019 16.6
Exporting standard C++ library types is not allowed any more, see

https://developercommunity.visualstudio.com/content/problem/1042081/142628801includexhash201332-error-c2338-this-funct.html

so don't use DLL export declarations for wxHash{Map,Set} classes, which
derive from std::{map,set}.

Since the classes are header-only, this should have no direct
consequences. Only classes that extend wxHashMap or wxHashSet, like
wxImageHistogram, have to be made header only as well.

Remove the wxLogError message in wxImageHistogram::FindFirstUnusedColour, so
log.h and translation.h do not have to be included in the header.

Closes https://github.com/wxWidgets/wxWidgets/pull/2009
2020-08-03 12:54:35 +02:00
Vadim Zeitlin
5aa1f4e953 Merge branch 'dpi-colour' of https://github.com/MaartenBent/wxWidgets
Make wxGenericColourButton and wxGenericColourDialog DPI aware.

See https://github.com/wxWidgets/wxWidgets/pull/2006
2020-08-03 00:49:56 +02:00
Vadim Zeitlin
c1c74c9ea5 Merge branch 'dpi-manifest-gui' of https://github.com/MaartenBent/wxWidgets
Only embed manifest in GUI applications (and not the libraries
themselves or console utilities, tests and samples).

See https://github.com/wxWidgets/wxWidgets/pull/2003
2020-08-03 00:45:15 +02:00
Vadim Zeitlin
f19b3f6586 Merge branch 'test-test' of https://github.com/AliKet/wxWidgets
Minor cleanups for the tests.

See https://github.com/wxWidgets/wxWidgets/pull/1998
2020-08-03 00:26:43 +02:00
Paul Cornett
bd835ee452 Fix a sizing/layout problem with GTK3
Relying on "check-resize" to detect when a "size-allocate" is in progess is
insufficient, resulting in the possibility of a window ending up with the wrong
size or position after inital layout. Using our existing "size-allocate"
handlers should be enough to detect the cases we care about.
See #18865
2020-08-01 21:23:34 -07:00
Maarten Bent
b10ba803f5 Make wxGenericColourDialog DPI aware 2020-07-31 22:25:10 +02:00
Maarten Bent
9e2615ac06 Move creating custom bitmaps of wxGenericColourDialog into separate function 2020-07-31 22:25:08 +02:00
Maarten Bent
a54b4073f9 Remove unused members from wxGenericColourDialog 2020-07-31 22:25:04 +02:00
Maarten Bent
4f09f83597 Make wxGenericColourButton DPI aware 2020-07-31 22:25:02 +02:00
Maarten Bent
53a2c8c7fb Rebake after manifest changes 2020-07-31 01:53:43 +02:00
Maarten Bent
40724c4963 Only embed manifest in GUI applications 2020-07-31 01:53:40 +02:00