]>
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
6 // Copyright: (c) 2010 wxWidgets team
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_MSW_PRIVATE_MSGDLG_H_
11 #define _WX_MSW_PRIVATE_MSGDLG_H_
13 #include "wx/msw/wrapcctl.h"
14 #include "wx/scopedarray.h"
16 // Macro to help identify if task dialogs are available: we rely on
17 // TD_WARNING_ICON being defined in the headers for this as this symbol is used
18 // by the task dialogs only. Also notice that task dialogs are available for
19 // Unicode applications only.
20 #if defined(TD_WARNING_ICON) && wxUSE_UNICODE
21 #define wxHAS_MSW_TASKDIALOG
24 // Provides methods for creating a task dialog.
25 namespace wxMSWMessageDialog
28 #ifdef wxHAS_MSW_TASKDIALOG
29 class wxMSWTaskDialogConfig
32 enum { MAX_BUTTONS
= 4 };
34 wxMSWTaskDialogConfig()
35 : buttons(new TASKDIALOG_BUTTON
[MAX_BUTTONS
]),
39 useCustomLabels(false)
42 // initializes the object from a message dialog.
43 wxMSWTaskDialogConfig(const wxMessageDialogBase
& dlg
);
45 wxScopedArray
<TASKDIALOG_BUTTON
> buttons
;
49 wxString extendedMessage
;
56 wxString btnCancelLabel
;
57 wxString btnHelpLabel
;
59 // Will create a task dialog with it's paremeters for it's creation
60 // stored in the provided TASKDIALOGCONFIG parameter.
61 // NOTE: The wxMSWTaskDialogConfig object needs to remain accessible
62 // during the subsequent call to TaskDialogIndirect().
63 void MSWCommonTaskDialogInit(TASKDIALOGCONFIG
&tdc
);
65 // Used by MSWCommonTaskDialogInit() to add a regular button or a
66 // button with a custom label if used.
67 void AddTaskDialogButton(TASKDIALOGCONFIG
&tdc
,
70 const wxString
& customLabel
);
71 }; // class wxMSWTaskDialogConfig
74 typedef HRESULT (WINAPI
*TaskDialogIndirect_t
)(const TASKDIALOGCONFIG
*,
75 int *, int *, BOOL
*);
77 // Return the pointer to TaskDialogIndirect(). This should only be called
78 // if HasNativeTaskDialog() returned true and is normally guaranteed to
79 // succeed in this case.
80 TaskDialogIndirect_t
GetTaskDialogIndirectFunc();
81 #endif // wxHAS_MSW_TASKDIALOG
84 // Check if the task dialog is available: this simply checks the OS version
85 // as we know that it's only present in Vista and later.
86 bool HasNativeTaskDialog();
88 // Translates standard MSW button IDs like IDCANCEL into an equivalent
89 // wx constant such as wxCANCEL.
90 int MSWTranslateReturnCode(int msAns
);
91 }; // namespace wxMSWMessageDialog
93 #endif // _WX_MSW_PRIVATE_MSGDLG_H_