X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/fontpicker.h?ds=sidebyside diff --git a/interface/wx/fontpicker.h b/interface/wx/fontpicker.h index 4db0ae045c..1d3bd77e51 100644 --- a/interface/wx/fontpicker.h +++ b/interface/wx/fontpicker.h @@ -2,24 +2,31 @@ // Name: fontpicker.h // Purpose: interface of wxFontPickerCtrl // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +#define wxFNTP_FONTDESC_AS_LABEL 0x0008 +#define wxFNTP_USEFONT_FOR_LABEL 0x0010 +#define wxFONTBTN_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) + +wxEventType wxEVT_FONTPICKER_CHANGED; + + /** @class wxFontPickerCtrl This control allows the user to select a font. The generic implementation is a button which brings up a wxFontDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the - font-chooser - dialog. + font-chooser dialog. It is only available if @c wxUSE_FONTPICKERCTRL is set to 1 (the default). @beginStyleTable @style{wxFNTP_DEFAULT_STYLE} - The default style: wxFNTP_FONTDESC_AS_LABEL | - wxFNTP_USEFONT_FOR_LABEL. + The default style: wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL. @style{wxFNTP_USE_TEXTCTRL} Creates a text control to the left of the picker button which is completely managed by the wxFontPickerCtrl and which can be used by @@ -35,15 +42,24 @@ Uses the currently selected font to draw the label of the button. @endStyleTable + @beginEventEmissionTable{wxFontPickerEvent} + @event{EVT_FONTPICKER_CHANGED(id, func)} + The user changed the font selected in the control either using the button + or using text control (see wxFNTP_USE_TEXTCTRL; note that in this case the + event is fired only if the user's input is valid, i.e. recognizable). + @endEventTable + @library{wxcore} @category{pickers} - + @appearance{fontpickerctrl} @see wxFontDialog, wxFontPickerEvent */ class wxFontPickerCtrl : public wxPickerBase { public: + wxFontPickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. @@ -54,16 +70,18 @@ public: const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "fontpickerctrl"); + const wxString& name = wxFontPickerCtrlNameStr); /** + Creates this widget with given parameters. + @param parent Parent window, must not be non-@NULL. @param id The identifier for the control. @param font - The initial font shown in the control. If wxNullFont - is given, the default font is used. + The initial font shown in the control. + If ::wxNullFont is given, the default font is used. @param pos Initial position. @param size @@ -84,7 +102,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "fontpickerctrl"); + const wxString& name = wxFontPickerCtrlNameStr); /** Returns the maximum point size value allowed for the user-chosen font. @@ -99,15 +117,14 @@ public: /** Sets the maximum point size value allowed for the user-chosen font. + The default value is 100. Note that big fonts can require a lot of memory and - CPU time - both for creation and for rendering; thus, specially because the user has the - option to specify - the fontsize through a text control (see wxFNTP_USE_TEXTCTRL), it's a good idea - to put a limit - to the maximum font size when huge fonts do not make much sense. + CPU time both for creation and for rendering; thus, specially because the user + has the option to specify the fontsize through a text control + (see wxFNTP_USE_TEXTCTRL), it's a good idea to put a limit to the maximum + font size when huge fonts do not make much sense. */ - void GetMaxPointSize(unsigned int max); + void SetMaxPointSize(unsigned int max); /** Sets the currently selected font. @@ -124,8 +141,13 @@ public: This event class is used for the events generated by wxFontPickerCtrl. + @beginEventTable{wxFontPickerEvent} + @event{EVT_FONTPICKER_CHANGED(id, func)} + Generated whenever the selected font changes. + @endEventTable + @library{wxcore} - @category{FIXME} + @category{events} @see wxFontPickerCtrl */