Fix wxSlider::SetThumbLength() on wxMSW

It requires TBS_FIXEDLENGTH style.
Call InvalidateBestSize because the size of the control might change.
Call Layout in the widgets sample to adjust to the changed size.
Use GetThumbLength() instead of the arbitrary defined THUMB size.
This commit is contained in:
Maarten Bent
2019-01-31 20:23:38 +01:00
parent 9f9bc40f83
commit 8f3b87dce7
2 changed files with 16 additions and 4 deletions

View File

@@ -543,6 +543,14 @@ void SliderWidgetsPage::DoSetThumbLen()
}
m_slider->SetThumbLength(len);
if ( m_slider->GetThumbLength() != len )
{
wxLogWarning(wxString::Format("Invalid thumb length in slider: %d",
m_slider->GetThumbLength()));
}
Layout();
}
// ----------------------------------------------------------------------------