Commit Graph

41539 Commits

Author SHA1 Message Date
Artur Wieczorek
d72a3f7cec Create wxBitmap compatible with wxDC for all ports
Ctor creating wxBitmap compatible with wxDC is now implemented in all
ports.
2022-04-15 10:12:41 +02:00
Vadim Zeitlin
105e81a4b0 Merge branch 'cmake-gtk2' of github.com:MaartenBent/wxWidgets
Fix some CMake and build warnings with GTK2.

See #22305.
2022-04-14 23:19:54 +02:00
Vadim Zeitlin
54bdc6bbd2 Merge branch 'configure-snprintf'
Don't use AC_CHECK_FUNCS(snprintf) which doesn't work with the latest
MinGW API headers (see https://sourceforge.net/p/mingw-w64/bugs/935/)
and some other minor cleanup.

See #22302.
2022-04-14 23:18:16 +02:00
Maarten Bent
5bea1dc18a Fix static build using extended RTTI
Fix declaration of 'o' hides previous local declaration warnings.

Change two wxCONSTRUCTOR_5 definitions using wxBitmapBundle instead of
wxBitmap (this does not give build errors).

wxGenericCalendarCtrl is missing all XTI implementations, so just use
RTTI. And fix building the xti sample.

Note the shared build still fails due to WXDLLIMPEXP related issues.

Closes #22300.

Closes #22301.
2022-04-14 23:17:05 +02:00
Maarten Bent
5ebcfd7681 Fix warnings in GTK2 build 2022-04-14 22:58:46 +02:00
Vadim Zeitlin
4b918d16d0 Fix wrong format specifier in wxMarkupParser debug logs
Use "%z" and not "%l" for size_t arguments.
2022-04-14 17:37:32 +01:00
Vadim Zeitlin
0407d74eaa Remove __WXSTUBS__ mention and test
This has never really been a thing and there remained just one (never
used) test for it in the sources, so simply remove it.

No real changes.
2022-04-14 00:40:36 +02:00
Vadim Zeitlin
7b45060d30 Remove remains of Classic Mac support
Don't test for __WXMAC__ after testing for __UNIX__ just above, as the
latter is now always defined when the latter is, we don't support
non-Unix Mac systems since an awfully long time.

No real changes.
2022-04-14 00:39:37 +02:00
Vadim Zeitlin
d31d645777 Drop remains of support for Metrowerks Standard C++ library
This compiler is not supported since a very long time, so get rid of the
tests for __MSL__.
2022-04-14 00:38:03 +02:00
Vadim Zeitlin
d63b0c2cf9 Update libtiff submodule to remove snprintf() check in configure
This fixes build failure when using the latest MinGW headers.
2022-04-14 00:26:01 +02:00
Vadim Zeitlin
ce46d77360 Merge branch 'bitmap-dc-ctor'
Add wxBitmap ctors taking wxDC to all ports and set the scale factor
correctly in the existing ctors taking wxDC in wxMSW.

See #22297.
2022-04-13 15:57:35 +02:00
Vadim Zeitlin
85daadd659 Merge branch 'cmake-improvements' of https://github.com/MaartenBent/wxWidgets
Use newer CMake PCH support instead of cotire and many other
improvements to CMake build system.

See #22295.
2022-04-13 15:56:09 +02:00
Vadim Zeitlin
2d719165ca Fix wxMSW build with wxUSE_UNICODE==0
Use wxChar in wxUILocaleImplLCID to allow the code to compile and work
correctly even when GetLocaleInfo() is GetLocaleInfoA() and not the W
version as usual.

Closes #22299.
2022-04-12 23:46:36 +02:00
Maarten Bent
0f8b828394 Fix unused parameter warning in macOS build 2022-04-12 22:08:45 +02:00
Vadim Zeitlin
24970061fa Add wxBitmap(wxImage, wxDC) ctor to all ports
This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.

In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.

Enable previously wxMSW-only unit test checking for this.
2022-04-12 19:08:56 +01:00
Vadim Zeitlin
b185186ebf Handle scale factor in another wxMSW wxBitmap ctor taking wxDC
This is similar to db6d565fad (Handle wxDC scale factor in wxBitmap ctor
taking wxDC in wxMSW, 2022-04-10), but for the constructor taking
wxImage and wxDC -- it should also use the DC scale factor, even if it
is not used for scaling the bitmap size in this case.

Add a unit test checking for this.
2022-04-12 17:57:49 +01:00
Vadim Zeitlin
558a300996 Create bitmaps from image and a wxDC without an HDC in wxMSW
This is similar to 7382e99bbb (Create bitmaps even when given a wxDC
without an HDC in wxMSW, 2022-04-10) and does the same change to
wxBitmap ctor from wxImage and wxDC -- and also extends the unit test to
check for this under wxMSW, which is the only port in which this ctor is
currently available.
2022-04-12 17:30:42 +01:00
Vadim Zeitlin
db6d565fad Handle wxDC scale factor in wxBitmap ctor taking wxDC in wxMSW
When using wxBitmap ctor taking wxDC, the bitmap should inherit the
scale factor of the DC, both because it's already the case in the other
ports and because it makes sense to do it.

Add a unit test checking that this is the case in all ports now.
2022-04-10 19:45:59 +01:00
Vadim Zeitlin
7382e99bbb Create bitmaps even when given a wxDC without an HDC in wxMSW
It seems wrong to just fail to create the bitmap entirely if a not
wxMSWDCImpl-derived wxDC is provided to wxBitmap::Create(size, wxDC)
overload, especially because no check is done to see if the associated
HDC is non-null for wxMSWDCImpl-derived classes.

Instead, simply create a DIB-based bitmap with the specified size, as
this seems more useful and less surprising and was already the behaviour
in the other ports.

Add a test ensuring that this remains the case in the future.
2022-04-10 19:43:29 +01:00
Artur Wieczorek
eb054c8286 Fix typo 2022-04-10 18:27:17 +02:00
Vadim Zeitlin
d08498eb16 Add wxBitmap(size, dc) ctor to all ports
Previously this ctor was only available in wxMSW and wxOSX, which was
especially strange as the equivalent Create() overload, taking wxDC, was
already available in all ports.
2022-04-10 17:17:02 +01:00
DietmarSchwertberger
7f8f2a9aa3 Fix asserts when changing columns of wxGrid using native header
The number of columns has to be changed after updating the m_colAt and
m_colWidths arrays, as the native header uses them.

This extends the changes of a2d65663a0 (Fix assert when adding columns
to wxGrid using native header., 2013-05-31) to inserting and deleting
the columns too.

See #15225.

Closes #22294.
2022-04-10 16:14:58 +02:00
Artur Wieczorek
254e1afea5 Create wxBitmap compatible with wxDC only for wxMSW
Ctor creating wxBitmap compatible with wxDC is available only for wxMSW.
2022-04-10 14:17:33 +02:00
Artur Wieczorek
891e6a26a3 Simplify wxPGPropArgCls 2022-04-10 13:43:09 +02:00
Artur Wieczorek
1a31eef189 Cleanup wxPropertyGridInterface declarations
Move definitions of GetPropertyValueAs*() functions away from class
declaration to avoid polluting the header.
2022-04-10 13:40:08 +02:00
Artur Wieczorek
ef20164efb Refactor to simplify break statements in the nested if/else blocks 2022-04-10 13:38:55 +02:00
Artur Wieczorek
69f45b31a3 Use reference instead of pointer 2022-04-10 13:37:55 +02:00
Artur Wieczorek
04bad7a720 Preserve original image in wxImageFileProperty
Rescale only the copy of the original image to preserve image quality.
2022-04-10 13:34:03 +02:00
Artur Wieczorek
6c7cf8e6d0 Simplify comparing bitmap size in wxImageFileProperty
Compare wxSize instead of comapring width and height separately.
2022-04-10 13:32:06 +02:00
Artur Wieczorek
9542e86770 Don't store wxImage/wxBitmap objects on the heap in wxImageFileProperty
To simplify managing the life cycle of the objects.
2022-04-10 13:31:14 +02:00
Artur Wieczorek
ce6123029b Don't override DoFreeze()/DoThaw() in wxPropertyGridManager
Both implementations don't add any additional features to the base
functions and therefore are not needed. wxPropertyGrid and other wxPG
controls are children of wxPropertyGridManager and DoFreeze/DoThaw calls
are forwarded directly to them in wxWindowBase::Freeze()/Thaw().

Closes #22269.
2022-04-10 13:24:35 +02:00
Vadim Zeitlin
7773c123de Merge branch 'msw-fix-focus-native-modal'
Fix focus after showing a native modal dialog in wxMSW.

See #22290.
2022-04-09 22:53:06 +02:00
Vadim Zeitlin
a5a5b1bb15 Fix restoring focus after showing native modal dialogs in wxMSW
This fixes a regression introduced in d311c705d7 (Make native dialogs
application-modal in wxMSW, 2022-04-01) which resulted in a focus loss
after showing a modal dialog, as the parent window was still disabled
when the native modal dialog was closed and so focus couldn't be set to
any of its children and was simply lost as the result.

Fix this by not disabling the dialog parent ourselves, but leaving
handling the parent status to the native modal dialog, which already
takes care of disabling the parent it uses when it is shown and
re-enabling it when it is dismissed. Still use wxWindowDisabler to
disable all the other top level windows, if any, to ensure that the
modal dialogs are truly app-modal and not just window-modal, i.e. ensure
that #11887 still remains fixed.

Closes #22285.
2022-04-07 23:43:53 +01:00
Vadim Zeitlin
717e851225 Allow to leave another window enabled in wxWindowDisabler
Allow specifying another window to "skip", i.e. not to disable, in
wxWindowDisabler.

This is not used yet, but will be in the upcoming commit.
2022-04-07 23:38:16 +01:00
Lauri Nurmi
87d6763209 Generate mouse events for Aux1, Aux2 buttons on OS X
OS X supports 5-button mice out-of-the-box.

Closes #22286.
2022-04-08 00:36:02 +02:00
Vadim Zeitlin
bc81682e7f Refactor wxWindowDisabler to allow skipping more than one window
This is not implemented yet, but this commit changes DoDisable() to
disable all windows except those in the list of the windows not to be
disabled instead of explicitly checking for just a single window to
skip.

Rename m_winDisabled to m_windowsToSkip to better describe its purpose
and also because it's a vector, and so should use plural form in its
name.

Finally note that AfterDisable() is called with NULL argument from the
ctor not taking the window to skip for compatibility with the old code,
but it's not clear if it's really the right thing to do and perhaps this
shouldn't be done.

No real changes yet.
2022-04-07 23:32:05 +01:00
AliKet
68b65c7333 Fix synthetic mouse events produced by wxAutoScrollTimer
Simplify the code translating from screen to client coordinates and make
it correct by using ScreenToClient() directly instead of emulating it
manually, which doesn't work quite right, at least in wxGTK.

Closes #22289.
2022-04-08 00:14:28 +02:00
Vadim Zeitlin
e92f8cbce8 Fix wxOSX compilation problem with older SDKs
NSArray is not fully declared otherwise, at least when using Xcode 8.3.

See #22272.
2022-04-07 17:43:30 +02:00
DietmarSchwertberger
3719ab3725 Add support for rearranging wxGrid rows order interactively
Add EnableDragRowMove() function and wxEVT_GRID_ROW_MOVE, similarly to
the existing column function and event.

Closes #22260.
2022-04-07 17:39:56 +02:00
Paul Cornett
4c375ad430 Fix wxDC::DrawRotatedText() with GTK3
Use m_sign[XY] to determine if axes are inverted, as the full device transformation
may have negative scale for things like text rotation. Broken by
eafa248117 (Avoid mirroring text when wxDC axes are inverted with GTK3, 2022-02-13)
See #22278
2022-04-06 19:22:39 -07:00
Vadim Zeitlin
e4c2298e5e Use window scale factor for all MSW wxDCs associated with windows
This ensures that we use correct font sizes with the DCs and, in
particular, fixes the font size in wxAutoBufferedPaintDC when using DPI
scaling different from 100% after the changes of e3557b8c0a (Respect
bitmap content scale factor in wxMSW wxMemoryDC, 2022-03-26).

See #22234.
2022-04-04 13:30:08 +01:00
Vadim Zeitlin
620ffa61d0 Upgrade expat submodule to fix MSVS 2010/2011 build
Use non-standard _isnan() for these compilers.
2022-04-04 12:40:22 +02:00
Tobias Hammer
9991a8b490 Enable wxCheckListBox in wxDebugReportDialog
It was wrongly guarded by wxUSE_OWNER_DRAWN but there are wxCheckListBox
implementations available for most platforms. Use correct
wxUSE_CHECKLISTBOX instead.

Closes #22263.
2022-04-03 20:14:31 +02:00
utelle
b507c97b92 Handle Windows CRT locale names in wxLocaleIdent::FromTag() too
Recognize strings returned by setlocale() when using MSVC under MSW too,
if only because it was possible to construct wxLocale using them in the
previous versions and so doing this avoids breaking the existing code.

Also don't assert in FromTag(), even if the input is incorrect, as it is
potentially user-defined (e.g. can come from environment variables under
Unix).

Closes #22247, #22252.
2022-04-02 16:45:20 +02:00
utelle
280cb68887 Add wxLanguageInfo::GetCanonicalWithRegion() helper
This simple function allows to simplify the code by avoid to test for
CanonicalRef before using either it or CanonicalName in multiple places.

No real changes.

See #22252.
2022-04-02 16:45:20 +02:00
Vadim Zeitlin
fdfb9cda1b Update zlib submodule to v1.2.12.1
This fixes a security problem (CVE-2018-25032) in it.
2022-04-01 17:56:23 +02:00
Vadim Zeitlin
d311c705d7 Make native dialogs application-modal in wxMSW
Being able to use other application windows while a modal dialog was
shown was unexpected and could easily result in nasty reentrancies, and
was also inconsistent with the behaviour of ShowModal() for the dialogs
defined in wx, so disable all the windows, not just the parent one,
while showing the native modal dialogs too.

Closes #11887.
2022-04-01 02:50:38 +02:00
Vadim Zeitlin
b2b58ee6cf Upgrade bundled Expat to the latest version
This fixes several security vulnerabilities when parsing untrusted XML
input.

Closes #22218.
2022-04-01 01:37:40 +02:00
Paul Cornett
0ac60175b0 Use wxINVERT for drawing generic wxCaret when possible
This now works after recent fixes, although wxINVERT does not
work with wxGraphicsContext-based wxDC. So this is mainly for GTK2,
only about 20 years late.
2022-03-31 08:11:27 -07:00
Paul Cornett
d51f274e1c Avoid drawing generic wxCaret outside of its bounds
Outline caret rectangle needs to be inset so that its outer
edge is the same as the solid caret when window is scaled.
2022-03-31 07:46:28 -07:00