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.
|