From 602e2e6abb06b6aa873827de7cd26f216cf95f82 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Nov 2017 21:08:54 +0100 Subject: [PATCH] Avoid fitting wxProgressDialog to its contents on first update 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(). --- src/msw/progdlg.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index a4a444c56f..758cc1da02 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -80,7 +80,7 @@ public: m_value = 0; m_progressBarMarquee = false; m_skipped = false; - m_msgChangeElementText = TDM_SET_ELEMENT_TEXT; + m_msgChangeElementText = TDM_UPDATE_ELEMENT_TEXT; m_notifications = 0; m_parent = NULL; } @@ -106,11 +106,11 @@ public: bool m_skipped; // The task dialog message to use for changing the text of its elements: - // it's TDM_SET_ELEMENT_TEXT initially as this message should be used to - // let the dialog adjust itself to the size of its elements, but - // TDM_UPDATE_ELEMENT_TEXT later to prevent the dialog from performing a - // layout on each update, which is annoying as it can result in its size - // constantly changing. + // it is set to TDM_SET_ELEMENT_TEXT by Fit() to let the dialog adjust + // itself to the size of its elements during the next update, but otherwise + // TDM_UPDATE_ELEMENT_TEXT is used in order to prevent the dialog from + // performing a layout on each update, which is annoying as it can result + // in its size constantly changing. int m_msgChangeElementText; // Bit field that indicates fields that have been modified by the