Better fix for 32 bit wxOSX build

Instead of disabling vertical alignment support in wxDataViewCtrl, move the
private variables to the header file: this is supported by all versions of the
Objective-C runtime, including the old one used for 32 bit applications,
unlike the new way based on declaring the variable in an anonymous extension.

This replaces the changes of 22216b70e7.
This commit is contained in:
Vadim Zeitlin 2016-12-21 20:47:42 +01:00
parent 3105134548
commit 1c0ecec225
2 changed files with 6 additions and 17 deletions

View File

@ -376,6 +376,12 @@ private:
#define wxTextFieldCell NSTextFieldCell #define wxTextFieldCell NSTextFieldCell
#else #else
@interface wxTextFieldCell : NSTextFieldCell @interface wxTextFieldCell : NSTextFieldCell
{
@private
int _wxAlignment;
BOOL _adjustRect;
}
-(void) setWXAlignment:(int)alignment; -(void) setWXAlignment:(int)alignment;
@end @end
#endif #endif

View File

@ -1252,20 +1252,6 @@ outlineView:(NSOutlineView*)outlineView
// wxTextFieldCell // wxTextFieldCell
// ============================================================================ // ============================================================================
#ifndef _LP64
// The code below doesn't compile in 32 bits failing with
//
// error: instance variables may not be placed in class extension
//
// Until this can be fixed, disable it to at least fix compilation.
#else
@interface wxTextFieldCell ()
{
int _wxAlignment;
BOOL _adjustRect;
}
@end
@implementation wxTextFieldCell @implementation wxTextFieldCell
- (void)setWXAlignment:(int)alignment - (void)setWXAlignment:(int)alignment
@ -1331,7 +1317,6 @@ outlineView:(NSOutlineView*)outlineView
} }
@end @end
#endif // 32/64 bits
// ============================================================================ // ============================================================================
@ -2763,10 +2748,8 @@ void wxDataViewRenderer::OSXUpdateAlignment()
int align = GetEffectiveAlignment(); int align = GetEffectiveAlignment();
NSCell *cell = GetNativeData()->GetColumnCell(); NSCell *cell = GetNativeData()->GetColumnCell();
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)]; [cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
#ifdef _LP64
if ([cell respondsToSelector:@selector(setWXAlignment:)]) if ([cell respondsToSelector:@selector(setWXAlignment:)])
[(wxTextFieldCell*)cell setWXAlignment:align]; [(wxTextFieldCell*)cell setWXAlignment:align];
#endif // _LP64
} }
void wxDataViewRenderer::SetMode(wxDataViewCellMode mode) void wxDataViewRenderer::SetMode(wxDataViewCellMode mode)