hi. ich hab mit eienr subklasse des nssliders das aussehen von dem etwas verändert.. aber jetzt löst der keien funktion mehr beim verschieben aus. Was ist falsch oder was fehlt noch damit das geht?
Alles anzeigen
Alles anzeigen
und hier die headerdatein (sind glaub ich nicht so wichtig):
Quellcode
- #import "MySliderCell.h"
- @implementation MySliderCell
- - (void)drawBarInside:(NSRect)frame flipped:(BOOL)flipped
- {
- NSImage *leftImage = [NSImage imageNamed:@"left.tiff"];
- NSImage *fillImage = [NSImage imageNamed:@"mitte.tiff"];
- NSImage *rightImage = [NSImage imageNamed:@"right.tiff"];
- NSSize size = [leftImage size];
- float addX = size.width / 2.0;
- float y = NSMaxY(frame) - (frame.size.height-size.height)/2.0 - 1;
- float x = frame.origin.x+addX;
- float fillX = x + size.width;
- float fillWidth = frame.size.width - size.width - addX;
- [leftImage compositeToPoint:NSMakePoint(x, y) operation:NSCompositeSourceOver];
- size = [rightImage size];
- addX = size.width / 2.0;
- x = NSMaxX(frame) - size.width - addX;
- fillWidth -= size.width+addX;
- [rightImage compositeToPoint:NSMakePoint(x, y) operation:NSCompositeSourceOver];
- [fillImage setScalesWhenResized:YES];
- [fillImage setSize:NSMakeSize(fillWidth, [fillImage size].height)];
- [fillImage compositeToPoint:NSMakePoint(fillX, y) operation:NSCompositeSourceOver];
- }
- - (void)drawKnob:(NSRect)frame
- {
- NSImage * knob;
- knob = [NSImage imageNamed:@"knob.tiff"];
- float x = frame.origin.x + (frame.size.width - [knob size].width) / 2;
- float y = NSMaxY(frame) - (frame.size.height - [knob size].height) / 2 + 2;
- [knob compositeToPoint:NSMakePoint(x, y) operation:NSCompositeSourceOver];
- }
- - (BOOL)_usesCustomTrackImage
- {
- return YES;
- }
- @end
Quellcode
und hier die headerdatein (sind glaub ich nicht so wichtig):
Windows, nein danke...