Fix wxDataViewMainWindow::ItemAdded() when it used after
wxDataViewCtrl::AssociateModel() (it doesn't create child nodes so we should
not add child items at all to a collapsed node).
wxDataViewCtrl::AssociateModel() don't create child nodes, which leads to
missing nodes if then used wxDataViewModel::ItemAdded(). So add the test
for such situation.
wxSplitterWindow can receive multiple size events while the DPI change is being processed.
Keep using the relative sash position while the DPI change is finished.
The implementation implicitly relies, in many places, on the assumption
that the input never ends prematurely. If it does, the iterator
pointing beyond the end of buffer is dereferenced, which is UB.
The solution used here is to append 32 zero bytes to the date string,
which hopefully keeps the code more readable than checking for the end
of string before each deference operation.
Add various syntactically invalid inputs to unit tests.
Closes#22185.
Avoid using, or even mentioning in the comments, __DATE__ and __TIME__
macros as doing this prevents ccache from caching the compilation
results by default (i.e. unless CCACHE_SLOPPINESS=time_macros is used).
As ccache simply scans for the given literal strings, using "##" token
pasting operator is enough to disable this pessimization. Of course,
this does mean that using ccache with the code actually using __TDATE__
or __TTIME__ is not going to work correctly, but there should be no
reason to do it any longer and these macros are not even documented, so
also mention that they shouldn't be used.
Finally do add __DATE__ to the only place in our own code where these
macros are used to ensure that it is not cached incorrectly.
Closes#22156.
Use the same logic for creating the pages of this book control as for
all the other ones and keep only wxTreebook-specific "depth" and
"expanded" nodes handling in this class.
This struct is finally going to have to be declared in the header as it
will be needed by wxTreebookXmlHandler when it's modified to derive from
wxBookCtrlXmlHandlerBase too.
Also add GetImageId() function to the struct while moving it.
Add new wxBookCtrlXmlHandlerBase and inherit the XRC handlers of all the
wxBookCtrlBase-derived classes except for wxTreebookXmlHandler, which
will require special handling, from it to avoid duplicating the same
code in all of them.
This commit is best viewed with --color-moved git option.
This class is only implemented when wxUSE_BOOKCTRL==1 as its code uses
it, so it shouldn't be declared when wxUSE_BOOKCTRL==0 neither.
This fixes wxiOS build problem after the latest changes.
Convert wxCoTaskMemPtr<wchar_t> to wxString explicitly as doing it
implicitly required 2 user-defined conversions which is not allowed in
standard C++ (but works with MSVC).
Also get rid of a not really necessary temporary wxString variable and
just perform this case when constructing wxStringTokenizer.
Closes#22170.
Skip the event in wxEVT_SIZE handler in wxGrid and wxDataViewCtrl as it
was already done for wxListCtrl in 98c2eef619 (Fix scrollbar position in
wxListCtrl in wxUniv, 2021-09-05).
Closes#22145.
Add a menu item to the dialogs sample for simulating having unsaved
documents in the application. Then demonstrate how to do something
when the user attempts to close the application, e.g. show a dialog,
and possibly cancel closing.
This code was originally written for debugging some issue related to
closing an application, but besides that it serves as an example of a
very common pattern a lot of real world applications need in some form.
Mention the example in samples/dialogs in wxCloseEvent documentation
On recent FreeBSDs, the "Linux-only" <sys/epoll.h> exists in the default
include path, and is thus detected by configure. However, the header belongs
to the epoll-shim emulation library, and it is doubtful whether using it
on FreeBSD is a good idea. Therefore check that the operating system
is actually Linux before enabling wxEpollDispatcher.
Closes#22146.
It seems like this function sometimes doesn't return non-zero exit code
even though it fails to fetch some packages (e.g. due to a network
error), so log its status code to check if this is really the case.
This property expands to either (just) "d" (even in Unicode builds) or
nothing depending on whether we're building in debug or release and can
be used to construct the configuration-independent names for the third
party libraries, most of which use just this suffix and not wxSuffix,
which expands to "ud" in (Unicode) debug build.
This allows to use exactly the same link dependencies for both debug and
release configurations, as demonstrated by the updated minimal MSVS
project file, which is convenient when creating new projects not using
wxwidgets.props, as it allows to enter the dependencies just once and
use them for all build configurations instead of having to enter them
separately for the debug and the release ones.
Make the results look somewhat better by using wxIMAGE_QUALITY_NEAREST
which preserves sharp horizontal and vertical edges in the images which
are common in the icons, with which this function is often used, instead
of blurring them as wxIMAGE_QUALITY_HIGH does.
This is also much (factor of ~40) faster, which shouldn't hurt neither.
Check the speed of wxImage::Scale() using this algorithm too.
As expected, it's between normal and high quality when upscaling and
exactly the same as high quality when shrinking (because it is actually
the algorithm used for shrinking for wxIMAGE_QUALITY_HIGH).