1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/richmsgdlg.cpp
3 // Purpose: wxRichMessageDialog
4 // Author: Rickard Westerlund
7 // Copyright: (c) 2010 wxWidgets team
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
20 #include "wx/richmsgdlg.h"
22 // This will define wxHAS_MSW_TASKDIALOG if we have support for it in the
24 #include "wx/msw/private/msgdlg.h"
26 // ----------------------------------------------------------------------------
27 // wxRichMessageDialog
28 // ----------------------------------------------------------------------------
30 int wxRichMessageDialog::ShowModal()
32 #ifdef wxHAS_MSW_TASKDIALOG
33 using namespace wxMSWMessageDialog
;
35 if ( HasNativeTaskDialog() )
37 // create a task dialog
38 WinStruct
<TASKDIALOGCONFIG
> tdc
;
39 wxMSWTaskDialogConfig
wxTdc(*this);
41 wxTdc
.MSWCommonTaskDialogInit( tdc
);
44 if ( !m_checkBoxText
.empty() )
46 tdc
.pszVerificationText
= m_checkBoxText
.wx_str();
47 if ( m_checkBoxValue
)
48 tdc
.dwFlags
|= TDF_VERIFICATION_FLAG_CHECKED
;
51 // add collapsible footer
52 if ( !m_detailedText
.empty() )
53 tdc
.pszExpandedInformation
= m_detailedText
.wx_str();
55 TaskDialogIndirect_t taskDialogIndirect
= GetTaskDialogIndirectFunc();
56 if ( !taskDialogIndirect
)
59 // create the task dialog, process the answer and return it.
62 HRESULT hr
= taskDialogIndirect( &tdc
, &msAns
, NULL
, &checkBoxChecked
);
65 wxLogApiError( "TaskDialogIndirect", hr
);
68 m_checkBoxValue
= checkBoxChecked
!= FALSE
;
70 return MSWTranslateReturnCode( msAns
);
72 #endif // wxHAS_MSW_TASKDIALOG
74 // use the generic version when task dialog is't available at either
75 // compile or run-time.
76 return wxGenericRichMessageDialog::ShowModal();
79 #endif // wxUSE_RICHMSGDLG