Commit Graph

39762 Commits

Author SHA1 Message Date
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
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
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
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
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
785c448870 Fix checking size of security URL in wxWebviewIE
Allows to utilize the entire buffer when necessary.
2020-07-28 21:22:21 +02:00
Maarten Bent
43f84a9c18 Use security URL from wxWebViewHandler in wxWebViewIE
Don't use hard-coded 'http://localhost', but use the URL specified in the
wxWebViewHandler.

By default, the security URL is empty and no modifications are made when
parsing a URL. This fixes using JavaScript in pages loaded with a custom
protocol, e.g. from wxWebViewFSHandler or wxWebViewArchiveHandler.

Closes #17893
2020-07-28 21:22:21 +02:00
Maarten Bent
bcadef5e2c Remove obsolete VirtualProtocol IID table
The IIDs are now checked inside VirtualProtocol::QueryInterface.
2020-07-28 21:19:28 +02:00
Maarten Bent
0885057b70 Fix typo in wxWebViewIE failure message 2020-07-28 21:19:28 +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
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
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
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
Vadim Zeitlin
8e126d2cd6 Don't call RefreshRect() with negative size in wxGrid code
Don't bother trying to refresh areas beyond the visible part of the
window: not only it's useless, but it also results in debug warnings
from Cairo/pixman due to the use of negative rectangle width/height.

Closes #18848.
2020-07-23 16:21:42 +02:00
Vadim Zeitlin
0d18e12e79 Avoid -Wconversion-null from MinGW-w64 in wxListBox code
Explicitly cast the pointer to LPARAM instead of implicitly casting NULL
to it.

No real changes.
2020-07-23 16:21:30 +02:00
Vadim Zeitlin
cd2cd6a617 Avoid using IE-related symbols not present in old MinGW headers
Define INET_E_DEFAULT_ACTION ourselves and provide stand-ins for the
enums not present in MinGW SDK.

See #17893.
2020-07-21 22:44:49 +02:00
Vadim Zeitlin
e77bba1a42 Update linpng submodule to fix a build problem under iOS
See https://github.com/wxWidgets/libpng/pull/1
2020-07-21 22:32:50 +02:00
Vadim Zeitlin
56177cb5a3 Merge branch 'osx-dpi'
DPI-related improvements in wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/1984
2020-07-21 20:24:09 +02:00
Paul Cornett
44a75afe93 Make sure toplevel is active in SetFocus(), episode 2
Toplevel must be active for child to actually receive focus
See #18783
2020-07-21 08:44:57 -07:00
Vadim Zeitlin
a8bb796f8c Add OSXMakeDPIFromScaleFactor() helper
No real changes, just avoid repeating wxRound(scaleFactor*72) in several
places and do it in this single function instead.
2020-07-21 17:16:15 +02:00
Vadim Zeitlin
a2c55fa834 Include wx/math.h in the file using wxRound()
Although it seems to be already included from some other header
implicitly, prefer to also include it explicitly to avoid any breakage
later.
2020-07-21 17:16:15 +02:00
Vadim Zeitlin
af7a6ed2d0 Combine variable declaration and test in a single line
No real changes, make the code slightly shorter.
2020-07-21 17:16:15 +02:00
Stefan Csomor
984e222519 Fix content scale factor returned by wxScreenDC on Mac 2020-07-21 17:16:15 +02:00
Stefan Csomor
1deb003a7c Propagate wxEVT_DPI_CHANGED to child windows in wxOSX too 2020-07-21 17:16:15 +02:00
Stefan Csomor
668f0e7c54 Implement wxWindow::GetDPI() on macOS and iOS 2020-07-21 17:16:15 +02:00
Stefan Csomor
fa58dc2c45 Generate wxEVT_DPI_CHANGED event under Mac 2020-07-21 17:16:15 +02:00
Stefan Csomor
e93e9558f4 Fix change the shaped of a shaped window under Mac
The shape path was not reset when another region shape was set, so add
a workaround to trigger a recalculation of the TLW’s outer shape.

Closes #18775.
2020-07-21 15:43:44 +02:00
Stefan Csomor
d58e3e3ce6 Fix returning wrong client size for some controls in wxOSX
Make sure we are not neglecting the layout insets, for controls like
button, choice and gauge, otherwise client sizes became larger than
control sizes.

Closes #18717.
2020-07-21 15:42:10 +02:00
Stefan Csomor
d7d7505974 Fix generating mouse (and other) events in wxOSX wxStaticBitmap
Use custom subclass for native static bitmap, to ensure that we call
wxOSXCocoaClassAddWXMethods() for it.

This notably allows to get mouse click events for this control.

Closes #18545.
2020-07-21 15:39:41 +02:00
Stefan Csomor
b57fdc4ff6 Invalidate wxDisplay cache on monitor [dis]connection under Mac
Avoid returning outdated information from wxDisplay methods if the
system configuration changes.

Closes #18318.
2020-07-21 15:38:58 +02:00
Paul Cornett
83f1df7b6b Avoid -Wsign-compare warning 2020-07-20 12:17:21 -07:00
Paul Cornett
f0cf9401b0 Avoid Gtk-CRITICAL "gtk_widget_get_toplevel: assertion 'GTK_IS_WIDGET (widget)' failed"
Happens when running the tests
2020-07-20 10:23:52 -07:00
Jouk
516aed372b Suppress warnings on OpenVMS 2020-07-20 16:24:27 +02:00
Jouk
b1270ef87d Suppress warnings on OpenVMS 2020-07-20 16:23:52 +02:00
Vadim Zeitlin
2f450733d4 Merge branch 'dpi-scaling-factor'
Add DPI scaling factor and revert content scaling factor behaviour in
wxMSW and other ports not using logical pixels to be 3.0 compatible.

See https://github.com/wxWidgets/wxWidgets/pull/1985
2020-07-20 15:55:23 +02:00
Vadim Zeitlin
4dd009136c Merge branch 'aui-auto-uninit'
Call wxAuiManager::UnInit() automatically.

Closes #14145.
2020-07-20 15:49:05 +02:00
Vadim Zeitlin
4552009805 Merge branch 'pr1312-no-unsafe-wxstring-conv'
Add a way to optionally disallow all implicit conversions between
wxString and "const char*".

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

See #18113.
2020-07-20 15:47:17 +02:00
Vadim Zeitlin
4beccf8883 Revert "Make sure toplevel is active in SetFocus()"
This reverts commit d06e97e8d9 as it
resulted in regression in wxSplitterWindow behaviour.

See #18783.

Closes #18845.
2020-07-20 15:43:43 +02:00
Stefan Csomor
818f8fe1d6 macOS: fixing wxImage generation from wxBitmap
after 992b594c15 the byte value for ‚masked‘ changed, adapt this accordingly, see https://trac.wxwidgets.org/ticket/18775
2020-07-20 11:05:17 +02:00