Commit Graph

72393 Commits

Author SHA1 Message Date
Vadim Zeitlin
9c4e75a95e Merge branch 'wxlogo-svg-optimize-viewbox' of https://github.com/MaartenBent/wxWidgets
Optimize and adjust wxlogo.svg.

Also fix icon size in wxDataViewCheckIconTextRenderer.

See #22204.
2022-03-19 22:56:07 +01:00
Lauri Nurmi
4cf335340c Test the end iterator set by Parse{Date,Time,DateTime}()
In other words, check that the unprocessed part of the input is what
we expected.

Also add some cases where a valid date or time is followed by something.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
1c33294cf5 Add debugging check for using possibly incorrect DPI in wxMSW
When calling GetDPI() for a window which is not created itself yet and
doesn't have any valid top level parent neither, we have no choice but
to fall back on using the screen DPI, but this doesn't always work
correctly for the systems using multiple monitors with different DPIs,
so warn when this happens -- any situations when it does indicate a
potential bug that should be fixed.

See #22193.
2022-03-19 22:56:07 +01:00
Lauri Nurmi
23b8ec6d9a Test ParseRFC822Date() with truncated time zone specifiers 2022-03-19 22:56:07 +01:00
Vadim Zeitlin
2991c3e78a Remove useless wxTabFrame members initialization
It doesn't make sense to use some hardcoded size for these fields and
we can't use FromDIP() for wxTabFrame which is not a real window (as
it's never created, it doesn't have a valid HWND under MSW, so FromDIP()
can't return the correct result for it), so don't initialize them at
all: they will be set later, before they're actually used, by the code
in wxAuiNotebook using wxTabFrame.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
104b8461d8 Remove premature wxAuiNotebook::m_tabCtrlHeight initialization
FromDIP() shouldn't be used before the window is created and
m_tabCtrlHeight was already initialized correctly in InitNotebook(),
when it can be used, so simply remove this premature and redundant
initialization.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
a00b0336a1 Don't adjust the font to DPI if the window isn't created yet
This is at best useless, as we can't get the correct DPI to use before
the window is created anyhow.

See #22193.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
e9bbe21fb5 Don't cache screen HDC DPI in wxActiveXContainer code
The DPI can change, so call wxGetDPIofHDC() each time we need it instead
of reusing the potentially invalid old value.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
8ad752f313 Remove never used macros from wxActiveXContainer code
This was added back in 557002cf81 (Ryan's cumulative wxActiveX and media
control patch (1427775), 2006-02-10) but never used.
2022-03-19 22:56:07 +01:00
Vadim Zeitlin
28605bfcfb Make wxDumpWindow() take const wxWindow pointer
There is no reason not to allow calling this function with const window,
so do allow it, notably to make it possible to use it with "this" from
const wxWindow methods.
2022-03-19 22:56:06 +01:00
Vadim Zeitlin
f54ebf3261 Add wxGetDPIofHDC() helper function and use it in wxMSW code
No real changes, just replace several pairs of calls to GetDeviceCaps()
with a single helper function call.
2022-03-19 22:56:06 +01:00
Marek Roszko
a3a1f8a2f1 Release HDC in WindowHDC destructor even if HWND is invalid
It is possible to use WindowHDC as ScreenHDC by passing a NULL HWND to
its ctor and we still need to release the HDC allocated in this case in
the dtor, so do _not_ check for HWND being valid there.

This fixes a bad resource leak in wxWindow::GetDPI() when it's called
for a window without a valid handle.

Closes #22193.

Closes #22194.
2022-03-19 22:56:06 +01:00
Paul Cornett
28ca585d12 Require window pointer for default wxGtkImage BitmapProvider
Originally a NULL window pointer indicated that a disabled bitmap
was not needed, but now the pointer is always needed for scaling.
2022-03-19 14:32:15 -07:00
Ilya Sinitsyn
f6c1230f71 Fix regression when adding items to an open node of wxDVC
This fixes a regression introduced in e5bd3ecec6 (Handle item adding to
DVC to a non-container node, 2022-03-17).

See #22201.

Closes #22205, #22206.
2022-03-18 19:38:54 +01:00
Vadim Zeitlin
b9a9ae70ea Fix loading message catalogs for domains with a dot in them
Anything following the dot was mistakenly used as an extension of the
corresponding file and replaced with ".mo", breaking loading of catalogs
with the names like "wxstd-3.1", which is the standard wx catalog name
since ded4da5ce5 (Add version suffix to gettext message catalog files,
2021-02-07).

Closes #22198.
2022-03-18 15:38:07 +01:00
Lauri Nurmi
504c0b16c3 Fix ParseDateTime() to also accept time + date, in that order
The intent of the implementation clearly is to allow parsing time first,
date second. But this failed, because a time such as "14:30:15" would
successfully parse as a date (as 14th of current month, current year).

Consequently an attempt is made to parse the actual date as time, which
fails, and therefore the whole ParseDateTime() fails.

Adding a failing test case for ensuring times cannot be parsed as dates
does not cause a failure, because partially yet successfully parsed inputs
get silently ignored (in both ParseDate and ParseDateTime tests). Fixing
both of these, too.

Closes #22203.
2022-03-18 00:01:18 +01:00
Vadim Zeitlin
0cb0db015f Merge branch 'fix-dvc' of https://github.com/thesiv/wxWidgets
Fix behaviour of ItemAdded() in generic wxDataViewCtrl implementation
for not yet opened nodes: calling it shouldn't prevent calling the model
GetChildren() when the node is opened, resulting only in explicitly
added children appearing in it.

See #22201.
2022-03-17 23:57:16 +01:00
Lauri Nurmi
538a75fe4e Decode 2-digit years properly in ParseRfc822Date()
The RFC accepts 2-digit years, and it makes most sense to interpret
e.g. 95 as 1995. However, this is an incompatible change, as earlier
95 was literally decoded as 95 AD.

Years 00..29 are considered to mean 20xx; 30..99 means 19xx.

Closes #22196.
2022-03-17 23:55:57 +01:00
PB
dc770deab0 Fix typos and wording in docs and comments
Closes #22191.
2022-03-17 23:53:52 +01:00
Vadim Zeitlin
a845d247fb Merge branch 'splitterwindow-dpi' of https://github.com/MaartenBent/wxWidgets
Handle DPI change in wxSplitterWindow.

See #22182.
2022-03-17 23:51:38 +01:00
Tobias Taschner
0a8bba971c macOS: Allow setting some fullscreen style options
When using the native fullscreen API by enabling EnableFullScrenView()
allow using hiding (or showing) menu and/or toolbar. An additional style
parameter has been added to EnableFullScrenView() to allow customizing
which style is applied when the user presses the fullscreen button
instead of a call to ShowFullScreen().

Closes #22180.
2022-03-17 23:50:32 +01:00
Vadim Zeitlin
9b2f55833e Add wxPreferencesPage::GetIcon() returning wxBitmapBundle
Allow returning a wxBitmapBundle rather than an individual wxBitmap.

Also make GetLargeIcon() non-pure even in wxOSX, as it now doesn't need
to be overridden if GetIcon() is -- but don't make GetIcon() pure
virtual neither to allow the existing code overriding GetLargeIcon() to
keep working.

This incidentally fixes the icons for the standard pages under macOS
broken by 388d322b68 (carry changes to toolbar over to prefs on osx,
2021-09-28), which replaced return statements with assignments,
resulting in the icon being set to the last value assigned to it instead
of the correct one -- this commit restores the previous control flow in
wxStockPreferencesPage::GetLargeIcon() (now called GetIcon()).

Closes #22187.
2022-03-17 23:49:18 +01:00
PB
e5f195da33 Copy SVG files with samples
Add few recently added SVG files used for bitmap bundles in samples
also to bakefiles and CMakeLists.

Closes #22197.
2022-03-17 23:48:01 +01:00
Vadim Zeitlin
0d37f733b5 Mention that bug affecting wxLocale under macOS is fixed in 12.3
Apple seems to have fixed the bug with SVG display (notably affecting
menu items check marks) in the latest macOS version, so update the
documentation to say that only the versions between 11.0 and 12.2 are
affected.
2022-03-17 23:47:33 +01:00
Maarten Bent
a9088d9408 Fix determining wxDataViewCheckIconTextRenderer size
Use the correct icon size based on the DPI of the view. This is the same method as
wxDataViewCheckIconTextRenderer::Render() uses.
2022-03-17 23:47:21 +01:00
Maarten Bent
8e991510c5 Regenerate the embedded svg data of wxlogo.svg 2022-03-17 22:51:55 +01:00
Maarten Bent
14eda07aeb Adjust wxlogo.svg size and viewbox
Make it square with small borders and the coloured squares in the center.
2022-03-17 22:49:12 +01:00
Maarten Bent
0ac7f2295f Optimize wxlogo.svg with SVGO 2022-03-17 22:39:37 +01:00
Jouk
dc5eee8073 Add xh_bookctrlbase.cpp for compilation on OpenVMS 2022-03-17 09:42:22 +01:00
Jouk
7dd4d1d8b8 Disable Tango Art, because of problems 2022-03-17 09:29:49 +01:00
Paul Cornett
8f47d9ad48 Fix size of un-resizeable TLW with Wayland
GTK3 does not add the decoration size when using gtk_widget_set_size_request().
See #22155
2022-03-16 21:35:18 -07:00
Paul Cornett
1b129ef9a8 Fix client-side decoration size with GTK3
Get the decor size regardless of whether window size
is changing, as in some cases it never does.
See #22155
2022-03-16 21:27:08 -07:00
Ilya Sinitsyn
e5bd3ecec6 Handle item adding to DVC to a non-container node 2022-03-17 08:11:07 +07:00
Ilya Sinitsyn
c7d0247258 Fix item adding to DVC
Fix wxDataViewMainWindow::ItemAdded() when it used after
wxDataViewCtrl::AssociateModel() (it doesn't create child nodes so we should
not add child items at all to a collapsed node).
2022-03-17 08:11:07 +07:00
Ilya Sinitsyn
0144608b4b Test DVC with the custom model
wxDataViewCtrl::AssociateModel() don't create child nodes, which leads to
missing nodes if then used wxDataViewModel::ItemAdded(). So add the test
for such situation.
2022-03-17 08:10:58 +07:00
Maarten Bent
657be8b6dc Handle DPI change in wxSplitterWindow 2022-03-16 18:59:19 +01:00
Paul Cornett
bae7680d52 Improve GTK3 client-side decorations check
This is more like GTK does it
2022-03-14 09:46:20 -07:00
Paul Cornett
7ce4e521c5 Fix a TLW sizing issue with Wayland
Don't include the size of client side decorations when changing the
size of a GtkWindow, as GTK will add in the decoration size itself.
See #22141
2022-03-14 09:40:06 -07:00
Maarten Bent
9285d61393 Improve handling DPI change in wxSplitterWindow
wxSplitterWindow can receive multiple size events while the DPI change is being processed.
Keep using the relative sash position while the DPI change is finished.
2022-03-10 20:02:25 +01:00
Maarten Bent
23a3b74d3d Add a function to check if a DPI event is being processed 2022-03-10 19:59:30 +01:00
Lauri Nurmi
1c5e66a12c Allow RFC822 timestamps without a week day
RFC 822 specifies the week day is optional.
2022-03-10 19:25:21 +02:00
Lauri Nurmi
8d9d2684ef Fix out-of-bounds reads in ParseRfc822Date() with too short input
The implementation implicitly relies, in many places, on the assumption
that the input never ends prematurely. If it does, the iterator
pointing beyond the end of buffer is dereferenced, which is UB.

The solution used here is to append 32 zero bytes to the date string,
which hopefully keeps the code more readable than checking for the end
of string before each deference operation.

Add various syntactically invalid inputs to unit tests.

Closes #22185.
2022-03-10 16:44:44 +01:00
Vadim Zeitlin
2362010a48 Fix caching of files using wx headers with ccache
Avoid using, or even mentioning in the comments, __DATE__ and __TIME__
macros as doing this prevents ccache from caching the compilation
results by default (i.e. unless CCACHE_SLOPPINESS=time_macros is used).

As ccache simply scans for the given literal strings, using "##" token
pasting operator is enough to disable this pessimization. Of course,
this does mean that using ccache with the code actually using __TDATE__
or __TTIME__ is not going to work correctly, but there should be no
reason to do it any longer and these macros are not even documented, so
also mention that they shouldn't be used.

Finally do add __DATE__ to the only place in our own code where these
macros are used to ensure that it is not cached incorrectly.

Closes #22156.
2022-03-10 16:37:47 +01:00
Paul Cornett
7463d514bf Fix text drawing in caret sample with wxGTK3 and wxOSX
Don't use wxClientDC for drawing the text, just refresh the updated
character.

See #17820.
2022-03-10 16:18:20 +01:00
Vadim Zeitlin
3533decf93 Update libpng submodule to avoid spurious gcc 11 warning
No real changes.
2022-03-09 20:09:46 +01:00
Maarten Bent
1ecebd5c7c Handle DPI change in wxSplitterWindow
Adjust the minimum pane size to the new DPI.
Keep the sash in the same relative position.
2022-03-08 22:16:50 +01:00
Gideon van Melle
e43895e531 Update Dutch translations 2022-03-06 19:53:15 +01:00
Vadim Zeitlin
10ad88cdbe Don't consume context menu events in wxToolbook
This was preventing the application code from receiving them.

Closes #22153.
2022-03-06 19:50:59 +01:00
Vadim Zeitlin
3fa634677c Merge branch 'headercol-bmp-bundle'
Use wxBitmapBundle in wxHeaderColumn.

See #22137.
2022-03-04 03:37:37 +01:00
Vadim Zeitlin
570b78ebb5 Give a warning when using default scale factor in wxGtkImage
This is not supposed to happen, but warn about it if it nevertheless
does.
2022-03-04 03:37:20 +01:00