From 04a00346c6d88d9849e138e7cba4cc189a1ed218 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Jul 2011 11:59:43 +0000 Subject: [PATCH] Don't create an unnecessary extra button in wxMSW wxProgressDialog. MSWCommonTaskDialogInit() now (probably since r67620) always creates a IDCANCEL button so don't create another one in wxProgressDialog code, just ensure that the one created by that function has the correct label (either "Cancel" or "Close"). Closes #13358. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/progdlg.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 254fa00679..a39706ed29 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -761,6 +761,11 @@ void* wxProgressDialogTaskRunner::Entry() wxTdc.caption = m_sharedData.m_title.wx_str(); wxTdc.message = m_sharedData.m_message.wx_str(); + // MSWCommonTaskDialogInit() will add an IDCANCEL button but we need to + // give it the correct label. + wxTdc.btnOKLabel = m_sharedData.m_labelCancel; + wxTdc.useCustomLabels = true; + wxTdc.MSWCommonTaskDialogInit( tdc ); tdc.pfCallback = TaskDialogCallbackProc; tdc.lpCallbackData = (LONG_PTR) &m_sharedData; @@ -769,16 +774,9 @@ void* wxProgressDialogTaskRunner::Entry() tdc.dwFlags &= ~TDF_EXPAND_FOOTER_AREA; // Expand in content area. tdc.dwCommonButtons = 0; // Don't use common buttons. - wxTdc.useCustomLabels = true; - if ( m_sharedData.m_style & wxPD_CAN_SKIP ) wxTdc.AddTaskDialogButton( tdc, Id_SkipBtn, 0, _("Skip") ); - // Use a Cancel button when requested or use a Close button when - // the dialog does not automatically hide. - wxTdc.AddTaskDialogButton( tdc, IDCANCEL, 0, - m_sharedData.m_labelCancel ); - tdc.dwFlags |= TDF_CALLBACK_TIMER | TDF_SHOW_PROGRESS_BAR; if ( !m_sharedData.m_expandedInformation.empty() ) -- 2.45.2