]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/msgdlg.h
more avoiding direct struct access
[wxWidgets.git] / include / wx / cocoa / msgdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/msgdlg.h
3 // Purpose: wxMessageDialog class
4 // Author: Gareth Simpson
5 // Created: 2007-10-29
6 // RCS-ID: $Id$
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_COCOA_MSGDLG_H_
11 #define _WX_COCOA_MSGDLG_H_
12
13 #include "wx/msgdlg.h"
14
15 DECLARE_WXCOCOA_OBJC_CLASS(NSAlert);
16
17 #ifndef wxUSE_COCOA_NATIVE_MSGDLG
18 // trunk: Always use Cocoa dialog
19 // 2.8: Only use Cocoa dialog if ABI incompatible features is on
20 // Build both on both branches (there was no wxCocoaMessageDialog class so it's not an ABI issue)
21 #if 1/* wxUSE_ABI_INCOMPATIBLE_FEATURES */
22 #define wxUSE_COCOA_NATIVE_MSGDLG 1
23 #else
24 #define wxUSE_COCOA_NATIVE_MSGDLG 0
25 #endif
26 #endif
27
28 #if wxUSE_COCOA_NATIVE_MSGDLG
29 #define wxMessageDialog wxCocoaMessageDialog
30 #else
31 #include "wx/generic/msgdlgg.h"
32
33 #define wxMessageDialog wxGenericMessageDialog
34 #endif
35
36 // ----------------------------------------------------------------------------
37 // wxCocoaMessageDialog
38 // ----------------------------------------------------------------------------
39
40
41 class WXDLLIMPEXP_CORE wxCocoaMessageDialog
42 : public wxMessageDialogWithCustomLabels
43 {
44 public:
45 wxCocoaMessageDialog(wxWindow *parent,
46 const wxString& message,
47 const wxString& caption = wxMessageBoxCaptionStr,
48 long style = wxOK|wxCENTRE,
49 const wxPoint& pos = wxDefaultPosition);
50
51 virtual int ShowModal();
52
53 protected:
54 // not supported for message dialog
55 virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
56 int WXUNUSED(width), int WXUNUSED(height),
57 int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
58
59 // override wxMessageDialogWithCustomLabels method to get rid of
60 // accelerators in the custom label strings
61 //
62 // VZ: I have no idea _why_ do we do this but the old version did and
63 // I didn't want to change the existing behaviour
64 virtual void DoSetCustomLabel(wxString& var, const ButtonLabel& label);
65
66 DECLARE_DYNAMIC_CLASS(wxCocoaMessageDialog)
67 wxDECLARE_NO_COPY_CLASS(wxCocoaMessageDialog);
68 };
69
70 #endif // _WX_MSGDLG_H_
71