Add wxFontPickerCtrl::SetMinPointSize()

Allow setting the minimal, as well as maximal, point size.

Closes #17126.
This commit is contained in:
Andreas Falkenhahn
2016-11-22 02:31:11 +01:00
committed by Vadim Zeitlin
parent 60c93971b3
commit accf7ab117
4 changed files with 47 additions and 6 deletions

View File

@@ -38,6 +38,12 @@
// implementation
// ============================================================================
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#define SetMinMaxPointSize(min, max)
#else
#define SetMinMaxPointSize(min, max) GetPickerWidget()->GetFontData()->SetRange((min), (max))
#endif
const char wxFontPickerCtrlNameStr[] = "fontpicker";
const char wxFontPickerWidgetNameStr[] = "fontpickerwidget";
@@ -150,7 +156,17 @@ void wxFontPickerCtrl::UpdateTextCtrlFromPicker()
m_text->ChangeValue(Font2String(GetPickerWidget()->GetSelectedFont()));
}
void wxFontPickerCtrl::SetMinPointSize(unsigned int min)
{
m_nMinPointSize = min;
SetMinMaxPointSize(m_nMinPointSize, m_nMaxPointSize);
}
void wxFontPickerCtrl::SetMaxPointSize(unsigned int max)
{
m_nMaxPointSize = max;
SetMinMaxPointSize(m_nMinPointSize, m_nMaxPointSize);
}
// ----------------------------------------------------------------------------
// wxFontPickerCtrl - event handlers