mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4440 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
42131af015
commit
cbab6b83ae
3 changed files with 65 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
yet.
|
||||
* Source/NSTabViewItem.m: drawing. still need to move the drawing
|
||||
of the top line out of this and move it into NSTabView's drawRect.
|
||||
* Source/NSPopUpButtonCell.m: moved all backend code to frontend.
|
||||
|
||||
1999-06-20 Michael Hanni <mhanni@sprintmail.com>
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
#include <gnustep/gui/config.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/NSFont.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSMatrix.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
#include <AppKit/NSPopUpButtonCell.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
@implementation NSPopUpButtonCell
|
||||
+ (void) initialize
|
||||
|
@ -8,4 +13,56 @@
|
|||
if (self == [NSPopUpButtonCell class])
|
||||
[self setVersion: 1];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [super init];
|
||||
}
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame
|
||||
inView:(NSView*)view
|
||||
{
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
NSRect rect = cellFrame;
|
||||
NSRect arect = cellFrame;
|
||||
NSPoint point;
|
||||
|
||||
NSDrawButton(cellFrame, cellFrame);
|
||||
|
||||
arect.size.width -= 4;
|
||||
arect.size.height -= 4;
|
||||
arect.origin.x += 2;
|
||||
arect.origin.y += 2;
|
||||
|
||||
if (cell_highlighted) {
|
||||
[[NSColor whiteColor] set];
|
||||
NSRectFill(arect);
|
||||
} else {
|
||||
[[NSColor lightGrayColor] set];
|
||||
NSRectFill(arect);
|
||||
}
|
||||
|
||||
[cell_font set];
|
||||
|
||||
point.y = rect.origin.y + (rect.size.height/2) - 4;
|
||||
point.x = rect.origin.x + xDist;
|
||||
rect.origin = point;
|
||||
|
||||
[[NSColor blackColor] set];
|
||||
|
||||
// Draw the title.
|
||||
|
||||
DPSmoveto(ctxt, rect.origin.x, rect.origin.y);
|
||||
DPSshow(ctxt, [contents cString]);
|
||||
|
||||
rect.size.width = 15; // calc image rect
|
||||
rect.size.height = cellFrame.size.height;
|
||||
rect.origin.x = cellFrame.origin.x + cellFrame.size.width - (6 + 11);
|
||||
rect.origin.y = cellFrame.origin.y;
|
||||
|
||||
if ([(NSPopUpButton *)view titleOfSelectedItem] == contents)
|
||||
{
|
||||
[super _drawImage:[NSImage imageNamed:@"common_Nibble"] inFrame:rect];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -291,6 +291,13 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSView*) hitTest: (NSPoint)aPoint
|
||||
{}
|
||||
|
||||
- (BOOL) mouse: (NSPoint)aPoint inRect: (NSRect)aRect
|
||||
{
|
||||
}
|
||||
|
||||
// Coding.
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
|
|
Loading…
Reference in a new issue