+ // 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
+ // from the flags given to us here
+ switch ( style & (wxSL_LEFT | wxSL_RIGHT | wxSL_TOP | wxSL_BOTTOM) )
+ {
+ case wxSL_LEFT:
+ case wxSL_RIGHT:
+ style |= wxSL_VERTICAL;
+ break;
+
+ case wxSL_TOP:
+ case wxSL_BOTTOM:
+ style |= wxSL_HORIZONTAL;
+ 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),
+ wxT("incompatible slider direction and orientation") );
+
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
+ Rect bounds = wxMacGetBoundsForControl( this , pos , size );