When font family of a private font is retrieved with call to
Gdiplus::Font::GetFamily() then later on there is thrown access violation
exception when array of cached private font families (filled in by
Gdiplus::PrivateFontCollection::GetFamilies()) is deleted in
wxGDIPlusRenderer::Unload(). Call to Font::GetFamily() is done in
wxGDIPlusContext::GetTextExtent() so this issue can be seen once text
extent is retrieved for a private font.
Because it looks that calling to Font::GetFamily() for a private font is
messing up something in the array of cached private font families so
we should avoid calling this method and directly fetch corresponding font
family from the cache instead.
Reference to the cached font family would be stored in
the wxGDIPlusDataFont and it could be fetched from there directly instead
of making a call to Font::GetFamily().
Closes#18704.
Line height calculation based on the font size is not right for wxGTK3
because native buttons (used as in-line editor buttons) don't scale down
well and they are not displayed properly within the line.
Minimal button size when the label is displayed properly is 35 so this
has to be minimal line height under wxGTK3.
Closes#18715.
For the sake of consistency with editor buttons created with
wxPropertyGrid::GenerateEditorButton(), the borders around the buttons
should be taken into account while positioning the buttons
in wxPGMultiButton.
Check that creating a wxTextCtrl doesn't generate any events to verify
that this problem doesn't exist in other ports, after fixing it in
wxGTK in 3e7e7dd24c (Avoid generating wxEVT_TEXT when wxTextCtrl initial
value is not empty, 2020-04-01).
Because the size of the text (usually) shown in the grid changes, the
size of its columns/rows should change as well when DPI changes. Scale
them by the DPI ratio if necessary, i.e. if any of them were set to
non-default values to achieve this.
Note that this is not ideal because it can result in rounding errors and
hence in slight change of row/column size when moving the grid window to
another display with a different DPI and then back, but to prevent this
from happening we'd need to store the column/rows sizes in DIPs inside
wxGrid and convert them to actual physical pixels everywhere, which
would require much more changes. Still, if the round trip problems turn
out to be a real problem in practice, we probably will need to do this.
Also note that this doesn't take care of the grid with a native header,
but this will be addressed by upcoming commits.
This handler redoes wxGrid layout and refreshes it to at least avoid
ugly display artifacts when moving wxGrid window between displays with
different DPI.
Since the changes in a40acbb28e (Add CanOverflow function to
wxGridCellAttr, 2020-02-06), cells with non-default vertical alignment
didn't overflow any more, even if their horizontal alignment was
unchanged and still defaulted to left-aligned.
This was due to assuming that if the alignment of wxGridCellAttr itself
was different from wxALIGN_LEFT, it meant that it wasn't left-aligned,
which seems logical but is in fact false, as the alignment can also be
wxALIGN_INVALID, in which case the real alignment is taken from the
default grid attribute.
Fix this by using GetNonDefaultAlignment() to get the alignment value
effectively used and add a unit test, as well as an example in the
sample, showing that this now works correctly.
In particular, this makes default column width better suited for high
DPI displays, as it was too narrow before.
Also mark a couple of obsolete constants as such with a comment.
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.
Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
This file uses wxScopedPtr<> and so needs to include this header
explicitly instead of relying on it being included indirectly from some
other header, as happens in the default build, but not always.
Closes#18711.
Don't include wx/private/spinctrl.h header (nor the other ones) at all
in this case, as it doesn't compile in this build configuration.
This fixes one of build problems under iOS.
See https://github.com/wxWidgets/wxWidgets/pull/1773
Prevent errors and warnings when embedding the manifest.
Check if environment variable VISUALSTUDIOVERSION (set by VS developer command
prompt) is 14.0, 15.0 or 16.0.
See #18665
::ExtCreatePen() doesn't allow the pen width to be 0, unlike
::CreatePen() and failed to create the brush in this case.
Use width of 1 to draw e.g. hatched lines of width 0 correctly.
See #7097.
Use ::ExtCreatePen() for creating pens for such lines, as it results in
much better appearance for them than ::CreatePen(), which draws dashed,
and not dotted, lines in this case.
See #7097.
This has the disadvantage of not using the same accelerators in
different wxWidgets builds, but the advantage of appearing logical to a
casual user when running the sample, while having "0, 1, 3, 4" sequence
was surprising.
Alternatively, we could always add all menu items, but disable the ones
that are not available in the current build. It could be surprising to
see "GDI+" under non-MSW systems too though.
Make "Use default wxGraphicsContext" part of the renderer selection
radio group and put it in correct order, as having "1, 0, 3, 4"
accelerators order in the menu was really surprising.
Remove wxEVT_UPDATE_UI handlers as they complicated things in the sample
code (which is supposed to be simple, after all) without much benefit
and arguably even added to the confusion during run-time as menu items
could both be manually selected and checked automatically.
Explicitly include <commctrl.h> instead of relying on it being done
implicitly by wx/msw/uxtheme.h, as this doesn't happen when
wxUSE_UXTHEME is 0.
Closes#18702.
This file doesn't need to be created initially, as it will be done
automatically during the build, but it does need to be updated whenever
setup0.h changes, so explain this in both the README-GIT.md file and the
main build instructions.
Closes#18699.