X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/556151f5ff1bd2fa44de2237a3ad03694c2e3883..333e57d578e9e0fb6555452b5a53698ffd85ee69:/include/wx/fontpicker.h diff --git a/include/wx/fontpicker.h b/include/wx/fontpicker.h index e559e8d780..2f12112fc3 100644 --- a/include/wx/fontpicker.h +++ b/include/wx/fontpicker.h @@ -17,11 +17,10 @@ #if wxUSE_FONTPICKERCTRL -#include "wx/control.h" #include "wx/pickerbase.h" -class WXDLLIMPEXP_CORE wxFontPickerEvent; +class WXDLLIMPEXP_FWD_CORE wxFontPickerEvent; extern WXDLLEXPORT_DATA(const wxChar) wxFontPickerWidgetNameStr[]; extern WXDLLEXPORT_DATA(const wxChar) wxFontPickerCtrlNameStr[]; @@ -67,7 +66,8 @@ protected: // uses the currently selected font to draw the label of the button #define wxFNTP_USEFONT_FOR_LABEL 0x0010 -#if defined(__WXGTK24__) // since GTK > 2.4, there is GtkFontButton +// since GTK > 2.4, there is GtkFontButton +#if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/fontpicker.h" #define wxFontPickerWidget wxFontButton #else @@ -107,7 +107,7 @@ public: wxFontPickerCtrl(wxWindow *parent, wxWindowID id, - const wxFont& initial = *wxNORMAL_FONT, + const wxFont& initial = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, @@ -121,7 +121,7 @@ public: bool Create(wxWindow *parent, wxWindowID id, - const wxFont& initial = *wxNORMAL_FONT, + const wxFont& initial = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, @@ -156,12 +156,12 @@ public: // internal functions virtual wxString Font2String(const wxFont &font); virtual wxFont String2Font(const wxString &font); +protected: + // extracts the style for our picker from wxFontPickerCtrl's style long GetPickerStyle(long style) const { return (style & (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL)); } -protected: - // true if the next UpdateTextCtrl() call is to ignore bool m_bIgnoreNextTextCtrlUpdate; @@ -195,10 +195,13 @@ public: wxFont GetFont() const { return m_font; } void SetFont(const wxFont &c) { m_font = c; } + // default copy ctor, assignment operator and dtor are ok + virtual wxEvent *Clone() const { return new wxFontPickerEvent(*this); } + private: wxFont m_font; - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontPickerEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFontPickerEvent) }; // ---------------------------------------------------------------------------- @@ -213,13 +216,6 @@ typedef void (wxEvtHandler::*wxFontPickerEventFunction)(wxFontPickerEvent&); #define EVT_FONTPICKER_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FONTPICKER_CHANGED, id, wxFontPickerEventHandler(fn)) -#ifdef _WX_DEFINE_DATE_EVENTS_ - DEFINE_EVENT_TYPE(wxEVT_COMMAND_FONTPICKER_CHANGED) - - IMPLEMENT_DYNAMIC_CLASS(wxFontPickerEvent, wxCommandEvent) -#endif - - #endif // wxUSE_FONTPICKERCTRL