]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/private/messagetype.h
remove empty GtkTreeEntryClass
[wxWidgets.git] / include / wx / gtk / private / messagetype.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/private/messagetype.h
3 // Purpose: translate between wx and GtkMessageType
4 // Author: Vadim Zeitlin
5 // Created: 2009-09-27
6 // RCS-ID: $Id$
7 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _GTK_PRIVATE_MSGTYPE_H_
12 #define _GTK_PRIVATE_MSGTYPE_H_
13
14 #include <gtk/gtk.h>
15
16 namespace wxGTKImpl
17 {
18
19 // Convert the given wx style to GtkMessageType, return true if succeeded or
20 // false if failed.
21 inline bool ConvertMessageTypeFromWX(int style, GtkMessageType *type)
22 {
23 #ifdef __WXGTK210__
24 if ( gtk_check_version(2, 10, 0) == NULL && (style & wxICON_NONE))
25 *type = GTK_MESSAGE_OTHER;
26 else
27 #endif // __WXGTK210__
28 if (style & wxICON_EXCLAMATION)
29 *type = GTK_MESSAGE_WARNING;
30 else if (style & wxICON_ERROR)
31 *type = GTK_MESSAGE_ERROR;
32 else if (style & wxICON_INFORMATION)
33 *type = GTK_MESSAGE_INFO;
34 else if (style & wxICON_QUESTION)
35 *type = GTK_MESSAGE_QUESTION;
36 else
37 return false;
38
39 return true;
40 }
41
42 } // namespace wxGTKImpl
43
44 #endif // _GTK_PRIVATE_MSGTYPE_H_
45