]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/fontpicker.h
remove wxComboBox-specific hack, override DoSetToolTip() in wxComboBox itself instead
[wxWidgets.git] / include / wx / gtk / fontpicker.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/fontpicker.h
3 // Purpose: wxFontButton header
4 // Author: Francesco Montorsi
5 // Modified by:
6 // Created: 14/4/2006
7 // Copyright: (c) Francesco Montorsi
8 // RCS-ID: $Id$
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GTK_FONTPICKER_H_
13 #define _WX_GTK_FONTPICKER_H_
14
15 // since GtkFontButton is available only for GTK+ >= 2.4,
16 // we need to use generic version if we detect (at runtime)
17 // that GTK+ < 2.4
18 #include "wx/generic/fontpickerg.h"
19
20 //-----------------------------------------------------------------------------
21 // wxFontButton
22 //-----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_CORE wxFontButton : public wxGenericFontButton
25 {
26 public:
27 wxFontButton() {}
28 wxFontButton(wxWindow *parent,
29 wxWindowID id,
30 const wxFont& initial = wxNullFont,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 long style = wxFONTBTN_DEFAULT_STYLE,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxFontPickerWidgetNameStr)
36 {
37 Create(parent, id, initial, pos, size, style, validator, name);
38 }
39
40 virtual ~wxFontButton();
41
42
43 public: // overrides
44
45 bool Create(wxWindow *parent,
46 wxWindowID id,
47 const wxFont& initial = wxNullFont,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 long style = wxFONTBTN_DEFAULT_STYLE,
51 const wxValidator& validator = wxDefaultValidator,
52 const wxString& name = wxFontPickerWidgetNameStr);
53
54 protected:
55 void UpdateFont();
56
57
58 public: // used by the GTK callback only
59
60 void SetNativeFontInfo(const gchar *gtkdescription)
61 { m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); }
62
63 private:
64 DECLARE_DYNAMIC_CLASS(wxFontButton)
65 };
66
67 #endif // _WX_GTK_FONTPICKER_H_
68