]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/private/messagetype.h
Avoid calling gtk_window_get_position() from "configure-event" handler, if possible.
[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 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _GTK_PRIVATE_MSGTYPE_H_
11 #define _GTK_PRIVATE_MSGTYPE_H_
12
13 #include <gtk/gtk.h>
14
15 namespace wxGTKImpl
16 {
17
18 // Convert the given wx style to GtkMessageType, return true if succeeded or
19 // false if failed.
20 inline bool ConvertMessageTypeFromWX(int style, GtkMessageType *type)
21 {
22 #ifdef __WXGTK210__
23 if ( gtk_check_version(2, 10, 0) == NULL && (style & wxICON_NONE))
24 *type = GTK_MESSAGE_OTHER;
25 else
26 #endif // __WXGTK210__
27 if (style & wxICON_EXCLAMATION)
28 *type = GTK_MESSAGE_WARNING;
29 else if (style & wxICON_ERROR)
30 *type = GTK_MESSAGE_ERROR;
31 else if (style & wxICON_INFORMATION)
32 *type = GTK_MESSAGE_INFO;
33 else if (style & wxICON_QUESTION)
34 *type = GTK_MESSAGE_QUESTION;
35 else
36 return false;
37
38 return true;
39 }
40
41 } // namespace wxGTKImpl
42
43 #endif // _GTK_PRIVATE_MSGTYPE_H_
44