Commit Graph

72213 Commits

Author SHA1 Message Date
Tobias Taschner
1ae0037330 Add wxGetNativeCpuArchitectureName()
This allows to retrieve the native CPU architecture name regardless of
the current process CPU architecture.

Common examples for CPU architecture differences are the following:
    - Win32 process in x64 Windows (WoW)
    - Win32 or x64 process on ARM64 Windows (WoW64)
    - x86_64 process on ARM64 macOS (Rosetta 2)

Closes #22036.
2022-01-22 19:32:56 +01:00
Tobias Taschner
512f40d614 Silence unused parameter warning 2022-01-22 19:32:40 +01:00
PB
72e1de6d73 Do not use Direct2D Debug Layer if wx debug features are disabled
Create wxD2D1Factory with D2D1_DEBUG_LEVEL_WARNING only when debug
features, such as asserts, are enabled at wx level.

This is not the exact equivalent of the "Debug" build commonly used
under MSW with MSVC, but seems to be the closest equivalent, see the
discussion in #22034.

Closes #22039.
2022-01-21 21:17:33 +01:00
Vadim Zeitlin
2af0b12d26 Avoid assert on text sample startup under MSW
Use wxTE_RICH2 for a control that we call EnableProofCheck() on, as
using this function without this style asserts in wxMSW.

This should have been done in 5ba2461fd1 (Switch to using GSpell for
wxTextCtrl proof checker in wxGTK, 2021-09-08).
2022-01-20 00:13:16 +01:00
Vadim Zeitlin
ab94485efa Really fix example of creating wxBitmapBundle in hight DPI docs
Co-Authored-By: PB <PBfordev@gmail.com>
2022-01-19 16:45:41 +01:00
Vadim Zeitlin
4a43ea8827 Fix wrong example and wording in high DPI docs
Co-Authored-By: PB <PBfordev@gmail.com>
2022-01-18 19:08:50 +01:00
Vadim Zeitlin
bf2c2b6343 Merge branch 'arrstr_stl_fromend_fix' of https://github.com/pavel-t/wxWidgets
Fix wxArrayString::Index(bFromEnd = true) in STL build.

See #22024.
2022-01-18 18:57:43 +01:00
valid-ptr
0199a8ce49 dataview sample: Added test for wxDataViewModel::Cleared functionality: Ctrl-W will clear MyMusicTreeModel. Ctrl-W can be pressed while editing some item (artist is editable) 2022-01-18 17:03:41 +03:00
valid-ptr
8aae7ad937 Fatal exception fixed in DVC on macOS while wxDataViewModel::Cleared call + editing item. 2022-01-17 22:38:56 +03:00
Pavel Tyunin
f1607c9521 Fix search from end in wxArrayString in STL build 2022-01-17 19:20:19 +02:00
Paul Cornett
32eb4af061 Avoid using wxClientDC to redraw grid lines
This only happens when changing whether/how the lines are drawn, so
there should be no performance issue with just repainting the window.
2022-01-17 08:55:48 -08:00
Paul Cornett
8cfdabd50d Avoid a use of wxClientDC for drawing
Just refresh the cell if the highlight color is changed
2022-01-17 08:55:48 -08:00
Vadim Zeitlin
94b4f738d4 Merge branch 'dpi-docs-improve'
Improve high DPI support documentation.

Closes #18889, #22011.
2022-01-17 17:44:06 +01:00
Vadim Zeitlin
ead3e95bf4 Add a note about rounding the logical pixels up when converting
This might be unexpected, so explicitly warn about possibly not getting
back exactly the same value after a round-trip.
2022-01-17 17:43:51 +01:00
Vadim Zeitlin
74e1404a5a Document using wxWindow::{From,To}Phys() for LP<->PP conversions
This is simpler and more clear than dividing or multiplying by
GetContentScaleFactor().
2022-01-17 17:43:51 +01:00
Vadim Zeitlin
b4f0ddd81e Add wxBitmapBundle section to high DPI overview
Explain how it can be created and used.
2022-01-17 17:43:51 +01:00
Vadim Zeitlin
c1532c8d3c Fix table of contents generation for high DPI overview
Add the required anchors, just the headers are not taken into account
for TOC generation.
2022-01-17 17:42:32 +01:00
Vadim Zeitlin
caec339bc1 Improve documentation of various pixel types
Also add a diagram showing the functions to use to convert between them,
perhaps this can be more clear than textual description.

Co-Authored-By: Stefan Csomor <csomor@advancedconcepts.ch>
2022-01-17 17:42:01 +01:00
Paul Cornett
4217573a3f Fix wxGrid::SetCurrentCell() with Wayland
Avoid wxClientDC with GTK3 as well as OSX. Additionally, refresh
only the cells that need it, rather than the entire window.
See #18448
2022-01-16 21:35:20 -08:00
PB
ccb6b10c1f Use SVG-based toolbar bitmaps in webview sample
In webview sample toolbar use wxBitmapBundles created from SVG files
instead of XPM bitmaps, as this results in much better appearance in
high DPI.

Closes #2642.
2022-01-17 01:07:57 +01:00
Vadim Zeitlin
2064526e3d Revert "Merge branch 'ak_high_dpi' of https://github.com/kosh543/wxWidgets"
This reverts commit a34ab31453, reversing
changes made to 783df59e66.

Undo the addition of wxBitmapBundle support to XRC, as it is finally
going to be done in a different way soon -- but for now just remove it
to ensure that nobody starts using it before it's finalized.

See #2633.

Closes #22014.
2022-01-16 23:40:31 +01:00
Vadim Zeitlin
68e2684d2b Merge branch 'phys-pixels-convert'
Add function for converting between logical and physical pixels too.

See #22013.
2022-01-16 23:39:50 +01:00
Vadim Zeitlin
f2c5973f61 Fix cancel editing on Esc in wxOSX wxDataViewCtrl again
Handle selectors corresponding to key presses, such as cancelOperation:,
ourselves because we never get the keyDown events that are supposed to
take care of generating it from the native code somehow.

This fixes cancelling editing with Escape which stopped working since
26d6f82a81 (Implement EVT_CHAR generation for wxDataViewCtrl under Mac,
2021-04-13).

Closes #17835, #2639.

Co-Authored-By: Stefan Csomor <csomor@advancedconcepts.ch>
2022-01-15 23:41:13 +01:00
Vadim Zeitlin
7e3059dee0 Merge branch 'dvc-multi-format-dnd'
Accept multiple data formats via drag-and-drop in wxDataViewCtrl.

See #2478, #2616.
2022-01-15 23:39:03 +01:00
Pavel Tyunin
d7fe9667fc Add tests for direction of search in arrays 2022-01-15 21:02:22 +02:00
Vadim Zeitlin
1195b901bd Change issue reporting URL to point to template selection page
This seems more useful than pointing directly to the blank issue
creation page.
2022-01-15 15:46:07 +01:00
Vadim Zeitlin
771e527f30 Merge branch 'issue-templates'
Add some templates for GitHub issues.

These templates notably allow associating labels with the new issues,
which would be impossible otherwise.

See #22016.
2022-01-15 15:44:38 +01:00
QuentinC
622a2f9d60 Improve dark mode detection in wxMSW
Use the registry key corresponding to the selection of "Light" or "Dark"
for the "Colors" in the "Settings" applet, see

https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application/

Closes #22020.
2022-01-15 14:35:27 +00:00
Vadim Zeitlin
aae203c7b5 Fix applying scale in wrong direction in wxOSXImageFromBitmap()
We need to use the bitmap size in logical pixels for NSImage and we
definitely must not multiply the physical size by the scale factor, only
dividing it makes sense -- so just do it, by using GetScaledXXX()
instead of GetXXX() when creating the NSImage to use for wxBitmap.

Surprisingly, this seems to have been broken ever since the addition of
this code in 95aa8e40fd (first part of OSX adaptations, 2021-09-28)
without anybody noticing it until now.

Closes #22019.
2022-01-15 02:42:23 +01:00
Vadim Zeitlin
d429eea605 Document that wxTreeEvent::GetItem() is not always valid
Contrary to what the documentation stated, it was possible for the item
to be invalid, so update it to explain this and give an example of a
case in which this happens.

See #19182.
2022-01-14 22:26:27 +00:00
Vadim Zeitlin
1e03710405 Avoid using invalid wxTreeCtrl item in wxGenericDirCtrl
This resulted in an assert when receiving wxEVT_TREE_SEL_CHANGED events
with invalid item when the tree was recreated from wxGenericDirCtrl own
OnSelFilter().

Closes #19182.
2022-01-14 22:23:18 +00:00
Vadim Zeitlin
20e64a53e3 Add treelist sample to the main samples bakefile
It was forgotten in samples.bkl and so wasn't built together with all
the other samples before -- do add it and rebake now.
2022-01-14 22:53:24 +01:00
Vadim Zeitlin
ee330d73a7 Rebake after the year change
The year is now included in the copyright string used in the makefiles
and so they need to be regenerated every time the year changes (which
happens surprisingly frequently).

It would be better to define a single variable with the year number to
avoid having to do this in the future.
2022-01-14 22:51:24 +01:00
Vadim Zeitlin
1ce1d52878 Ask for GTK version and theme for wxGTK bug reports too
Co-Authored-By: PB <PBfordev@gmail.com>
2022-01-14 14:59:09 +01:00
Vadim Zeitlin
f502a9b5d7 Add an issue template for enhancement proposals 2022-01-14 01:49:14 +01:00
Vadim Zeitlin
77c3691cb2 Add an issue template for build problems 2022-01-14 01:46:21 +01:00
VZ
0fbefe9219 Add issue template for a bug report
Try creating a new issue template.
2022-01-14 01:43:36 +01:00
Vadim Zeitlin
8f1e277833 Ignore changes to GitHub issue templates in the CI builds
Unfortunately they will still run once when this commit is done, but at
least they won't run in the future when templates are modified.
2022-01-14 01:42:13 +01:00
bakcsizs
882a6caadb Fix <big> and <small> behaviour in wxHTML
Correctly set the font size to the size one bigger or smaller than the
current one instead of just setting it to size 1 in both cases.

Apparently this was broken ever since this code was added back in
4f9297b0ee (wxHTML src code indentation now conforms (more) to wxWin
coding style, 2000-11-05) without anybody noticing.

Closes #22012.
2022-01-14 01:28:42 +01:00
Vadim Zeitlin
0c3b25eccb Use wxWindow::FromPhys() in wxAUI code
This is simpler and a tad more accurate than dividing by
GetContentScaleFactor().

Also add FromPhys() to MSW-specific code: even if it's not really needed
there (as the conversion is always trivial), it's still better to have
it for consistency.
2022-01-13 19:51:58 +01:00
Vadim Zeitlin
421416696f Add wxWindow::FromPhys() and ToPhys() functions
Provide these functions for consistency with the existing FromDIP() and
ToDIP().

We also can use ceil() (rather than round() used by wxSize operators) in
FromPhys() to ensure that we never truncate contents of a physical
bitmap, which allows to replace the existing wxStaticBitmap code with
just a call to this function.
2022-01-13 19:51:58 +01:00
Vadim Zeitlin
1f401475f3 Merge branch 'art-scalefactor'
Fix confusion between different kinds of coordinates in wxAUI code,
restoring correct behaviour in high DPI on all platforms.

See #2620.

Closes #19331.
2022-01-13 17:51:00 +00:00
Stefan Csomor
2ed79f8f88 Also fix AUI tab size calculation in high DPI
This is similar to the parent commit and does the same thing for the
total width calculation.
2022-01-13 17:47:48 +00:00
Stefan Csomor
109a6fa5b7 Fix AUI tab size calculation for non MSW ports in high DPI
The physical size returned by wxBitmapBundle::GetPreferredSizeFor() must
be converted to logical pixels when it's used as a wxDC coordinate.

This fixes a regression introduced in 391080e77d (Use wxBitmapBundle for
AUI tab pages bitmaps, 2021-11-13).
2022-01-13 17:39:34 +00:00
Vadim Zeitlin
7c7ff3cd42 Add wxBitmap::GetDIPSize() and use it in wxBitmapBundleImplArt
This fixes the problem with wrong standard bitmaps size when using high
DPI for the main monitor with wxMSW, as GetScaledSize() used here since
31f2892200 (Avoid bitmap scaling in wxArtProvider::GetBitmapBundle(),
2021-12-17) was not the right function to use there.

Closes #19331.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
03cf1f4359 Remove wxHAS_BITMAP_SCALE_FACTOR
Now wxMSW also stores the scale factor, even if it doesn't use it in its
GetScaledXXX(), so it doesn't seem useful to have this symbol for
distinguishing the platforms with and without bitmap scale factor
support, when we can just use wxHAS_DPI_INDEPENDENT_PIXELS instead in
the only place where this was used.

And as this symbol was added quite recently, in 2c1f4c002d (Add
wxBitmap::SetScaleFactor(), 2021-10-23), we can hopefully just remove it
without breaking any existing code, if we do it right now.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
f6fbc97c7b Only return really scaled bitmap size under platforms using DIPs
wxBitmap::GetScaledXXX() functions are useful for obtaining the
coordinates in logical pixels, so they should only divide by the scaling
factor on the platforms where logical pixels are actually different from
the physical ones, i.e. those using DPI-independent pixels.

This ensures that their behaviour under MSW remains unchanged even after
a1e4dca067 (Store scale factor in wxMSW bitmaps too, 2021-12-16), which
is the correct way to avoid breaking wxAUI (and other) drawing.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
afe3d0ebae Move wxHAS_DPI_INDEPENDENT_PIXELS definition to wx/features.h
This is going to be used in wxBitmap code, where wx/window.h is not
included.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
2945278334 Rename wxHAVE_DPI_INDEPENDENT_PIXELS to wxHAS_XXX and document it
Using wxHAS_ prefix is more consistent with all the other similar
symbols, using wxHAVE_ was a mistake, that we have to pay for by
preserving the old name now (as it is actually already used in some code
outside of the library).

The fact that it's used also shows that it's better to document this
symbol, even if just to explain that it normally shouldn't be used, as
we can't really hide it anyhow.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
10977b0eb6 Don't make wxBitmap::GetScaledXXX() virtual
There should be never any need to override them, their behaviour is
fixed.

No real changes.
2022-01-13 17:34:49 +00:00