END_EVENT_TABLE()
// The dimensions of the different styles of sliders (from Aqua document)
-#define wxSLIDER_DIMENSIONACROSS 15
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
m_macMaximumStatic->SetLabel( value );
}
- SetValue( m_rangeMin );
+ // If the range is out of bounds, set it to a
+ // value that is within bounds
+ // RN: Testing reveals OSX does its own
+ // bounding, perhaps this isn't needed?
+ int currentValue = GetValue();
+
+ if(currentValue < m_rangeMin)
+ SetValue(m_rangeMin);
+ else if(currentValue > m_rangeMax)
+ SetValue(m_rangeMax);
}
// For trackbars only
SetValue( value );
- wxEventType scrollEvent = wxEVT_NULL;
-
- scrollEvent = wxEVT_SCROLL_THUMBTRACK;
-
- wxScrollEvent event(scrollEvent, m_windowId);
- event.SetPosition(value);
+ wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId );
+ event.SetPosition( value );
event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
+ GetEventHandler()->ProcessEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value );
cevent.SetEventObject( this );
-
GetEventHandler()->ProcessEvent( cevent );
}
SetValue( value ) ;
- wxEventType scrollEvent = wxEVT_NULL ;
-
- scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
-
- wxScrollEvent event(scrollEvent, m_windowId);
- event.SetPosition(value);
+ wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId );
+ event.SetPosition( value );
event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
+ GetEventHandler()->ProcessEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value );
wxSize size = GetBestSize();
if (GetWindowStyle() & wxSL_VERTICAL)
- wxWindow::DoSetSizeHints(size.x, minH, size.x, maxH, incW, incH);
+ {
+ SetMinSize( wxSize(size.x,minH) );
+ SetMaxSize( wxSize(size.x,maxH) );
+ }
else
- wxWindow::DoSetSizeHints(minW, size.y, maxW, size.y, incW, incH);
+ {
+ SetMinSize( wxSize(minW,size.y) );
+ SetMaxSize( wxSize(maxW,size.y) );
+ }
}
wxSize wxSlider::DoGetBestSize() const
void wxSlider::DoSetSize(int x, int y, int w, int h, int sizeFlags)
{
- int xborder, yborder;
+ int yborder = 0;
int minValWidth, maxValWidth, textheight;
int sliderBreadth;
int width = w;
- xborder = yborder = 0;
-
if (GetWindowStyle() & wxSL_LABELS)
{
wxString text;