Rename wxTextFieldCell members once again

Use underscores on them to show that they are different from properties or
local variables (in pure Objective C they would actually start with
underscores, but this is not a good idea in C++ code) and avoid conflict
between a member name and "wxAlignment" type name, which was confusing.
This commit is contained in:
Vadim Zeitlin
2017-07-11 22:35:22 +02:00
parent a326da369b
commit 467c48841f
2 changed files with 13 additions and 13 deletions

View File

@@ -378,8 +378,8 @@ private:
@interface wxTextFieldCell : NSTextFieldCell @interface wxTextFieldCell : NSTextFieldCell
{ {
@private @private
int wxAlignment; int alignment_;
BOOL adjustRect; BOOL adjustRect_;
} }
-(void) setWXAlignment:(int)alignment; -(void) setWXAlignment:(int)alignment;

View File

@@ -1256,8 +1256,8 @@ outlineView:(NSOutlineView*)outlineView
- (void)setWXAlignment:(int)alignment - (void)setWXAlignment:(int)alignment
{ {
wxAlignment = alignment; alignment_ = alignment;
adjustRect = (alignment & (wxALIGN_CENTRE_VERTICAL | wxALIGN_BOTTOM)) != 0; adjustRect_ = (alignment & (wxALIGN_CENTRE_VERTICAL | wxALIGN_BOTTOM)) != 0;
} }
// These three overrides implement vertical alignment of text cells. // These three overrides implement vertical alignment of text cells.
@@ -1269,7 +1269,7 @@ outlineView:(NSOutlineView*)outlineView
// Get the parent's idea of where we should draw // Get the parent's idea of where we should draw
NSRect r = [super drawingRectForBounds:theRect]; NSRect r = [super drawingRectForBounds:theRect];
if (!adjustRect) if (!adjustRect_)
return r; return r;
if (theRect.size.height <= MINIMUM_NATIVE_ROW_HEIGHT) if (theRect.size.height <= MINIMUM_NATIVE_ROW_HEIGHT)
return r; // don't mess with default-sized rows as they are centered return r; // don't mess with default-sized rows as they are centered
@@ -1277,12 +1277,12 @@ outlineView:(NSOutlineView*)outlineView
NSSize bestSize = [self cellSizeForBounds:theRect]; NSSize bestSize = [self cellSizeForBounds:theRect];
if (bestSize.height < r.size.height) if (bestSize.height < r.size.height)
{ {
if (wxAlignment & wxALIGN_CENTER_VERTICAL) if (alignment_ & wxALIGN_CENTER_VERTICAL)
{ {
r.origin.y += int(r.size.height - bestSize.height) / 2; r.origin.y += int(r.size.height - bestSize.height) / 2;
r.size.height = bestSize.height; r.size.height = bestSize.height;
} }
else if (wxAlignment & wxALIGN_BOTTOM) else if (alignment_ & wxALIGN_BOTTOM)
{ {
r.origin.y += r.size.height - bestSize.height; r.origin.y += r.size.height - bestSize.height;
r.size.height = bestSize.height; r.size.height = bestSize.height;
@@ -1294,26 +1294,26 @@ outlineView:(NSOutlineView*)outlineView
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength - (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
{ {
BOOL oldAdjustRect = adjustRect; BOOL oldAdjustRect = adjustRect_;
if (oldAdjustRect) if (oldAdjustRect)
{ {
aRect = [self drawingRectForBounds:aRect]; aRect = [self drawingRectForBounds:aRect];
adjustRect = NO; adjustRect_ = NO;
} }
[super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength]; [super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength];
adjustRect = oldAdjustRect; adjustRect_ = oldAdjustRect;
} }
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent - (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent
{ {
BOOL oldAdjustRect = adjustRect; BOOL oldAdjustRect = adjustRect_;
if (oldAdjustRect) if (oldAdjustRect)
{ {
aRect = [self drawingRectForBounds:aRect]; aRect = [self drawingRectForBounds:aRect];
adjustRect = NO; adjustRect_ = NO;
} }
[super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent]; [super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent];
adjustRect = oldAdjustRect; adjustRect_ = oldAdjustRect;
} }
@end @end