Commit Graph

41736 Commits

Author SHA1 Message Date
Randalphwa
addbc940c0 Update wxCommandLinkButtonXmlHandler
Adds missing bitmap specifications, removes unusable button styles.

Closes #22475.
2022-06-01 15:47:03 +02:00
Vadim Zeitlin
495e9b99cd Don't update wxBitmapComboBox bitmaps size if there are none
Correct the changes of 212d59cd80 (Fix determining the size of
wxBitmapComboBox bitmaps, 2022-05-25) and avoid changing m_usedImgSize
if we have no bitmaps at all, as it happens when adding the very first
bitmap: in this case, we set m_usedImgSize in our OnAddBitmap() before
actually adding the bitmap to m_bitmapbundles in DoInsertItems() called
from the base class Append() or Insert(), and wxMSW implementation calls
RecreateControl() from its overridden OnAddBitmap() which results in a
call to UpdateInternals() in between them.

All this is rather confusing and it would arguably be better to avoid
setting m_usedImgSize until the bitmap is actually added to
m_bitmapbundles, but this would require further changes, so for now just
avoid setting m_usedImgSize to (0, 0).
2022-06-01 15:40:17 +02:00
Vadim Zeitlin
731d29bace Move wxBitmapBundle::Clear() out of line
Ensure that wxBitmapBundleImpl full declaration is available when it is
compiled, at least OpenVMS compiler has trouble with compiling the call
to reset(), which involves using wxBitmapBundleImpl dtor, if it comes
before this class declaration.
2022-05-31 14:46:44 +02:00
Randalphwa
8f735c695b Support more styles, bitmaps, margins in wxToggleButtonXmlHandler
Add missing styles, bitmaps, and margin property.

Closes #22474.
2022-05-30 23:54:47 +02:00
Artur Wieczorek
473c88885c Don't call obsolete function in wxPropertyGridPageState
wxPropertyGridPageState::GetColumnFitWidth(wxDC&, ...) shouldn't be called
when WXWIN_COMPATIBILITY_3_0 is not set.
2022-05-30 20:23:44 +02:00
Artur Wieczorek
b21de21fa3 Don't call obsolete function in wxPropertyGridPageState
wxPropertyGridPageState::GetColumnFitWidth(wxDC&, ...) shouldn't be called
when WXWIN_COMPATIBILITY_3_0 is not set.
2022-05-30 20:07:57 +02:00
Artur Wieczorek
2dfe57419a Don't call obsolete function in wxPropertyGridManager
wxPropertyGridPageState::GetColumnFitWidth(wxDC&, ...) is not available
when WXWIN_COMPATIBILITY_3_0 is not set.
2022-05-30 19:51:54 +02:00
Artur Wieczorek
b72a742b21 Decouple wxPropertyGridPageState from wxDC
Reimplement functions to calculate column widths to do that without
referring to wxClientDC.
2022-05-30 19:17:37 +02:00
Artur Wieczorek
11201bc1ce Iterate over wxVector using iterator 2022-05-30 19:17:02 +02:00
Artur Wieczorek
9267a49598 Get rid of redundant assignments
eventType and eventObject are already set during wxCommandEvent
initialization.
2022-05-30 19:16:27 +02:00
Artur Wieczorek
982a720069 Use ctor initializer list to initialize data members 2022-05-30 19:15:36 +02:00
Artur Wieczorek
c09f1c258b Use conditional operators to simplify statements 2022-05-30 19:14:46 +02:00
Stefan Csomor
84c3c8fd8f avoid problem with disappearing modal child windows when dragged to a different space
fixes #22242
2022-05-30 18:51:44 +02:00
Randalphwa
6ce81acda8 Add digits property to wxSpinCtrlDoubleXmlHandler
This makes it possible to set the precision of the number
without changing the increment amount.

Closes #22470.
2022-05-30 17:53:43 +02:00
Randalphwa
d9f36adc8f Minor fixes to wxRichTextCtrlXmlHandler code and docs
Fix the example showing how to use it in the docs.

Don't use "maxlength" property for this control, as it's ignored by it
anyhow.

Closes #22467.
2022-05-30 17:52:14 +02:00
Vadim Zeitlin
5b078655ed Merge branch 'stc-dip' of https://github.com/MaartenBent/wxWidgets
Use correct wxBitmap size for STC.

See #22465.
2022-05-30 17:51:00 +02:00
Vadim Zeitlin
1da8377f17 Declare wxBitmap in smaller scope in wxWizard DPI change handler
No real changes, just avoid creating wxBitmap unnecessarily and only do
it if we're really going to use it.
2022-05-30 17:36:23 +02:00
Vadim Zeitlin
c3359c17b7 Fix crash in wxAizrd on DPI change before adding the first page
Fix a problem introduced in 429b5561ff (Use wxBitmapBundle in wxWizard,
2022-02-10), see #22124, by adding a check for the current page being
non-null before using it.

Closes #22471.
2022-05-30 17:34:46 +02:00
Paul Cornett
0b33e08dfe Fix dropdown arrow disabled appearance with GTK3
See #22431
2022-05-29 06:54:44 -07:00
Maarten Bent
31de97a2c6 Use correct wxBitmap size for STC
Create the wxBitmap in the expected physical size to fix rendering artifacts.
CreateWithDIPSize cannot be used because when it scales the DIP size, it could
be off-by-one.

Remove obsolete mdc->GetImpl()->SetWindow(), this is not needed anymore because
the DPI is now determined from the associated bitmap content scale factor, and
not from the wxWindow.

See #22450
2022-05-28 22:06:29 +02:00
Maarten Bent
655afd6030 Fix wxBitmap::SetScaleFactor on macOS
The internal scale representation has to be changed using CGContextScaleCTM.
2022-05-28 22:06:25 +02:00
Artur Wieczorek
af3c222b69 Cast \0 explicitly to wxUniChar 2022-05-27 19:24:36 +02:00
Artur Wieczorek
2855ec1e88 Make data member mutable to avoid const_casts 2022-05-27 19:13:44 +02:00
Artur Wieczorek
2b4135ba14 Use conditional operators to simplify statements 2022-05-27 19:13:43 +02:00
Artur Wieczorek
1c49b89b89 Declare variable inside loop 2022-05-27 19:13:43 +02:00
Artur Wieczorek
beb311ed96 Don't call overridable methods in ctor 2022-05-27 19:13:42 +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
334a8c70ec Use conditional operators to simplify statements 2022-05-27 19:13:42 +02:00
Artur Wieczorek
92d7176ebe Fix clearing wxPropertyGridPage
When all wxPGProperties on the page are deleted the pointer
to wxPGProperty that has mouse hovering in wxPropertyGrid
has to be reset.

Closes #22428.
2022-05-27 19:13:41 +02:00
valid-ptr
e777a82bfd Fix AUI floating position mismatch
Ensure that the owner idea of the floating frame position always matches
reality -- which could be not the case before if we returned before
updating it.

This commit is best viewed with git --color-moved
--color-moved-ws=ignore-all-space options.

Closes #22458.
2022-05-27 18:23:05 +02:00
hwiesmann
029b99e9d7 Fix bad regression in wxDataViewBitmapRenderer under Mac
Correct the wrong wxVariant type check in 8d3e7fd346 (Accept
wxBitmapBundle in wxDataViewBitmapRenderer too, 2022-05-08) and actually
verify that we have a wxBitmapBundle, not a wxBitmap, before accessing
it.

See #22411, #22460.
2022-05-27 15:30:08 +02:00
Vadim Zeitlin
a25824bc91 Fix wxIPV6address initialization
Use DoInitImpl() which, somehow, was never used before, meaning that,
apparently, wxIPV6address never worked at all, as objects of this type
were still initialized to use FAMILY_INET (i.e. IPv4 address family).

Closes #22463.
2022-05-27 15:26:26 +02:00
Vadim Zeitlin
212d59cd80 Fix determining the size of wxBitmapComboBox bitmaps
Instead of using the size of the first item bitmap, use the size best
suited for all the bitmaps, which may result in better appearance if the
different bitmaps are not all available in the same sizes.

This also fixes the unit test after 80a736250e (Fix margin between
wxBitmapComboBox images and text in high DPI, 2022-05-25) and should
have been part of it.
2022-05-25 22:18:43 +02:00
Randalphwa
76d1b3c9a9 Extend wxBitmap XRC handler to support all button attributes
Add support for the missing wxBU_NOTEXT style, bitmaps for the other
than default states (pressed, focus, disabled and current) and margins
to wxBitmapXmlHandler.

Note that the images for the other states were previously already
supported by wxBitmapButton XRC handler, but not by the wxBitmap one,
even though both bitmap classes support them.

Closes #22451.
2022-05-25 15:33:31 +02:00
Maarten Bent
4f8b49ca43 Create backing bitmap with correct scale factor in wxSTC
Using GetContentScaleFactor() worked just fine for wxOSX and wxGTK,
where it's the same as GetDPIScaleFactor() anyhow, and, until recently,
didn't matter for wxMSW where the scale factor was just ignored.

However since 9e5c8a8027 (Respect bitmap content scale factor in wxMSW
wxMemoryDC, 2022-03-26) it is important to specify the actually correct
scale factor when creating the backing bitmap in wxSTC code, as
otherwise wxMemoryDC would try to compensate for it by rescaling the
font, which should be unnecessary and resulted in a very noticeable
performance regression.

Simply using GetDPIScaleFactor() fixes the problem for wxMSW without
affecting the other platforms.

Closes #22450.
2022-05-25 15:26:59 +02:00
Maarten Bent
80a736250e Fix margin between wxBitmapComboBox images and text in high DPI
Don't use FromDIP() with m_usedImgSize which is expressed in logical,
and not DPI-independent, pixels already and also update the image size
when the DPI changes.

Closes #22436.
2022-05-25 15:22:15 +02:00
valid-ptr
76797ab9e1 Fix calling wxGTK wxDropTarget::GetMatchingPair() from OnData()
This function didn't work at all in this case because the drag context
wasn't set in target_drag_data_received(), unlike in all the other
callbacks.

Do set it here too to fix it, this notably makes dropping data on
generic wxDataViewCtrl work correctly in wxGTK.

Closes #22453.
2022-05-25 15:11:12 +02:00
DietmarSchwertberger
0dc9b292fe Fix regression in wxGrid row/col dragging to corner label
Recent changes to wxGrid (see #22292) resulted in an assertion being
triggered when dragging row or column to the corner window. Fix this by
adding a check for the new position validity.

Closes #22432.

Closes #22443.
2022-05-23 22:28:10 +01: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
c5f64e0509 Fix showing fully fully transparent bitmaps in wxMSW wxImageList
This was broken by 6feeed9fe9 (Handle transparency to the best of our
ability in wxImageList, 2022-05-05) as using alpha, rather than mask,
for these images resulted in alpha channel being just ignored.

Work around this by making at least one pixel not quite transparent in
this case.

This also makes things work for images using alpha channel with only 0
values, rather than mask covering the entire bitmap.

See #22400.

Closes #22437.
2022-05-23 22:24:41 +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
Vadim Zeitlin
fc0a4d4e62 Correct client/window confusing in wxPreviewFrame code
Pass the window size to SetSizeHints() to make sure the window minimum
size is set as expected.
2022-05-23 15:07:06 +01:00
Artur Wieczorek
d90cb7511b Change the order of data member initializers
To suppress compiler warning that the order of member initializers
does not match the order in which they are executed.
2022-05-21 22:54:27 +02:00
Artur Wieczorek
a292ebe6ae Change the order of data member initializers
To suppress compiler warning that the order of member initializers
does not match the order in which they are executed.
2022-05-21 22:41:14 +02:00
Artur Wieczorek
e772cb1907 Use NULL literal to represent null pointer 2022-05-21 22:08:35 +02: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
d872229be3 Get rid of redundant casts 2022-05-21 22:05:12 +02:00