Small patches and a missing CVS entry.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22346 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2006-01-22 21:23:44 +00:00
parent 5eb9fa6546
commit d5e163b00e
3 changed files with 52 additions and 14 deletions

View file

@ -474,14 +474,32 @@ void NSFrameRect(const NSRect aRect)
void NSFrameRectWithWidth(const NSRect aRect, float frameWidth)
{
float width;
NSGraphicsContext *ctxt = GSCurrentContext();
DPScurrentlinewidth(ctxt, &width);
DPSsetlinewidth(ctxt, frameWidth);
DPSrectstroke(ctxt, NSMinX(aRect) + frameWidth / 2.0,
NSMinY(aRect) + frameWidth / 2.0,
NSWidth(aRect) - frameWidth, NSHeight(aRect) - frameWidth);
DPSsetlinewidth(ctxt, width);
NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
NSRect remainder = aRect;
NSRect rects[4];
int i;
for (i = 0; i < 4; i++)
{
NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]);
}
NSRectFillList(rects, 4);
}
void
NSFrameRectWithWidthUsingOperation(NSRect aRect, float frameWidth,
NSCompositingOperation op)
{
NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
NSRect remainder = aRect;
NSRect rects[4];
int i;
for (i = 0; i < 4; i++)
{
NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]);
}
NSRectFillListUsingOperation(rects, 4, op);
}
NSRect

View file

@ -531,12 +531,19 @@ static NSImage *_pbc_image[2];
{
index = [[_menu menuRepresentation] highlightedItemIndex];
if (index < 0)
index = [self indexOfSelectedItem];
if (index < 0)
index = 0;
[self selectItemAtIndex: index];
if (index < 0)
{
// If no item is highighted, display the selected one ...
index = [self indexOfSelectedItem];
// ... if there is nown, then the first one, but don't select it.
if (index < 0)
index = 0;
}
else
{
// Selected the highlighted item
[self selectItemAtIndex: index];
}
}
if ((index >= 0) && ([_menu numberOfItems] > index))