Add missing isFlipped methods to controls.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25473 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2007-09-10 11:12:44 +00:00
parent a46f252beb
commit 74b20f9065
6 changed files with 956 additions and 908 deletions

View file

@ -1,3 +1,12 @@
2007-09-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableHeaderView.m,
* Source/NSSlider.m,
* Source/NSProgressIndicator.m,
* Source/NSButton.m (-isFlipped): Add fliiping.
* Source/NSTableHeaderView.m (-drawRect:): Adjust for flipping.
* Source/NSTabView.m: Mark as needing an isFlipped method.
2007-09-09 Fred Kiefer <FredKiefer@gmx.de> 2007-09-09 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow.m (-makeKeyAndOrderFront:): Use * Source/NSWindow.m (-makeKeyAndOrderFront:): Use

View file

@ -81,6 +81,11 @@ static id buttonCellClass = nil;
return YES; return YES;
} }
- (BOOL) isFlipped
{
return YES;
}
/** <p>Sets the NSButtonCell's type to <var>aType</var> and marks self for /** <p>Sets the NSButtonCell's type to <var>aType</var> and marks self for
display.See <ref type="type" id="NSButtonType">NSButtonType</ref> for more display.See <ref type="type" id="NSButtonType">NSButtonType</ref> for more
information.</p><p>See Also: [NSButtonCell-setButtonType:]</p> information.</p><p>See Also: [NSButtonCell-setButtonType:]</p>

View file

@ -68,6 +68,11 @@ static NSColor *fillColour = nil;
[super dealloc]; [super dealloc];
} }
- (BOOL) isFlipped
{
return YES;
}
- (void)animate:(id)sender - (void)animate:(id)sender
{ {
if (!_isIndeterminate) if (!_isIndeterminate)

View file

@ -97,6 +97,11 @@ static Class cellClass;
return self; return self;
} }
- (BOOL) isFlipped
{
return YES;
}
/**<p>Returns the value by which the slider will be incremented if the /**<p>Returns the value by which the slider will be incremented if the
user holds down the ALT key.</p><p>See Also: -setAltIncrementValue:</p> */ user holds down the ALT key.</p><p>See Also: -setAltIncrementValue:</p> */
- (double) altIncrementValue - (double) altIncrementValue

View file

@ -75,6 +75,14 @@
[super dealloc]; [super dealloc];
} }
/*
// FIXME: This should be defined
- (BOOL) isFlipped
{
return YES;
}
*/
// tab management. // tab management.
- (void) addTabViewItem: (NSTabViewItem*)tabViewItem - (void) addTabViewItem: (NSTabViewItem*)tabViewItem

View file

@ -81,6 +81,12 @@
_resizedColumn = -1; _resizedColumn = -1;
return self; return self;
} }
- (BOOL) isFlipped
{
return YES;
}
/* /*
* Setting the table view * Setting the table view
*/ */
@ -171,7 +177,10 @@
lastColumnToDraw = [_tableView numberOfColumns] - 1; lastColumnToDraw = [_tableView numberOfColumns] - 1;
drawingRect = [self headerRectOfColumn: firstColumnToDraw]; drawingRect = [self headerRectOfColumn: firstColumnToDraw];
if ([self isFlipped])
{
drawingRect.origin.y++; drawingRect.origin.y++;
}
drawingRect.size.height--; drawingRect.size.height--;
columns = [_tableView tableColumns]; columns = [_tableView tableColumns];
@ -235,13 +244,20 @@
drawingRect.origin.x += width; drawingRect.origin.x += width;
} }
{ {
NSRectEdge up_sides[] = {NSMinYEdge, NSMaxXEdge}; NSRectEdge up_sides[] = {NSMinYEdge, NSMaxXEdge};
NSRectEdge dn_sides[] = {NSMaxYEdge, NSMaxXEdge};
float grays[] = {NSBlack, NSBlack}; float grays[] = {NSBlack, NSBlack};
if ([self isFlipped])
{
NSDrawTiledRects(_bounds, aRect, up_sides, grays, 2); NSDrawTiledRects(_bounds, aRect, up_sides, grays, 2);
} }
else
{
NSDrawTiledRects(_bounds, aRect, dn_sides, grays, 2);
}
}
} }
- (void) mouseDown: (NSEvent*)event - (void) mouseDown: (NSEvent*)event