+
+ if(GetWindowStyle() & wxSL_HORIZONTAL)
+ {
+ if ( m_macMinimumStatic ) {
+ w-=minValWidth/2;
+ x+=minValWidth/2;
+ }
+ if ( m_macMaximumStatic ) {
+ w-=maxValWidth/2;
+ }
+ }
+
+
+ //Labels have this control's parent as their parent
+ //so if this control is not at 0,0 relative to the parent
+ //the labels need to know the position of this control
+ //relative to its parent in order to size properly, so
+ //move the control first so we can use GetPosition()
+ wxControl::DoSetSize( x, y , w , h ,sizeFlags ) ;
+
+ // If vertical, use current value
+ if(GetWindowStyle() & wxSL_VERTICAL)
+ {
+ text.Printf(wxT("%d"), (int)m_peer->GetValue());
+ }
+ // Use max so that the current value doesn't drift as centering would need to change
+ else
+ {
+ text.Printf(wxT("%d"), m_rangeMax);
+ }
+
+ GetTextExtent(text, &valValWidth, &ht);
+