Commit Graph

20095 Commits

Author SHA1 Message Date
Artur Wieczorek
b079554100 Fix wxPropertyGrid classes build without implicit wxString encoding
Ensure that all headers in wx/propgrid can be compiled with
wxNO_IMPLICIT_WXSTRING_ENCODING defined.

Closes #22102.
2022-05-30 19:07:08 +02:00
Randalphwa
385acccebb Fix some harmless MSVC compiler warnings
This fixes warnings C4244 ('=': conversion from 'int' to 'xxx', possible
loss of data) and C4267 (conversion from 'size_t' to 'int', possible
loss of data) from the MSVC compiler (Version 19.29.30136 for x64) when
compiling in 64-bits.

Note that these warnings are disabled in wx/defs.h by default and so
only happen when saving/restoring the warning settings using the
appropriate pragmas before/after including wx headers.

Closes #22462.
2022-05-30 17:47:15 +02:00
Artur Wieczorek
2855ec1e88 Make data member mutable to avoid const_casts 2022-05-27 19:13:44 +02:00
Artur Wieczorek
e7fac13461 Declare functions as const 2022-05-27 19:13:42 +02:00
Artur Wieczorek
2aa6259aa4 Pass const pointer as a parameter 2022-05-27 19:13:42 +02:00
Artur Wieczorek
502ede23ab Don't expose internal wxPropertyGridPageState functions
Functions designed for internal use shouldn't be exposed as public ones
to avoid calling them directly from the user code by mistake.
2022-05-27 19:13:42 +02:00
Vadim Zeitlin
411c150bba Merge branch 'print-preview-layout'
Print preview layout and appearance fixes.

See #22441.
2022-05-23 22:25:16 +01:00
Vadim Zeitlin
9042b529fa Merge branch 'dvc-bitmap-renderer-bundle'
Allow using wxBitmapBundle with wxDataViewBitmapRenderer.

See #22411.
2022-05-23 22:22:53 +01:00
Vadim Zeitlin
663fa1c77b Still use wxPreviewFrame size if it was explicitly specified
Even though it's better to not specify the preview frame size at all,
the size should still be used if it was explicitly specified, but this
didn't happen any more after the addition of the call to Fit().

Fix this now by only doing the equivalent of Fit() if no size was
explicitly given.

Also add advice about not setting the size explicitly to the
documentation.
2022-05-23 15:07:06 +01:00
Artur Wieczorek
21fe682187 Don't store wxBitmap objects on the heap in wxPropertyGrid
To simplify managing the life cycle of the objects.
2022-05-21 22:08:02 +02:00
Artur Wieczorek
5e417302c5 Don't store wxCursor object on the heap in wxPropertyGrid
To simplify managing the life cycle of the object.
2022-05-21 22:07:42 +02:00
Artur Wieczorek
44bc305eb1 Move code after #include directives 2022-05-21 22:05:33 +02:00
Artur Wieczorek
d872229be3 Get rid of redundant casts 2022-05-21 22:05:12 +02:00
Artur Wieczorek
6652243b6f Don't override Refresh() in wxPropertyGridManager
It just forwards call to the base class so it's redundant.
2022-05-21 22:04:26 +02:00
Artur Wieczorek
547afc66c4 Pass large object by a const reference 2022-05-21 22:03:08 +02:00
Artur Wieczorek
1c292cfe2c Initialize data members in initialization lists 2022-05-21 22:01:58 +02:00
Vadim Zeitlin
dd80f16fc2 Fix wxGTK build with glib < 2.50
This was recently broken by bffcb88266 (Optionally detect not filtered
GTK log messages, 2022-05-12), see #22424.

Fix it by providing a trivial "do nothing" version of LogFilterByMessage
even if we can't implement it -- this seems to be preferable to using
preprocessor checks in the code using it.

Closes #22434.
2022-05-18 18:47:37 +02:00
Vadim Zeitlin
2efa26cc1f Merge branch 'gtk-log-suppress'
Allow suppressing GTK log messages.

See #22424.
2022-05-17 16:36:06 +02:00
Vadim Zeitlin
bffcb88266 Optionally detect not filtered GTK log messages
In the future it might be useful to run the code with WXTRACE=gtklog to
see if any GTK log messages we're filtering don't need to be filtered
any longer.
2022-05-12 16:13:19 +02:00
Vadim Zeitlin
4602caf49d Add LogFilterByMessage GTK log filter
This will allow suppressing GTK log messages with the specified
fixed contents.
2022-05-12 00:34:14 +02:00
Vadim Zeitlin
f137f19bb7 Factor out wxGTKImpl::LogFilter from GTKSuppressDiagnostics()
Refactor the code to separate setting of the log callback from the
filtering decision.

Right now the only existing filter is the one just checking the log
level, which is used by GTKSuppressDiagnostics(), but this will allow
adding other filters in the upcoming commits.
2022-05-12 00:25:08 +02:00
Vadim Zeitlin
2ba9007d0e Add wxCHECK_CXX_STD() and use it to test for C++17 and C++20
Unlike direct tests of __cplusplus, using this macro also works with
(recent enough, i.e. MSVS 2015.3 or later) MSVC versions, even if
/Zc:__cplusplus is not used.

This simplifies some checks and makes some other ones (notably the check
for C++20 used before wxALLOW_COMBINING_ENUMS macro definition) work
with MSVC versions with C++20 support as intended.
2022-05-11 16:57:18 +01:00
Vadim Zeitlin
d311a07b7a Remove unnecessary test which was needed for macOS < 10.7 only
There is no need to check for the weird case of using a C++11 compiler
with C++98 standard library any longer, this is not supposed to happen
and we don't support macOS < 10.7 since a very long time anyhow.
2022-05-11 16:49:43 +01:00
Vadim Zeitlin
a7eee933c6 Merge branch 'tsan-warnings'
Fix a harmless warning from thread sanitizer and make wxAtomicInc() more
useful.

See #22417.
2022-05-11 02:37:26 +02:00
Vadim Zeitlin
bb52a5c5b5 Merge branch 'imaglist-mask'
Make handling of masks in wxImageList simpler and more useful.

See #22400.
2022-05-11 02:35:59 +02:00
Vadim Zeitlin
5a6adf4f58 Merge branch 'nanosvg-lib'
CMake: Support external NanoSVG library.

See #22407.
2022-05-11 02:33:38 +02:00
Maarten Bent
603c13aaba CMake: Add support for external NanoSVG library 2022-05-11 01:54:03 +02:00
Vadim Zeitlin
cf66ce5f94 Return the new value from wxAtomicInc() too
This is easy to do and can be useful when using an atomic initialization
counter.

The only platform where not returning the new value might be more
efficient than returning it is Solaris which is not really relevant any
more and on all the other platforms the functions we were already using
provided this value already (or almost, in case of using gcc builtins,
when we just have to use a different one).
2022-05-11 00:16:47 +02:00
Vadim Zeitlin
1b82a9fe04 Use wxBitmapBundle as default type in wxDataViewBitmapRenderer
The default type doesn't really matter after the previous commits, as
the renderer accepts both wxBitmap and wxBitmapBundle (and also wxIcon)
in any case anyhow, but it seems better to use the preferred type as the
default one.

Also make the documentation more useful, although an example is still
lacking.
2022-05-09 14:36:41 +02:00
Vadim Zeitlin
5556ea8429 Add support for storing wxBitmapBundle in a wxVariant
Define wxBitmapBundleVariantData without using the standard macros that
only work for wxObject-derived classes, but using more or less what they
expand into.

This will allow using wxBitmapBundle with wxDataViewCustomRenderer
subclasses in the upcoming commit.
2022-05-08 21:26:04 +02:00
Vadim Zeitlin
d8abdfbdee Accept either bitmaps or icons in wxDataViewBitmapRenderer
Allow using either wxBitmap or wxIcon in wxDataViewBitmapRenderer
independently of the type the renderer was created with because this is
convenient and there is no real danger in allowing to mix and match
bitmaps and icons together.

Override the just added IsCompatibleVariantType() to implement this.
2022-05-08 21:26:04 +02:00
Vadim Zeitlin
23e815bcf6 Allow relaxing the check for variant type in wxDataViewRenderer
Instead of checking for the exact variant type match, call the new
IsCompatibleVariantType() virtual function, which still does the same
check by default, but can be overridden to allow other types as well if
they're accepted by the renderer.

This will be soon used to allow accepting both wxBitmap (which must
still be accepted for compatibility) and wxBitmapBundle (which is the
simplest way to support high DPI) in wxDataViewBitmapRenderer at once.
2022-05-08 18:39:15 +01:00
Vadim Zeitlin
eb361a182a Use a single wxBitmapBundle in wxDataViewBitmapRenderer
Instead of using either a wxBitmap or a wxIcon, always use the same
wxBitmapBundle object to store whatever we are rendering.

This slightly simplifies the code and prepares for further changes, but
nothing real changes yet.
2022-05-08 15:55:34 +01:00
Vadim Zeitlin
dc90e92110 Add wxBitmapBundle::Clear()
This is just a convenient helper for resetting the bundle contents which
seems more readable than assigning an empty bundle to it.
2022-05-08 15:54:51 +01:00
DietmarSchwertberger
b6fb5109c0 Fix drawing of row/col drag markers in wxGrid
Don't offset the DC in the unwanted direction as this resulted in not
drawing anything at all when the grid was scrolled.

Also fix off by one error in the marker line length.

Closes #22403.
2022-05-07 18:58:07 +02:00
DietmarSchwertberger
84729af324 Fix handling of standard accelerators in wxSpinCtrl in wxMSW
Keys such as Ctrl-C etc could be unexpectedly intercepted by
accelerators defined for the menu items when wxSpinCtrl had focus.

Fix this by always preprocessing such keys in wxSpinCtrl itself, just as
it was already done for wxTextCtrl and even reuse the same function for
doing it (which had to be factored out in order to allow it).

Closes #22404.
2022-05-07 17:12:08 +02:00
Vadim Zeitlin
0e21b52d57 Extract mask creation from wxImage in a separate function
Allow reusing the code for creating a mask from wxImage mask from
elsewhere.

No real changes yet, this is a just a refactoring.

This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-space options.
2022-05-06 02:12:54 +01:00
Vadim Zeitlin
e75f100841 Make GetImageListBitmap() member of wxGenericImageList too
Just simplify the code a little by avoiding having to pass m_useMask and
m_size to all calls of this function.

No real changes.
2022-05-06 02:12:54 +01:00
Maarten Bent
931370f0ad Add NanoSVG setup options
An option to enable or disable using NanoSVG for rasterizing SVG files.
And an option to indicate an external NanoSVG library is used.
2022-05-05 22:15:49 +02:00
Vadim Zeitlin
dcc39d942f Make GetImageListBitmaps() member function of wxImageList
No real changes, just simplify the code a bit by using a member function
as this avoids having to pass m_useMask to it separately.
2022-05-05 19:06:18 +01:00
DietmarSchwertberger
ec737396d8 Unify wxGrid code for processing row and column mouse events
Reuse the same code for handling mouse events for both rows and columns
instead of duplicating almost (but not quite) the same code for both of
them.

As part of resolving the inconsistencies between the two versions, add
wxEVT_GRID_ROW_AUTO_SIZE corresponding to the existing event with the
same name for the columns.

Closes #22380.
2022-05-05 17:23:45 +02:00
Joonas Kuusela
1660584a45 Fix using wx/tipwin.h as the first include wx header
Include wx/defs.h from wx/tipwin.h to ensure wxUSE_TIPWINDOW is defined
before testing its value.

Closes #22392.
2022-05-05 16:10:46 +02:00
Vadim Zeitlin
bdfa9359ae Move wxGrid::Get{Row,Col}Pos() out of line
Don't define these functions in the header file, this is unnecessary.

No real changes.
2022-05-02 21:43:42 +01:00
Vadim Zeitlin
d64ba81378 Merge branch 'dc-cleanup'
Some cleanup in wxDC code: remove unnecessary casts, use RAII helpers
instead of manual memory and other resources management.

No real changes.

See #22378.
2022-05-01 03:11:06 +02:00
Vadim Zeitlin
4fcf3ba465 Merge branch 'fix-build-without-base64' of https://github.com/PBfordev/wxWidgets
Fix build when wxUSE_BASE64==0.

See #22377.
2022-05-01 03:07:35 +02:00
PB
ed3b1c6ca3 Simplify MSVC pragma for embedding application manifest
Instead of defining a manifest for each individual CPU architecture, use
a single manifest with an asterisk for the architecture.

Should have been part of 77d8926126 (Simplify Windows application
manifests, 2021-12-17).

Closes #22376.
2022-05-01 03:03:20 +02:00
Vadim Zeitlin
a7791781d9 Merge branch 'listbook-images'
Show images added to its wxImageList later in wxListbook again and also
improve determining the size of the list control under MSW.

See #22372.
2022-05-01 02:57:24 +02:00
Vadim Zeitlin
eb5ad7255c Merge branch 'shared-client-data'
Allow sharing client data in wxGrid-related classes.

See #22369.
2022-05-01 02:55:36 +02:00
Vadim Zeitlin
9a36e26d4a Merge remote-tracking branch 'MaartenBent/wxdc-dpi'
Make wxDC and wxGraphicsContext DPI aware, i.e. add {From,To}DIP() to
them too and make the values returned from Get{DPI,PPI}() consistent
with wxWindow.

Also improve CMake build: add support for finding Cairo when not using
GTK, fix a warning when creating the inplace-config, and mark some
variables as advanced.

See #22346.
2022-05-01 02:53:12 +02:00
Vadim Zeitlin
481b73d14c Use wxScopedArray<> instead of manual memory management in wxDC
Update similar code in all ports to use wxScopedArray for arrays of
points, dashes etc in various wxDC implementations instead of using
new[] and delete[] manually.

No real changes, just make the code safer and shorter.
2022-04-30 21:14:58 +01:00