m_rangeMax = 0;
m_rangeMin = 0;
m_tickFreq = 0;
+
+ m_macMinimumStatic = NULL ;
+ m_macMaximumStatic = NULL ;
+ m_macValueStatic = NULL ;
}
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
{
m_macIsUserPane = false ;
+ m_macMinimumStatic = NULL ;
+ m_macMaximumStatic = NULL ;
+ m_macValueStatic = NULL ;
+
+ m_lineSize = 1;
+ m_tickFreq = 0;
+
+ m_rangeMax = maxValue;
+ m_rangeMin = minValue;
+
+ m_pageSize = (int)((maxValue-minValue)/10);
+
// our styles are redundant: wxSL_LEFT/RIGHT imply wxSL_VERTICAL and
// wxSL_TOP/BOTTOM imply wxSL_HORIZONTAL, but for backwards compatibility
// reasons we can't really change it, instead try to infer the orientation
break;
case 0:
+ default:
// no specific direction, do we have at least the orientation?
if ( !(style & (wxSL_HORIZONTAL | wxSL_VERTICAL)) )
{
// no, choose default
style |= wxSL_BOTTOM | wxSL_HORIZONTAL;
}
- };
+ break;
+ }
wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL),
_T("incompatible slider direction and orientation") );
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
- m_macMinimumStatic = NULL ;
- m_macMaximumStatic = NULL ;
- m_macValueStatic = NULL ;
-
- m_lineSize = 1;
- m_tickFreq = 0;
-
- m_rangeMax = maxValue;
- m_rangeMin = minValue;
-
- m_pageSize = (int)((maxValue-minValue)/10);
-
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
//
m_macMinimumStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
m_macMaximumStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
m_macValueStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
- SetRange(minValue, maxValue);
- SetValue(value);
}
+ SetRange(minValue, maxValue);
+ SetValue(value);
+
MacPostControlCreate(pos,size) ;
return true;
void wxSlider::SetValue(int value)
{
- wxString valuestring ;
- valuestring.Printf( wxT("%d") , value ) ;
if ( m_macValueStatic )
+ {
+ wxString valuestring ;
+ valuestring.Printf( wxT("%d") , value ) ;
m_macValueStatic->SetLabel( valuestring ) ;
+ }
// We only invert for the setting of the actual native widget
m_peer->SetValue( ValueInvertOrNot ( value ) ) ;