]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/msgdlg.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/private/msgdlg.h
3 // Purpose: helper functions used with native message dialog
4 // Author: Rickard Westerlund
7 // Copyright: (c) 2010 wxWidgets team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_PRIVATE_MSGDLG_H_
12 #define _WX_MSW_PRIVATE_MSGDLG_H_
14 #include "wx/msw/wrapcctl.h"
15 #include "wx/scopedarray.h"
17 // Macro to help identify if task dialogs are available: we rely on
18 // TD_WARNING_ICON being defined in the headers for this as this symbol is used
19 // by the task dialogs only. Also notice that task dialogs are available for
20 // Unicode applications only.
21 #if defined(TD_WARNING_ICON) && wxUSE_UNICODE
22 #define wxHAS_MSW_TASKDIALOG
25 // Provides methods for creating a task dialog.
26 namespace wxMSWMessageDialog
29 #ifdef wxHAS_MSW_TASKDIALOG
30 class wxMSWTaskDialogConfig
33 wxMSWTaskDialogConfig()
34 : buttons(new TASKDIALOG_BUTTON
[3]),
38 useCustomLabels(false)
41 // initializes the object from a message dialog.
42 wxMSWTaskDialogConfig(const wxMessageDialogBase
& dlg
);
44 wxScopedArray
<TASKDIALOG_BUTTON
> buttons
;
48 wxString extendedMessage
;
55 wxString btnCancelLabel
;
57 // Will create a task dialog with it's paremeters for it's creation
58 // stored in the provided TASKDIALOGCONFIG parameter.
59 // NOTE: The wxMSWTaskDialogConfig object needs to remain accessible
60 // during the subsequent call to TaskDialogIndirect().
61 void MSWCommonTaskDialogInit(TASKDIALOGCONFIG
&tdc
);
63 // Used by MSWCommonTaskDialogInit() to add a regular button or a
64 // button with a custom label if used.
65 void AddTaskDialogButton(TASKDIALOGCONFIG
&tdc
,
68 const wxString
& customLabel
);
69 }; // class wxMSWTaskDialogConfig
72 typedef HRESULT (WINAPI
*TaskDialogIndirect_t
)(const TASKDIALOGCONFIG
*,
73 int *, int *, BOOL
*);
75 // Return the pointer to TaskDialogIndirect(). This should only be called
76 // if HasNativeTaskDialog() returned true and is normally guaranteed to
77 // succeed in this case.
78 TaskDialogIndirect_t
GetTaskDialogIndirectFunc();
79 #endif // wxHAS_MSW_TASKDIALOG
82 // Check if the task dialog is available: this simply checks the OS version
83 // as we know that it's only present in Vista and later.
84 bool HasNativeTaskDialog();
86 // Translates standard MSW button IDs like IDCANCEL into an equivalent
87 // wx constant such as wxCANCEL.
88 int MSWTranslateReturnCode(int msAns
);
89 }; // namespace wxMSWMessageDialog
91 #endif // _WX_MSW_PRIVATE_MSGDLG_H_