Commit Graph

68973 Commits

Author SHA1 Message Date
Stefan Csomor
08a63c3b49 use common contentScaleFactor also for DPI on macOS
and give a reasonable default for missing tlw
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
c346fd0321 Show scale factor in the display sample too
Show it for consistency with all the other wxDisplay accessors and to
make it simpler to test its return value.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
434faa39e6 Remove unused wxDisplayImpl::GetSizeMM()
This is not needed any longer after the changes of the last commit.

Note that the (still existent) public wxGetDisplaySizeMM() didn't use
this function, but used PPI instead.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
bcb101b9e9 Simplify PPI and scale factor handling in wxDisplay
Don't try computing the PPI ourselves from the physical size and the
number of pixels, this doesn't work and nobody else does it like this.

Just assume that we're using standard PPI by default and use
toolkit-specific functions for the platforms with support for high DPI.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
4e6df3f7b2 Implement GetDPIScaleFactor() more directly for wxMSW too
Use the existing GetDPI() implementation instead of forwarding to
wxDisplay.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
6a820a8f9a Implement GetDPIScaleFactor() more efficiently in wxGTK
Don't pass via wxDisplay, but use gtk_widget_get_scale_factor() (almost)
directly instead.
2020-08-15 00:28:32 +02:00
Stefan Csomor
99f7c8f3a4 using common method for determining scale from displayID 2020-08-15 00:28:32 +02:00
Stefan Csomor
7dc67a1f9f making GetDPIScaleFactor virtual, adding macOS direct impl 2020-08-15 00:28:32 +02:00
Stefan Csomor
8bad3b5e80 macOS clientRect implementation for non-primary displays 2020-08-15 00:28:32 +02:00
Stefan Csomor
d5180d3604 add a GetFromWindow implementation to wxDisplayFactory
on displays with different resolutions we must make sure we pick one that matches the frame’s contentScale
2020-08-15 00:28:32 +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
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
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
Paul Cornett
5e89d575c3 Correction for previous change to wxBitmap scaling in Blit()
Destination wxMemoryDC context is already scaled
2020-07-28 11:35:53 -07:00
Paul Cornett
2b9499d7a7 Preserve wxBitmap scaling in Blit() with wxMemoryDC on GTK3
See #18857
2020-07-28 00:03:15 -07:00
Stefan Csomor
8df97af5fe detailing requirements for macOS a little more 2020-07-26 22:17:15 +02:00
Stefan Csomor
bb40699675 macOS bugfix: overrelease in wxGetAvailableDrives
as these strings are NSStrings retrieved by autoreleasing methods, they must be retained first
2020-07-26 11:37:55 +02:00
ali kettab
30e5ff87a4 the assertion was mistakenly placed in the wrong place 2020-07-25 18:09:55 +01:00
ali kettab
b1c83920b5 fix typo 2020-07-25 16:09:50 +01:00
ali kettab
ad68515d52 cleanup a wxTextCtrl leftover from SpinCtrlTest 2020-07-25 14:59:31 +01:00
ali kettab
852f817291 Get rid of redundant call to wxDELETE (no real change) 2020-07-25 12:34:25 +01:00
ali kettab
247ee328b3 remove workaround from BitmapComboBoxTestCase 2020-07-25 12:14:42 +01:00
Vadim Zeitlin
a1774fcc4e Merge branch 'cmake-header-test-and-warnings' of https://github.com/MaartenBent/wxWidgets
Add test for headers compilation with wxNO_IMPLICIT_WXSTRING_ENCODING to
CMake and a couple of warning fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1993
2020-07-24 14:13:56 +02:00
Vadim Zeitlin
3ebed58d1a Merge branch 'webview_test_skip' of https://github.com/swt2c/wxWidgets
Skip tests not working for WebKit 2 and re-enable web view in Travis CI
wxGTK3 build.

See https://github.com/wxWidgets/wxWidgets/pull/1994
2020-07-24 14:11:17 +02:00
Scott Talbert
64b7406ede Re-enable webview on GTK3 Travis build 2020-07-23 21:52:45 -04:00
Scott Talbert
957842946e Skip tests for functions unsupported on WebKit2 2020-07-23 21:49:14 -04:00
Vadim Zeitlin
bb3177dd3b Avoid infinite repaint loop in wxListCtrl with wxLC_HRULES
A virtual wxListCtrl with wxLC_HRULES which wasn't fully visible on
screen, i.e. didn't fit into the visible area of its parent window
(which included the case when the parent was a wxScrolledWindow, for
which it is normal and expected not to be able to fit all of its
children) got into an infinite repaint loop because of a RefreshRect()
call inside wxListCtrl::OnPaint().

Fix this by avoiding to call RefreshRect() added in 374db28747 (Fix
wxMSW ListCtrl drawing of horizontal rules for new items, 2016-05-04),
unless the current clipping rectangle is less than the actually
effective visible width and not the full client width, which can be much
bigger.

This still doesn't ensure that we don't enter into an infinite recursion
here, so it would be even better to call RefreshRect() at most once
before the next control change, but it's not clear when exactly this
"already refreshed" flag would need to be reset.

See #17158.

Closes #18850.
2020-07-24 02:06:42 +02:00
Maarten Bent
2aadfd882a Fix unused private field warnings in Forty demo
Fix drawing score list without wxUSE_GRID.
2020-07-23 22:55:10 +02:00
Maarten Bent
ea102bb272 Add missing wxOVERRIDE to wxNonOwnedWindow::Reparent 2020-07-23 22:55:10 +02:00
Maarten Bent
b5737510fd Fix warning C4193: no matching pragma pop and push
Mention wx/dvrenderers.h in the exclude list, as described in PR1312.
2020-07-23 22:55:09 +02:00
Maarten Bent
e9ce104e4a CMake: add headers test 2020-07-23 20:30:36 +02:00
Paul Cornett
6f968105b5 Avoid -Wwrite-strings warning 2020-07-23 10:29:43 -07:00
Vadim Zeitlin
6787b0548b Merge branch 'webview-ie-fixes'
IE-based xwWebView improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1987
2020-07-23 16:39:13 +02:00