X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/065e208ec09e3d08d51d9604497f92f53c210f93..caf448e3e19c0fcd6593e47138fe31a82e8c8a8d:/src/cocoa/gauge.mm diff --git a/src/cocoa/gauge.mm b/src/cocoa/gauge.mm index 1769e1062f..08b164e419 100644 --- a/src/cocoa/gauge.mm +++ b/src/cocoa/gauge.mm @@ -34,6 +34,12 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID winid, int range, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { + //flag checking + wxASSERT_MSG( !(style & wxGA_HORIZONTAL), wxT("Horizontal gauge not supported on cocoa"));//* + wxASSERT_MSG( !(style & wxGA_SMOOTH), wxT("Smooth gauge not supported on cocoa")); + //* - GNUStep made isVertical and setVertical part of thier framework, but its specific to them + //the way they do it is just handle that flag in drawRect. + if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; SetNSView([[NSProgressIndicator alloc] initWithFrame: MakeDefaultNSRect(size)]); @@ -91,7 +97,7 @@ NS_ENDHANDLER if(didFit) { NSRect cocoaRect = [m_cocoaNSView frame]; - wxSize size((int)ceilf(cocoaRect.size.width),(int)ceilf(cocoaRect.size.height)); + wxSize size((int)ceil(cocoaRect.size.width),(int)ceil(cocoaRect.size.height)); [m_cocoaNSView setFrame: storedRect]; wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxControl=%p::DoGetBestSize()==(%d,%d) from sizeToFit"),this,size.x,size.y); return /*wxConstCast(this, wxControl)->m_bestSize =*/ size;