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.
Don't call EndDialog() while inside the critical section, this could
(and did, sometimes) result in a deadlock if the main thread was trying
to enter it in order to send us wxSPDD_DESTROYED notification as
EndDialog() needs it to process some messages.
If Cancel/close button was pressed twice in a row, assert checking that
the dialog state was "Continue" could be triggered, which was worse than
annoying as it resulted in a deadlock due to trying to show the assert
dialog box while holding the critical section that prevented the main
thread from continuing.
Allow the state to be either "Continue" or already be set to "Canceled"
now to account for this case.
Still assert for the other invalid states, but they really aren't
supposed to be possible here.
DoGetPosition() was done in 1ef1f8fda6,
implement DoGetSize() too now in order to give a chance Centre() (which
needs both position and size to work).
See #17768.
No real changes, just prepare for implementing DoGetSize() in this class
by extracting the common part between the existing DoGetPosition() and
it in a new function.
We can just ask for the window rectangle directly from the main thread,
there is no need to update the position in wxProgressDialogSharedData
all the time.
Remove another redundant line of code from wxGenericProgressDialog::
Create(), there is no need to call GetParentForModalDialog() again when
we just did it to initialize m_parentTop, just use the latter directly.
The line setting m_parentTop directly was mistakenly left over even
after 7e08367534 added the call to
SetTopParent() just above it.
Remove it now (better late than never), it's redundant at best and even
wrong if the top level parent can't be used as the dialog parent because
SetTopParent() checks for this but this line did not.
When the "Cancel" button inside the dialog is disabled, disable the
close title bar button as well as it serves the same purpose.
In particular, this avoids asserts when clicking the close title bar
button while showing the confirmation message box asking the user
whether the dialog should be cancelled in the dialogs sample.
This ensures the correct relationship between wxProgressDialog and its
parent window, fixing different problems with Z-order and the progress
dialog icon, but requires attaching the progress dialog thread input to
the main thread, which creates its own problems: in particular, the task
dialog is now only updated when the messages are dispatched in the main
thread, i.e. more sluggishly than before.
It also requires taking care to avoid the deadlocks as the task dialog
thread now waits for the main thread to dispatch its messages too, as
the child dialog sends messages to the parent window. In particular, we
can't simply wait for the task dialog thread to terminate, but must do
it while dispatching the events as well.
Closes#13185.
Do this for compatibility with wxGenericProgressDialog, which always did
this and can't really do otherwise as it needs to react to the clicks on
its buttons, and also because not doing it results in the other
application windows being marked as "not responding" by MSW, which looks
bad.
Closes#17768.
Acquire the lock in wxProgressDialog::DoNativeBeforeUpdate() itself
instead of relying on the caller to do it.
This is just a refactoring in preparation for further changes.
Reset the state to "Continue" instead of assigning it the dialogs own
m_state which was also set to "Continue" from the base class Resume()
called just before, but this wasn't necessarily obvious from just
reading the code.
No real changes.
Although this doesn't change anything because, by a happy concourse of
circumstances, FALSE is the same as S_OK and TRUE is the same as S_FALSE
numerically, it is still better and more clear, because consistent with
the documentation, to return these constants from the task dialog
callback function rather than boolean ones.
Check that we do have the shared data before dereferencing the pointer
to it. While this normally will always be the case, it could be null if
some error happened, so add a check for it, just as we already do it
elsewhere.
This was accidentally copy-and-pasted from another function in
1ef1f8fda6, just remove it as it was done
for the original check in the last commit but one.