wxFontPickerCtrlThis 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. It is only available if wxUSE_FONTPICKERCTRL is set to 1 (the default). Derived from
wxPickerBase Include files <wx/fontpicker.h> Window styles
Event handling To process a font picker event, use these event handler macros to direct input to member functions that take a wxFontPickerEvent argument.
See also
wxFontDialog, Members
wxFontPickerCtrl::wxFontPickerCtrl
wxFontPickerCtrl::wxFontPickerCtrlwxFontPickerCtrl(wxWindow *parent, wxWindowID id, const wxFont& font = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "fontpickerctrl") Initializes the object and calls Create with all the parameters.
wxFontPickerCtrl::Createbool Create(wxWindow *parent, wxWindowID id, const wxFont& font = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "fontpickerctrl") Parameters parent
id
font
pos
size
style
validator
name
Return value true if the control was successfully created or false if creation failed.
wxFontPickerCtrl::GetSelectedFontwxFont GetSelectedFont() const Returns the currently selected font. Note that this function is completely different from wxWindow::GetFont.
wxFontPickerCtrl::SetSelectedFontvoid SetSelectedFont(const wxFont &font) Sets the currently selected font. Note that this function is completely different from wxWindow::SetFont.
wxFontPickerCtrl::GetMaxPointSizeunsigned int GetMaxPointSize() const Returns the maximum point size value allowed for the user-chosen font.
wxFontPickerCtrl::SetMaxPointSizevoid GetMaxPointSize(unsigned int max) 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.
|