2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
#import "qedefs.h"
|
|
|
|
|
|
|
|
@implementation PopScrollView
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
initFrame: button:
|
|
|
|
|
|
|
|
Initizes a scroll view with a button at it's lower right corner
|
|
|
|
====================
|
|
|
|
*/
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
- (id) initWithFrame: (NSRect) frameRect button1: (NSButton *) b1 button2: (NSButton *) b2
|
2001-02-09 01:52:44 +00:00
|
|
|
{
|
2001-05-07 09:43:25 +00:00
|
|
|
[super initWithFrame: frameRect];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
[self addSubview: b1];
|
|
|
|
[self addSubview: b2];
|
|
|
|
|
|
|
|
button1 = b1;
|
|
|
|
button2 = b2;
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
[self setHasHorizontalScroller: YES];
|
|
|
|
[self setHasVerticalScroller: YES];
|
|
|
|
|
|
|
|
[self setBorderType: NSBezelBorder];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
tile
|
|
|
|
|
|
|
|
Adjust the size for the pop up scale menu
|
|
|
|
=================
|
|
|
|
*/
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
- (void) tile
|
2001-02-09 01:52:44 +00:00
|
|
|
{
|
2001-05-07 09:43:25 +00:00
|
|
|
NSRect scrollerframe;
|
|
|
|
NSRect buttonframe, buttonframe2;
|
|
|
|
NSRect newframe;
|
|
|
|
|
2001-02-09 01:52:44 +00:00
|
|
|
[super tile];
|
2001-05-07 09:43:25 +00:00
|
|
|
[button1 setFrame: buttonframe];
|
|
|
|
[button2 setFrame: buttonframe2];
|
|
|
|
[[self horizontalScroller] setFrame: scrollerframe];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
|
|
|
newframe.origin.y = scrollerframe.origin.y;
|
2001-05-07 09:43:25 +00:00
|
|
|
newframe.origin.x = [self frame].size.width - buttonframe.size.width;
|
2001-02-09 01:52:44 +00:00
|
|
|
newframe.size.width = buttonframe.size.width;
|
|
|
|
newframe.size.height = scrollerframe.size.height;
|
|
|
|
scrollerframe.size.width -= newframe.size.width;
|
2001-05-07 09:43:25 +00:00
|
|
|
[button1 setFrame: newframe];
|
2001-02-09 01:52:44 +00:00
|
|
|
newframe.size.width = buttonframe2.size.width;
|
|
|
|
newframe.origin.x -= newframe.size.width;
|
2001-05-07 09:43:25 +00:00
|
|
|
[button2 setFrame: newframe];
|
2001-02-09 01:52:44 +00:00
|
|
|
scrollerframe.size.width -= newframe.size.width;
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
[[self horizontalScroller] setFrame: scrollerframe];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
return;
|
2001-02-09 01:52:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
- (void) resizeWithOldSuperviewSize: (NSSize) oldFrameSize
|
2001-02-09 01:52:44 +00:00
|
|
|
{
|
2001-05-07 09:43:25 +00:00
|
|
|
[super resizeWithOldSuperviewSize: oldFrameSize];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
[[self documentView] newSuperBounds];
|
2001-02-09 01:52:44 +00:00
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
return;
|
2001-02-09 01:52:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-07 09:43:25 +00:00
|
|
|
- (BOOL) acceptsFirstResponder
|
2001-02-09 01:52:44 +00:00
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|