]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/msgdlg.h
45db8702e73e8132654e463cb14dc6ed717948db
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 enum { MAX_BUTTONS
= 4 };
35 wxMSWTaskDialogConfig()
36 : buttons(new TASKDIALOG_BUTTON
[MAX_BUTTONS
]),
40 useCustomLabels(false)
43 // initializes the object from a message dialog.
44 wxMSWTaskDialogConfig(const wxMessageDialogBase
& dlg
);
46 wxScopedArray
<TASKDIALOG_BUTTON
> buttons
;
50 wxString extendedMessage
;
57 wxString btnCancelLabel
;
58 wxString btnHelpLabel
;
60 // Will create a task dialog with it's paremeters for it's creation
61 // stored in the provided TASKDIALOGCONFIG parameter.
62 // NOTE: The wxMSWTaskDialogConfig object needs to remain accessible
63 // during the subsequent call to TaskDialogIndirect().
64 void MSWCommonTaskDialogInit(TASKDIALOGCONFIG
&tdc
);
66 // Used by MSWCommonTaskDialogInit() to add a regular button or a
67 // button with a custom label if used.
68 void AddTaskDialogButton(TASKDIALOGCONFIG
&tdc
,
71 const wxString
& customLabel
);
72 }; // class wxMSWTaskDialogConfig
75 typedef HRESULT (WINAPI
*TaskDialogIndirect_t
)(const TASKDIALOGCONFIG
*,
76 int *, int *, BOOL
*);
78 // Return the pointer to TaskDialogIndirect(). This should only be called
79 // if HasNativeTaskDialog() returned true and is normally guaranteed to
80 // succeed in this case.
81 TaskDialogIndirect_t
GetTaskDialogIndirectFunc();
82 #endif // wxHAS_MSW_TASKDIALOG
85 // Check if the task dialog is available: this simply checks the OS version
86 // as we know that it's only present in Vista and later.
87 bool HasNativeTaskDialog();
89 // Translates standard MSW button IDs like IDCANCEL into an equivalent
90 // wx constant such as wxCANCEL.
91 int MSWTranslateReturnCode(int msAns
);
92 }; // namespace wxMSWMessageDialog
94 #endif // _WX_MSW_PRIVATE_MSGDLG_H_