Commit Graph

72662 Commits

Author SHA1 Message Date
Vadim Zeitlin
2fbb40ab61 Remove RealizeScaleAndOrigin() call from wxMSWDCImpl::Clear()
It seems unnecessary here as this function doesn't change neither scale
nor the origin, so there should be no need to realize them neither.
2022-04-30 20:51:53 +01:00
Vadim Zeitlin
03b9be08de Remove useless casts to int from wxMSW wxDC::SetDeviceOrigin()
The variables are already of type int (== wxCoord).

No real changes.
2022-04-30 20:51:53 +01:00
Stefan Csomor
dc2ff0d6b4 wxOSX: Rewiring GetBestSize for single line text control again
see #22374
2022-04-30 20:34:28 +02:00
PB
97e126624e Show error message wxSVGBitmapEmbedHandler::ProcessBitmap()
Do not just silently fail in wxSVGBitmapEmbedHandler::ProcessBitmap()
when wxUSE_BASE64=0, use wxFAIL_MEG() to show why it failed.
2022-04-30 17:46:25 +02:00
PB
3f32bac284 Fix building wxSVGBitmapEmbedHandler when wxUSE_BASE64=0
Use guards for wxUSE_BASE64 in wxSVGBitmapEmbedHandler::ProcessBitmap()
and just return false there when wxUSE_BASE64=0.
2022-04-30 16:33:28 +02:00
PB
4ddaa9c0ce Fix building wxIniConfig when wxUSE_BASE64=0
Use guards for wxUSE_BASE64 just as wxConfigBase does.
2022-04-30 16:29:13 +02:00
Vadim Zeitlin
e0f7dca2b8 Improve best height of horizontally laid out wxListCtrl in wxMSW
It seems that ListView_ApproximateViewRect() always reserves space for
the horizontal scrollbar vertically, even when it isn't needed,
resulting in a lot of blank space remaining in horizontal wxListbook
(e.g. using "top" orientation) in the notebook sample.

So instead of adding extra space when the scrollbar is shown, remove it
when it is not shown.
2022-04-28 23:47:51 +01:00
Maarten Bent
dc5fe63cb2 Don't implement FromDIP and ToDIP in headers 2022-04-29 00:38:46 +02:00
Vadim Zeitlin
25e46d0a4d Improve wxListCtrl::MSWGetBestViewRect() fit
It looks like ListView_ApproximateViewRect() doesn't actually take the
borders into account and doesn't even take margins into account
correctly.

With this change, vertical wxListbook in the notebook sample doesn't
show any horizontal scrollbar and has symmetric margins around its
contents (whether it shows a vertical scrollbar or not) under both
Windows 7 and 10.
2022-04-28 23:38:40 +01:00
Stefan Csomor
74c0fe6dcc Serialize font style correctly in Mac wxNativeFontInfo
The style needs to be explicitly included in the serialized
representation as it's not necessarily part of the native font
description itself, but can be emulated using a transform matrix.

Also fix the font family handling by recreating the native font info
from the newly generated font.

Closes #22373.
2022-04-28 23:37:43 +02:00
Vadim Zeitlin
ebf5e8813e Show images added to its wxImageList later in wxListbook again
Fix a regression in 3.1.6 which resulted in not showing any images if
the associated image list was empty when it was associated with the
control, as HasImages() returned false in this case and so wxLC_ICON
style was not set.

The fix is to return true from HasImages() if we have image list even if
it is currently empty, as we can't know when (or if) it will become
non-empty and it's better to assume that it will be used (as nothing
really catastrophic should happen if it is not used, finally) rather
than not taking into account the images added to it later.

Closes #22364.
2022-04-28 17:24:58 +01:00
Stefan Csomor
5f7d4a70c2 Use "Courier New" and "Times New Roman" in wxOSX
macOS 12 doesn't provide "Courier" and "Times" fonts any longer, so use
their closest replacements "Courier New" and "Times New Roman" instead.

In addition to using them for our own default fonts, also map
user-provided fonts with the old names to the new ones, as in practice
quite a few applications specify these face names rather than relying on
wxFontFamily and it seems better to allow them to keep working correctly
under macOS 12+ rather than using a completely different default system
font when e.g. "Courier" is specified.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #22355.
2022-04-28 00:53:05 +02:00
Vadim Zeitlin
35a3bac439 Use wxObjectDataPtr in wxSharedClientDataContainer
This is slightly more economical, both at run-time and, maybe more
importantly, at compile-time than using wxSharedPtr that we don't really
need here, simple intrusive ref counting smart pointer is enough.
2022-04-28 00:47:19 +02:00
Vadim Zeitlin
e2a5c1ffc8 Don't provide wxSharedClientDataContainer::m_data accessors
This is not really necessary and breaks encapsulation of this private
method. It is enough to provide just a way to copy the data from another
object as this is all that the derived classes really need.
2022-04-28 00:36:40 +02:00
Vadim Zeitlin
de8877d3ee Make more ctors of wxGrid classes explicit
Don't allow nonsensical implicit conversion from int to
wxGridCellFloatFormat etc.

No real changes.
2022-04-28 00:30:44 +02:00
Vadim Zeitlin
5db2244bc8 Use wxString() rather than wxEmptyString in wxGrid classes
No real changes, just use default ctor for the default value of some
parameters.
2022-04-28 00:30:15 +02:00
Frode Roxrud Gill
f646e8b11c Allow cloning client data stored in wxGrid attributes etc
Add wxSharedClientDataContainer class storing ref-counted client data
and use it instead of plain wxClientDataContainer in wxGridCellAttr,
wxGridCellEditor and wxGridCellRenderer classes.

This allows to keep the same client data associated with many grid cells
without having to make many copies of it.
2022-04-28 00:28:58 +02:00
Vadim Zeitlin
3cc52285b6 Increase the last tested clang version to 14
It was tested for wxMSW (cross)compilation and also works for building
wxGTK under Linux.
2022-04-27 23:44:16 +02:00
Vadim Zeitlin
88e92a5f01 Don't imply that clang is not supported under MSW
It is, so remove "macOS and Linux" from its line.

Add maximum tested versions for it and gcc too, for consistency with
MSVC and because it can be useful to know.

See #22363.
2022-04-27 19:48:30 +02:00
Vadim Zeitlin
05014523bc Merge branch 'document_missing_webview_event' of https://github.com/swt2c/wxWidgets
More documentation fixes: inconsistent or missing declarations.

See #22366.
2022-04-27 19:45:16 +02:00
Vadim Zeitlin
e6abc4ca12 Update message catalogs after adding keyboard key context
See #22354.
2022-04-27 19:32:37 +02:00
Vadim Zeitlin
6935b831bd Merge branch 'messages-with-context' of https://github.com/lanurmi/wxWidgets
Add wxTRANSLATE_IN_CONTEXT() and use it in a few places, notably for the
key names.

See #22354.
2022-04-27 19:17:12 +02:00
DietmarSchwertberger
1b158caa83 Improve usability of wxGrid actions using mouse dragging
Implement auto scrolling and handle ESCAPE to cancel the actions done by
dragging the mouse, such as resizing or selecting an area.

Closes #22292.
2022-04-27 19:09:40 +02:00
Scott Talbert
1a531def4b Fix wxTextCtrl::OSXEnableNewLineReplacement documentation 2022-04-26 22:31:54 -04:00
Scott Talbert
db8eb640eb Document missing wxWebView events 2022-04-26 20:12:24 -04:00
Maarten Bent
6072d3aeee Add documentation for wxDC and wxGraphicsContext FromDIP and ToDIP
Remove documentation of removed function GetDPIScaleFactor.
2022-04-26 21:35:05 +02:00
Maarten Bent
fed52eb716 CMake: Mark Cairo and other module variables as advanced 2022-04-26 21:25:56 +02:00
Maarten Bent
d2366b2eb0 Fix printing at high DPI on GTK3 and when saving as postscript 2022-04-26 21:25:55 +02:00
Maarten Bent
2bab3e8d1c Remove wxWindow DPI from wxMemoryDC
wxMemoryDC is normally not associated with a wxWindow.
2022-04-26 21:25:55 +02:00
Maarten Bent
8665960c55 Simplify printing and drawing sample constructors
Don't use FromDIP for 0.
Include DIP in drawing sample variable and function names to make it clear these sizes are in DIP.
Show both logical and DIP coordinates in statusbar.
2022-04-26 21:25:55 +02:00
Maarten Bent
bb91534cb3 Use different method to get CGContextRef on Cairo renderer 2022-04-26 21:25:50 +02:00
Maarten Bent
77a61569a8 Restructure Cairo font initialization
Add some comments explaining why things are done.
2022-04-26 21:25:50 +02:00
Vadim Zeitlin
8245ba96ee Don't crash if invalid index is used with wxDataViewListCtrl
Use wxCHECK, not wxASSERT, for checking a critical precondition to
ensure that we don't crash if it's violated.

This fixes crashes in various wxDataViewListCtrl methods if they're
passed an invalid index different from wxNOT_FOUND.

Closes #22358.
2022-04-26 02:02:29 +02:00
Maarten Bent
a98104c1f0 Fix wxRichToolTipPopup size at non-system DPI displays
Move the popup to the display where it will be shown, so the size
calculations are based on the correct DPI.

Also adjust the tip size to the current DPI.

Closes #22361.
2022-04-25 22:16:21 +02:00
Stefan Csomor
d9ec9ab1f1 Use Cocoa native layout inset method
Don't hardcode inset sizes any longer.

This improves various issues under macOS 12, see #22134 and #22135 (but
doesn't fully fix the former problem yet).

Closes #22351.
2022-04-25 21:51:00 +02:00
Maarten Bent
bf4e45fc67 Fix Cairo DPI when no wxWindow is associated
Always multiply with the content scale factor, also on macOS.
2022-04-24 18:47:50 +02:00
Maarten Bent
deaa43e32d CMake: Remove workaround for removing png headers from cairo
CAIRO_INCLUDE_DIRS does not include them with the current FindCairo.cmake.
2022-04-24 18:47:43 +02:00
Lauri Nurmi
180b8e5183 Mark system cursor names translatable in a context, and do get translation
It looks like wxGetTranslation() was not actually called for these strings
earlier, so do call it.

The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.
2022-04-24 11:30:31 +03:00
Lauri Nurmi
3396a40015 Mark keyboard key names translatable in a specific context
Many key names are short and commonly used words; e.g. "Delete", "Left",
"Right", "Pause", "Menu", "End".

It is not at all unlikely that such words could be used in a completely
different meaning elsewhere in the code. That is why this list of
keys should be assigned a context.

The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.
2022-04-24 11:30:31 +03:00
Lauri Nurmi
e3bf759615 Add wxTRANSLATE_IN_CONTEXT() macro for marking strings for translation
Similarly to wxTRANSLATE(), this macro does not do much itself.
2022-04-24 11:30:31 +03:00
Vadim Zeitlin
5d5591816d Update to bakefile 0.2.13 to fix DLL directory creation
Fix the bug introduced in ec0734f96f (Install DLLs in bindir, not
libdir, when using MSW toolchains, 2021-01-09): the directory where the
DLLs were installed wasn't created any more, resulting in errors if it
didn't exist.

Update to latest bakefile version adding the missing mkdir command to
fix this and also use a released bakefile version for the wx makefiles.

Regenerate configure to match the new version.

See #14601.
2022-04-23 23:11:31 +02:00
Vadim Zeitlin
5f469f481a Merge branch 'wxwidgets.org-tests'
Don't fail CI if wxwidgets.org is not available or behind Cloudflare
proxy.

See #22350.
2022-04-23 20:37:00 +02:00
Vadim Zeitlin
da05a3770f Use address of www.wxwidgets.org instead of its name in HTTP URLs
The name resolves to Cloudflare proxy which redirects all HTTP URLs to
HTTPS, which breaks the existing tests using HTTP, so prevent this from
happening by using the actual IP address instead.
2022-04-23 18:03:25 +01:00
Vadim Zeitlin
9c4fe82242 Cache the results of network availability check
It's unlikely to change while the tests are running, so don't redo it
needlessly.
2022-04-23 17:55:24 +01:00
Vadim Zeitlin
239bbd6b82 Check that we can actually read from network and not just connect
When using Cloudflare, as we do for www.wxwidgets.org, the connection
succeeds as long as Cloudflare itself works, but reading later fails if
the real server behind Cloudflare proxy does not, so check if we can
read something from it.
2022-04-23 17:55:24 +01:00
Uwe Runtemund
28f62b2e59 Add support for creating wxBitmapBundle from wxIconBundle
This is useful for converting existing code using wxIconBundle for
similar purposes to switch to using wxBitmapBundle instead.

Closes #22347.
2022-04-23 17:31:46 +02:00
Vadim Zeitlin
860dd39fab Check connection to www.wxwidgets.org and not www.google.com
Our tests use the former and not the latter, so check connection to the
site we're actually interested in.
2022-04-23 16:16:01 +01:00
Vadim Zeitlin
668563f2b0 Rewrite ImageTestCase using CATCH macros
Get rid of the ugly WX_ASSERT_MESSAGE() and also use REQUIRE/CATCH
directly instead of CppUnit compatibility macros.

Also use sections to execute the next loop iteration(s) even if the
current one fails.

This commit is best viewed ignoring whitespace-only changes.
2022-04-23 16:08:14 +01:00
Vadim Zeitlin
89a7a070ea Use WARN() instead of wxLogWarning() in the unit tests
The latter isn't shown at all by default while the former one is.
2022-04-23 15:36:40 +01:00
Vadim Zeitlin
684dd4a5a6 Use wxScopedPtr in wxImage unit test
Don't manage memory manually, this resulted in error leaks if any checks
failed.
2022-04-23 15:35:22 +01:00