When using both wxEnhMetaFileDC (used for print preview) and
wxPrinterDC, a global scale factor was applied to the graphics context
in wxGDIPlusPrintingContext ctor and this changes size of the text
rendered using size specified in point units.
To prevent this from happening, stop applying this scale factor in the
base class GetTextExtent() and apply it instead when setting fonts in
the derived wxGDIPlusPrintingContext only. This ensures that the results
are consistent between GetTextExtent() and DrawText() and also keeps
the font scale hack entirely in wxGDIPlusPrintingContext without
affecting the base class.
It's still not totally clear why do we have to do this at all even
although we specify the font sizes in UnitPoint units which ought to be
DPI-independent -- but somehow are not. But at least the output is
correct now and the code is arguably more clear than before.
This fixes a regression with text size when printing or previewing
introduced by d5020362ffCloses#18338.
These checks are already performed in wx/chkconf.h and don't need to be
redone here, especially incorrectly (testing for "!wxUSE_FILESYSTEM"
inside "#if wxUSE_FILESYSTEM" is useless).
Don't always call several GDI+ functions when we often don't need their
results: only retrieve the cell descent, ascent and the line spacing if
we are going to really use any of these values.
The function BitmapFromRGBAImage in PlatWX.cpp is currently only
used when wxHAS_RAW_BITMAP is defined. Consequently some functions in
PlatWX.cpp simply do nothing when wxHAS_RAW_BITMAP is not defined. This
provides a second implementation of the function based on wxImage that
is used when wxHAS_RAW_BITMAP is not defined.
Recent commits 8fbca5cb70 and c68e5d0617 fixed some typos is the
documentation for wxSTC. Unfortunatly these changes will be lost the
next time the wxSTC files are regenerated. This commit modifies
stc.interface.h.in and gen_docs.py to ensure that these changes are
preserved when the wxSTC files are regenerated.
It seems wrong to have this function in wxGraphicsContext only and not
in wxGraphicsRenderer, as this makes it impossible to create a context
associated with a non-default renderer while it doesn't cost us anything
to allow doing this.
Don't let wxNotebook created in the recently added test for the events
generated when adding pages to it continue to live after the test end as
this breaks the subsequent tests using wxUIActionSimulator (but only
when using MinGW, for some reason).
There were many dozens of such warnings given for the various arrays
used in the tests and it just doesn't seem feasible nor desirable to fix
them all, so just suppress the warnings for all these arrays to get rid
of them with recent (7+?) versions of gcc.
The original drawing mechanism was generating lots of QWarning messages
when running samples (e.g. htlbox, caret, etc.) and in some cases was
not actually completely drawing every element of the sample. The issue
was that the QPicture was being shared incorrectly between wxWindow and
wxClientDC and attempts to start painting, update, etc. were generating
console warnings.
Closes https://github.com/wxWidgets/wxWidgets/pull/1152
No real changes, just a refactoring to avoid duplicating the code
handling wxTE_READONLY and the alignment styles between multi- and
single-line versions.
Also avoid testing for "style & wxTE_LEFT" as this will never be true
anyhow.
See https://github.com/wxWidgets/wxWidgets/pull/1211
wxSlider and widgets samples improvements:
- Document `wxSL_BOTH` style of `wxSlider`.
- Centre labels above and below vertical `wxSlider`. Improve label
position for specific combinations of `wxSlider` styles.
- Improve `wxSlider` in high DPI. Make thumb and tick size DPI
dependent.
- Better fix layout of `wxSlider` labels after changing value range.
Commit 0b821ad did not (always) trigger a call to `DoMoveWindow`. See
[#17093](https://trac.wxwidgets.org/ticket/17093).
- Fix `wxSlider::SetThumbLength()` on `wxMSW`. It requires
`TBS_FIXEDLENGTH` style. Use `GetThumbLength()` instead of the
arbitrary defined `THUMB` size.
- Improve guards in button pages of widgets sample.
- Use `wxSizerFlags` for slider page in widgets sample.
- Some fixes for `wxSlider` in widgets sample
- Correctly save the slider value before recreating the slider.
- Layout the entire page instead of only the slider sizer.
- Update the text controls after recreating the slider.
- Always enable 'both sides' checkbox. It has additional effects in
`wxMSW`.
- Demonstrate `wxSlider::SetSelection()` in widgets sample.
See https://github.com/wxWidgets/wxWidgets/pull/1208
To get access to the control used for editing items, we need to create
it ourselves, which involves defining our own factory for doing this,
but seems to be the only way of achieving our goal.
Closes https://github.com/wxWidgets/wxWidgets/pull/1204
Hide the window explicitly once it's created. This is not very useful,
as the real purpose of calling Hide() before Create() is to prevent the
window from being initially shown at all to avoid flicker, but better
than not hiding it at all.
Closes https://github.com/wxWidgets/wxWidgets/pull/1203