- if ( HasFlag(wxSL_MIN_MAX_LABELS) )
- {
- *widthMin = GetTextExtent(Format(m_rangeMin)).x;
- *widthMax = GetTextExtent(Format(m_rangeMax)).x;
- }
- else
- {
- *widthMin =
- *widthMax = 0;
- }
+ *widthMin = GetTextExtent(Format(m_rangeMin)).x;
+ *widthMax = GetTextExtent(Format(m_rangeMax)).x;
- const int labelHeight = GetLabelsSize(&m_minLabelWidth, &m_maxLabelWidth);
- const int maxLabelWidth = wxMax(m_minLabelWidth, m_maxLabelWidth);
+ int minLabelWidth,
+ maxLabelWidth;
+ const int labelHeight = GetLabelsSize(&minLabelWidth, &maxLabelWidth);
+ const int longestLabelWidth = wxMax(minLabelWidth, maxLabelWidth);
+ if ( !HasFlag(wxSL_MIN_MAX_LABELS) )
+ {
+ minLabelWidth =
+ maxLabelWidth = 0;
+ }
- int xLabel = (wxMax((THUMB + (BORDERPAD * 2)), maxLabelWidth) / 2) -
- (maxLabelWidth / 2) + x;
+ int xLabel = (wxMax((THUMB + (BORDERPAD * 2)), longestLabelWidth) / 2) -
+ (longestLabelWidth / 2) + x;
- holdTopWidth = m_minLabelWidth;
- holdBottomX = xLabel - ((m_maxLabelWidth - m_minLabelWidth) / 2);
- holdBottomWidth = m_maxLabelWidth;
+ holdTopWidth = minLabelWidth;
+ holdBottomX = xLabel - ((maxLabelWidth - minLabelWidth) / 2);
+ holdBottomWidth = maxLabelWidth;
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdTopWidth, holdBottomWidth);
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdTopWidth, holdBottomWidth);
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
x + THUMB + tickOffset + HGAP,
y + (height - labelHeight)/2,
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
x + THUMB + tickOffset + HGAP,
y + (height - labelHeight)/2,
- holdTopX = xLabel + maxLabelWidth + ((m_maxLabelWidth - m_minLabelWidth) / 2);
- holdTopWidth = m_minLabelWidth;
- holdBottomX = xLabel + maxLabelWidth;
- holdBottomWidth = m_maxLabelWidth;
+ holdTopX = xLabel + longestLabelWidth + ((maxLabelWidth - minLabelWidth) / 2);
+ holdTopWidth = minLabelWidth;
+ holdBottomX = xLabel + longestLabelWidth;
+ holdBottomWidth = maxLabelWidth;
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdTopWidth, holdBottomWidth);
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdTopWidth, holdBottomWidth);
holdBottomWidth, labelHeight);
}
if ( HasFlag(wxSL_VALUE_LABEL) )
holdBottomWidth, labelHeight);
}
if ( HasFlag(wxSL_VALUE_LABEL) )
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
x,
y + (height - labelHeight)/2,
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
x,
y + (height - labelHeight)/2,
- holdLeftWidth = m_minLabelWidth;
- holdRightX = x + width - m_maxLabelWidth;
- holdRightWidth = m_maxLabelWidth;
+ holdLeftWidth = minLabelWidth;
+ holdRightX = x + width - maxLabelWidth;
+ holdRightWidth = maxLabelWidth;
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdLeftWidth, holdRightWidth);
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdLeftWidth, holdRightWidth);
- holdLeftWidth = m_minLabelWidth;
- holdRightX = x + width - m_maxLabelWidth;
- holdRightWidth = m_maxLabelWidth;
+ holdLeftWidth = minLabelWidth;
+ holdRightX = x + width - maxLabelWidth;
+ holdRightWidth = maxLabelWidth;
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdLeftWidth, holdRightWidth);
if ( HasFlag(wxSL_INVERSE) )
{
wxSwap(holdLeftWidth, holdRightWidth);
if ( HasFlag(wxSL_MIN_MAX_LABELS) || HasFlag(wxSL_VALUE_LABEL) )
labelOffset = labelHeight;
wxSliderBase::DoMoveWindow(
if ( HasFlag(wxSL_MIN_MAX_LABELS) || HasFlag(wxSL_VALUE_LABEL) )
labelOffset = labelHeight;
wxSliderBase::DoMoveWindow(
int hLabel = GetLabelsSize(&widthMin, &widthMax);
// account for the labels
int hLabel = GetLabelsSize(&widthMin, &widthMax);
// account for the labels