- wxSize size = s ;
- Rect bounds ;
- Str255 title ;
- m_rangeMax = range ;
-
- if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y)
- {
- size = wxSize( 200 , 16 ) ;
- }
-
- MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
-
- m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , range,
- kControlProgressBarProc , (long) this ) ;
-
- MacPostControlCreate() ;
-
- return TRUE;
-}
-
-void wxGauge::SetShadowWidth(int w)
-{
-}
-
-void wxGauge::SetBezelFace(int w)
-{
+ m_macIsUserPane = FALSE ;
+
+ if ( !wxGaugeBase::Create(parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name) )
+ return false;
+
+ wxSize size = s ;
+ /*
+ if ( size.x == wxDefaultCoord && size.y == wxDefaultCoord)
+ {
+ size = wxSize( 200 , 16 ) ;
+ }
+ */
+ Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
+ m_peer = new wxMacControl() ;
+ verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
+ GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) );
+
+ if ( GetValue() == 0 )
+ m_peer->SetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag , (Boolean) false ) ;
+
+ MacPostControlCreate(pos,size) ;
+
+ return TRUE;