]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/fontpicker.h
No changes, just move time functions from wx/stopwatch.h to wx/time.h.
[wxWidgets.git] / include / wx / fontpicker.h
index 88a29d4b55a8f77dcb9d98f5813e7d9dbb015230..243e613871da68409cc6935a663900fc30fd0073 100644 (file)
 
 #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[];
+extern WXDLLIMPEXP_DATA_CORE(const char) wxFontPickerWidgetNameStr[];
+extern WXDLLIMPEXP_DATA_CORE(const char) wxFontPickerCtrlNameStr[];
 
 
 // ----------------------------------------------------------------------------
@@ -67,7 +66,11 @@ 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
+#define wxFONTBTN_DEFAULT_STYLE \
+    (wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL)
+
+// native version currently only exists in wxGTK2
+#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
     #include "wx/gtk/fontpicker.h"
     #define wxFontPickerWidget      wxFontButton
 #else
@@ -80,8 +83,8 @@ protected:
 // wxFontPickerCtrl specific flags
 // ----------------------------------------------------------------------------
 
-#define wxFNTP_USE_TEXTCTRL       wxPB_USE_TEXTCTRL
-#define wxFNTP_DEFAULT_STYLE      wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL
+#define wxFNTP_USE_TEXTCTRL       (wxPB_USE_TEXTCTRL)
+#define wxFNTP_DEFAULT_STYLE      (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL)
 
 // not a style but rather the default value of the maximum pointsize allowed
 #define wxFNTP_MAXPOINT_SIZE      100
@@ -107,7 +110,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 +124,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 +159,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;
 
@@ -177,9 +180,7 @@ private:
 // wxFontPickerEvent: used by wxFontPickerCtrl only
 // ----------------------------------------------------------------------------
 
-BEGIN_DECLARE_EVENT_TYPES()
-    DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_FONTPICKER_CHANGED, 1102)
-END_DECLARE_EVENT_TYPES()
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEvent );
 
 class WXDLLIMPEXP_CORE wxFontPickerEvent : public wxCommandEvent
 {
@@ -195,10 +196,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)
 };
 
 // ----------------------------------------------------------------------------
@@ -208,18 +212,11 @@ private:
 typedef void (wxEvtHandler::*wxFontPickerEventFunction)(wxFontPickerEvent&);
 
 #define wxFontPickerEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFontPickerEventFunction, &func)
+    wxEVENT_HANDLER_CAST(wxFontPickerEventFunction, func)
 
 #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