int wLine;
#if TARGET_CARBON
- long metric ;
+ SInt32 metric ;
GetThemeMetric( kThemeMetricPopupButtonHeight , &metric );
lbHeight = metric ;
#endif
{
+#if wxMAC_USE_CORE_GRAPHICS
+ wxClientDC dc(const_cast<wxChoice*>(this));
+#else
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetTopLevelWindowRef() ) ) ;
if ( m_font.Ok() )
{
::TextSize( 9 ) ;
::TextFace( 0 ) ;
}
-
+#endif
// Find the widest line
for(unsigned int i = 0; i < GetCount(); i++)
{
wxString str(GetString(i));
-
+#if wxMAC_USE_CORE_GRAPHICS
+ wxCoord width, height ;
+ dc.GetTextExtent( str , &width, &height);
+ wLine = width ;
+#else
#if wxUSE_UNICODE
Point bounds = { 0, 0 } ;
SInt16 baseline ;
#else
wLine = ::TextWidth( str.c_str() , 0 , str.length() ) ;
#endif
-
+#endif
lbWidth = wxMax( lbWidth, wLine ) ;
}
// Add room for the popup arrow
lbWidth += 2 * lbHeight ;
-
+#if wxMAC_USE_CORE_GRAPHICS
+ wxCoord width, height ;
+ dc.GetTextExtent( wxT("X"), &width, &height);
+ int cx = width ;
+#else
// And just a bit more
int cx = ::TextWidth( "X" , 0 , 1 ) ;
+#endif
lbWidth += cx ;
}
int wLine;
{
+#if wxMAC_USE_CORE_GRAPHICS
+ wxClientDC dc(const_cast<wxListBox*>(this));
+#else
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef)MacGetTopLevelWindowRef() ) );
// TODO: clean this up
::TextSize( 9 );
::TextFace( 0 );
}
-
+#endif
// Find the widest line
for (unsigned int i = 0; i < GetCount(); i++)
{
wxString str( GetString( i ) );
-
+#if wxMAC_USE_CORE_GRAPHICS
+ wxCoord width, height ;
+ dc.GetTextExtent( str , &width, &height);
+ wLine = width ;
+#else
#if wxUSE_UNICODE
Point bounds = {0, 0};
SInt16 baseline;
#endif
lbWidth = wxMax( lbWidth, wLine );
+#endif
}
// Add room for the scrollbar
// And just a bit more
int cy = 12;
+#if wxMAC_USE_CORE_GRAPHICS
+ wxCoord width, height ;
+ dc.GetTextExtent( wxT("X") , &width, &height);
+ int cx = width ;
+#else
int cx = ::TextWidth( "X", 0, 1 );
+#endif
lbWidth += cx;
// don't make the listbox too tall (limit height to around 10 items)
}
else
{
+#if wxMAC_USE_CORE_GRAPHICS
+ wxClientDC dc(const_cast<wxStaticText*>(this));
+ wxCoord width, height ;
+ dc.GetTextExtent( m_label , &width, &height);
+ bounds.h = width;
+ bounds.v = height;
+#else
wxMacWindowStateSaver sv( this );
::TextFont( m_font.MacGetFontNum() );
::TextSize( (short)(m_font.MacGetFontSize()) );
(!m_label.empty() ? (CFStringRef)str : CFSTR(" ")),
kThemeCurrentPortFont, kThemeStateActive, false, &bounds, &baseline );
verify_noerr( err );
+#endif
}
if ( m_label.empty() )
UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
#if wxUSE_UNICODE
- UInt32 dataSize = 0 ;
+ ByteCount dataSize = 0 ;
if ( GetEventParameter( event, kEventParamKeyUnicodes, typeUnicodeText, NULL, 0 , &dataSize, NULL ) == noErr )
{
UniChar buf[2] ;
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
// EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
- SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeLongInteger) ;
+ SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeSInt32) ;
wxevent.m_wheelRotation = delta;
wxevent.m_wheelDelta = 1;
if ( window )
{
- QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
+ wxMacGlobalToLocal( window, &windowMouseLocation ) ;
if ( wxApp::s_captureWindow
#if !NEW_CAPTURE_HANDLING
Point idealSize = { 0 , 0 } ;
if ( maximize )
{
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+ HIRect bounds ;
+ HIWindowGetAvailablePositioningBounds(kCGNullDirectDisplay,kHICoordSpace72DPIGlobal,
+ &bounds);
+ idealSize.h = bounds.size.width;
+ idealSize.v = bounds.size.height;
+#else
Rect rect ;
GetAvailableWindowPositioningBounds(GetMainDevice(),&rect) ;
idealSize.h = rect.right - rect.left ;
idealSize.v = rect.bottom - rect.top ;
+#endif
}
ZoomWindowIdeal( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , &idealSize ) ;
}
{
WindowDefSpec customWindowDefSpec;
customWindowDefSpec.defType = kWindowDefProcPtr;
- customWindowDefSpec.u.defProc = NewWindowDefUPP(wxShapedMacWindowDef);
-
+ customWindowDefSpec.u.defProc =
+#ifdef __LP64__
+ (WindowDefUPP) wxShapedMacWindowDef;
+#else
+ NewWindowDefUPP(wxShapedMacWindowDef);
+#endif
err = ::CreateCustomWindow( &customWindowDefSpec, wclass,
attr, &theBoundsRect,
(WindowRef*) &m_macWindow);
DisposeRgn(oldRgn);
// Save the region so we can use it later
- SetWRefCon((WindowRef)MacGetWindowRef(), (SInt32)shapeRegion);
+ SetWRefCon((WindowRef)MacGetWindowRef(), (URefCon)shapeRegion);
// inform the window manager that the window has changed shape
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
{
GetWindowPortBounds(window, inRect);
- Point pt = { inRect->left, inRect->top };
-
- QDLocalToGlobalPoint( GetWindowPort(window), &pt ) ;
+ Point pt = { inRect->top ,inRect->left };
+ wxMacLocalToGlobal( window, &pt ) ;
+ inRect->bottom += pt.v - inRect->top;
+ inRect->right += pt.h - inRect->left;
inRect->top = pt.v;
inRect->left = pt.h;
- inRect->bottom += pt.v;
- inRect->right += pt.h;
}
static SInt32 wxShapedMacWindowGetFeatures(WindowRef window, SInt32 param)