msgdlg.h 2.3 KB

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