Don't run 8 builds for all combinations of arch/debug/C++ dialect but
just a few of them covering all of the possibilities.
Also add a static universal build which is what is commonly used for
distributing software using wxWidgets under Mac.
Define various macros used in the test code (or in the headers included
from it) as nothing when wxDEBUG_LEVEL==0.
Also don't define a helper function used when asserts are enabled in
this build to avoid clang warnings about unused function.
Call this file consistently with the other CI files and also ignore all
of the other files in each workflow to avoid unnecessary rebuilds.
Finally, remove a leftover mention of Travis file which doesn't exist
any longer.
Work around what seems like a bug in StretchBlt() implementation by
applying an extra offset to it when using RTL layout and revert an
earlier attempt to fix this problem for wxMemoryDC used in wxNotebook
code from 6614aa496d (fix for tabs drawing in RTL (patch 1552881),
2006-10-21).
Closes#19190.
In a756ed93c2 (wxWebViewEdge: Improve wxEVT_WEBVIEW_LOADED, 2021-08-17)
usage of additional interfaces was added. This adds their interface IDs
for non VISUALC compilers.
Also sorted the definitions alphabetically, use "--color-moved" git
option to see the actual changes.
Closes https://github.com/wxWidgets/wxWidgets/pull/2472
This change slightly modifies the parent commit by avoiding an
unnecessary copy of wxFont which, while cheap, is not quite free and
can be easily avoided here.
See https://github.com/wxWidgets/wxWidgets/pull/2471
If wxTextMeasure is constructed without a font and the base version of
DoGetPartialTextExtents() gets used then there's a crash due to
dereferencing a null pointer. To fix, simply use GetFont() like
elsewhere to get the effective font used.
To fix another null pointer dereference crash don't call
wxTextMeasure::DoGetTextExtent() with null height pointer, as it
requires that both width and height pointers are non-null since
8cd79b7af0 (Factor out text measurement from wxDC and wxWindow into
wxTextMeasure., 2012-10-18), but not for all back-ends any longer since
d76774b444 (Don't dereference NULL output pointer in wxTextMeasure.,
2012-11-25).
There currently appears to be no code in wx that would result in either
crash. For Windows both crashes can be artificially reproduced with
the render sample (requiring static linking with wx due to using private
wxTextMeasure) when using the GDI+ renderer along with the patch:
diff --git a/samples/render/render.cpp b/samples/render/render.cpp
index 6bae34781b..bc4f8d405b 100644
--- a/samples/render/render.cpp
+++ b/samples/render/render.cpp
@@ -34,6 +34,7 @@
#include "wx/image.h"
#endif
+#include "wx/private/textmeasure.h"
#include "wx/apptrait.h"
#include "wx/artprov.h"
#include "wx/renderer.h"
@@ -209,6 +210,10 @@ private:
wxGraphicsContext* ctx = m_renderer->CreateContext(pdc);
gdc.SetBackground(GetBackgroundColour());
gdc.SetGraphicsContext(ctx);
+
+ wxTextMeasure txm(&gdc);
+ wxArrayInt widths;
+ txm.GetPartialTextExtents("a", widths, 1.0);
}
wxDC& dc = m_renderer ? static_cast<wxDC&>(gdc) : pdc;
Closes https://github.com/wxWidgets/wxWidgets/pull/2471
Remove conditions from MSW themed text drawing that prevent multi-lines
from being rendered properly and instead always use DT_TOP alignment
for multi-lines.
This fixes a regression occurring since 90ba137f20 (Work around text
extent differences resulting in clipped text, 2021-07-26) with themed
Vista+ :
Non-top aligned multi-line text gets rendered as a single line because
of DT_SINGLELINE being used if the height of the drawing rect and
multi-line text happen to be equal. This occurs on the "Variable line
height" page of the dataview sample, which calculates its cell height
by multiplying the text extent by the number of lines in the text (a
requirement with wxMSW, not wxGTK).
Removing the conditions also exposes top aligned multi-line themed text
to drawing beyond the drawing rect, which actually makes it behave more
like wxGTK and wxOSX as well as wxMSW non-themed drawing as they try to
render text fully without regard for the bounds of the drawing rect.
Closes https://github.com/wxWidgets/wxWidgets/pull/2470
It seems unlikely that we're ever going to need this function in any
other classes inheriting from wxTextEntry (i.e. wxComboBox) and both
existing implementations are for wxTextCtrl only, so define this
function there.
If really necessary, we can always lower it to wxTextEntry later, while
moving it in the other direction wouldn't be easily possible due to
compatibility concerns.
This commit is best viewed with git --color-moved option.
This allows each control have its own undo history, independent of the
other ones, as expected by the wx API, rather than using an undo manager
shared by all controls in the same TLW.
We need to reset the default button using DM_SETDEFID too, otherwise
calling DM_SETDEFID later, when setting the new default button, seems to
restore BS_DEFPUSHBUTTON on the previous default button (but only if its
ID is positive, which probably explains why this bug went unnoticed for
so long), resulting in having 2 buttons with BS_DEFPUSHBUTTON in the
dialog.
Closes#19245.
This commit is best viewed ignoring whitespace-only changes.
Previously the edge event ContentLoading was used which was
triggered earlier than DOMContentLoaded. This event wasn't
available in earlier SDK versions.
Minimum required SDK version is now:
1.0.705.50 (Released 2021-01-25)
Fixes#19202
See https://github.com/wxWidgets/wxWidgets/pull/2468
It doesn't cost us anything to define the compatible names, and there is
no real advantage for the existing application code in using the new
names, so define them without WXWIN_COMPATIBILITY_X_Y checks around
them, to avoid forcing unnecessary changes in the application code when
upgrading to wx 3.2.0.
This commit is best viewed ignoring whitespace-only changes.
Set width of the new columns to wxLIST_DEFAULT_COL_WIDTH and not 0 in
the generic version: this is more compatible with the MSW version and
more useful.
Document that omitting list column width in XRC results in columns of
default, rather than null, as previously, width.
The same value of 80px was used in both the generic and MSW versions of
wxListCtrl, so introduce a symbolic name for it and define it only once,
similarly to how it's already done for wxDVC_DEFAULT_WIDTH and
WXGRID_DEFAULT_COL_WIDTH.
No real changes.
Under MSW creating a wxSpinCtrl with a range of, say, 1..10 and the
default initial value of 0 sets its initial value to 1 (i.e. the closest
valid value) as expected, but the generic version still set it to the
invalid value of 0, which was unexpected, inconsistent and not useful.
Fix the generic version to follow MSW behaviour now and add a test
checking for this.
These files use TABs for indentation, so the standard check doesn't work
for them (and it doesn't seem worth having a special check just for
them neither, so simply don't check them at all).
Remove this bundle key from the generic Info.plist files as it's not
really useful there because none of our samples except "internat" is
localized.
So just add a special Info.plist for this sample and add values
corresponding to all the languages for which we have translations to its
CFBundleLocalizations.
The documented name of the bundle version variable has BUNDLE twice, see
https://cmake.org/cmake/help/latest/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
and samples/Info.plist.in uses this variable, but we set
MACOSX_BUNDLE_VERSION instead, which seems wrong, so use the apparently
correct variable name instead.
Also update inc_year script to update them automatically the next time,
to prevent them from becoming 3 (for one, or 13 for the other one) years
out of date again.