There is no shrink_to_fit() in wxVector in this case.
Arguably, we shouldn't be building wxVector unit tests in STL build at
all as there is no point in testing the standard class, but OTOH it
could be useful for checking that the tests themselves are correct, so
keep them for now.
Output the maximal difference between the differing images pixels to
show just how far are they from each other, exactly. And show the image
file name as well, for convenience.
Also run all checks instead of stopping after the first failing one.
wxInvalidSize is a documented return value for wxDir::GetTotalSize(),
yet it was not available by including just wx/dir.h as it was declared
in wx/filename.h only.
Fix this by declaring it in wx/dir.h too.
Closes https://github.com/wxWidgets/wxWidgets/pull/609
When column resizing is finished, after HDN_ENDTRACK notification there is
also sent one (and last) HDN_ITEMCHANGING notification. We have to skip it
to prevent from sending EVT_HEADER_RESIZING after EVT_HEADER_END_RESIZE
because EVT_HEADER_END_RESIZE should be really the last one event
in the sequence of resizing events (like it's assumed in wxGrid).
Closes#16390.
Ever since the changes of 544c4a3bde
(almost 14 years ago), playing mono WAVs with wxSound completely failed
if setting the sound device to mono using SNDCTL_DSP_STEREO ioctl
failed. This doesn't look like a wise thing to do, so don't consider
this as a fatal failure, but just play mono as stereo (and even possibly
stereo as mono) instead.
This fixes the sound sample being broken out of the box on many (all?)
Linux systems.
The code was completely broken as it locked the mutex in only one thread
and then tried to unlock it in another one, which made no sense, didn't
protect against anything and resulted in errors and assert failures.
Fix this by locking and unlocking the mutex in both threads before
accessing shared data or playing sound.
Closes#17990.
It seems to have been replaced by wxSoundPlaybackStatus::m_playing a
long time ago but was still kept, resulting in confusion and always
returning false from IsPlaying() as it tested a wrong variable.
Fix this by removing this one completely and always using the other one
everywhere.
Also use this for wxArray::Shrink() implementation as it's more
efficient than the old swap-based implementation which requires an extra
memory allocation instead of really shrinking the existing one.
Using assign() with int (in fact, any integral type) should select the
(size_type count, const T& value) overload, but didn't, which was
incompatible with std::vector<>.
Fix this by adding the same tag-dispatching technique as used by the
real std::vector<> implementations themselves, except that we dispatch
on integer types because we can't be totally certain that
std::iterator_traits<> are specialized for whatever iterator-like object
could be used with wxVector.
Remove maximal reallocation size in wxArrayString too, as it was done
for wxVector a commit ago, and increase its size by 100% and not 50%
when it needs to grow.
There is no real reason to use different growth strategies in the two
classes and wxVector one seems to be better.
Call assign() instead of Add() in a loop: this is not only shorter, but
also ensures that reserve() is called before starting the loop and all
the required memory is allocated at once.
This dramatically pessimizes performance for large vector sizes and
doesn't actually save that much memory because all intermediate
allocations are still being used by the process, so follow stdlibc++
example and just double the allocated buffer size without limit.
Native wxMSW dialog split the provided message into the title and body
in Update(), but didn't do it for the initial message specified when
constructing the dialog, resulting in weird jumps, due to the font size
change between the body and title dialog elements, if the updated
message differed just slightly from the initial one.
Fix this and refactor the code to reuse the same function for doing this
splitting in both places.
Use TDM_UPDATE_ELEMENT_TEXT even for the initial update as this allows
to specify the message of roughly comparable (or greater) length than
the messages that will be subsequently used while the dialog is shown
and avoid size changes later, which is much more natural than having to
do it for the first call to Update().
No real changes, just don't lock a critical section for a short time
only to lock it again almost immediately after unlocking -- just combine
both blocks for which it is locked into one, there is no reason to
release it for TASKDIALOGCONFIG and wxMSWTaskDialogConfig initialization
which are both trivial operations not involving any callbacks.
Unfortunately it doesn't seem possible to prevent the native MSW dialog
from changing its size in both upper and lower direction vertically, so
at least mention this in the documentation and mention a possible
workaround of manually adjusting the text to always have the same number
of lines.
Such dialogs must be destroyed before the main event loop starts running
to avoid problems with the temporary event loop created by the dialog
internally.
See #17983.
Cut down on release archives size, somewhat, by excluding third party
libraries that we're never going to use.
The exception is libtiff which references all its files in its configure
that we do run and it's probably not worth to bother with paring it down
if this means maintaining changes to configure.
Use "git submodule foreach" to run "git archive" in all of the
submodules as well.
Also document the requirement to have GNU tar which is needed to be able
to successfully extract several concatenated tar archives.
Don't assume they're run from the directory containing them, especially
as this is not how they are shown to be invoked in the release
instructions.
Now running ./build/tools/pre-release.sh works too.
Update dates in various files before the release automatically.
Also automatically update SHA-1 of the release files both before the
release (to zero them) and afterwards (to use the correct values).
Closes https://github.com/wxWidgets/wxWidgets/pull/443
Verify that the active loop didn't change during this object lifetime as
otherwise we could deactivate a different event loop from the one we
installed.
It's still a programming error to write code which doesn't destroy
wxGenericProgressDialog early enough, but at least now "just" assert and
leak memory in this case instead of resetting the active event loop and
hanging the program.
Closes#17983.
Checking for m_progressBarMarquee is not necessary any longer, just
testing the value is enough.
Update the comments to explain why is it so.
No real changes.
This further improves the dialog usability when the main thread doesn't
update it frequently enough, as these times can be seen immediately
without having to expand the "details" part of the dialog which can be
very sluggish in this case.
It is also more consistent with the generic dialog and the behaviour of
the native dialog before 6b91c5dfab876f0f1b17d54304bfb2fda27398ef which
removed the code clearing TDF_EXPAND_FOOTER_AREA style.
Since the switch to tying the task dialog thread message queue with the
main thread, animating the progress bar didn't work well unless the
dialog was updated very frequently from the main thread and could lag
behind significantly, and confusingly for the user, otherwise.
Work around this by avoiding the progress bar animation and setting it
immediately to its real value. This works much better in practice.
Solve the same problem as was recently with hiding, instead of
overriding, Resume() in the native MSW wxProgressDialog class for all
the other methods which were also affected by it.
This is actually completely unnecessary because this is done implicitly
by Windows itself anyhow when we create the dialog with the owner window
belonging to a different thread.
Notice that this also explains why the thread input can't be detached
later.
Don't bother performing the updates if nothing was requested.
And ensure that nothing is requested even more often than it already was
by not requesting an update if the new value is the same as the old one.
This is not necessary any longer now that we use the correct parent for
the dialog window, the task dialog is centered automatically.
And unlike our own code, comctl32.dll code always puts the dialog fully
on one monitor instead of making it span two of them if the parent
window does.