mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
d23300d58b
The result isn't perfect, but it cleans up the whitespace and makes the code more consistent with the rest of the project.
80 lines
1.5 KiB
Objective-C
80 lines
1.5 KiB
Objective-C
|
|
#include "PopScrollView.h"
|
|
|
|
@implementation PopScrollView
|
|
/*
|
|
====================
|
|
initWithFrame: button:
|
|
|
|
Initizes a scroll view with a button at it's lower right corner
|
|
====================
|
|
*/
|
|
- initWithFrame:(NSRect)
|
|
frameRect button1:b1 button2:b2 {
|
|
[super initWithFrame:frameRect];
|
|
|
|
[self addSubview:b1];
|
|
[self addSubview:b2];
|
|
|
|
button1 = b1;
|
|
button2 = b2;
|
|
|
|
[self setHasHorizontalScroller:YES];
|
|
[self setHasVerticalScroller:YES];
|
|
|
|
[self setBorderType:NSBezelBorder];
|
|
|
|
return self;
|
|
}
|
|
/*
|
|
================
|
|
tile
|
|
|
|
Adjust the size for the pop up scale menu
|
|
=================
|
|
*/ -tile
|
|
{
|
|
NSRect scrollerframe;
|
|
NSRect buttonframe, buttonframe2;
|
|
NSRect newframe;
|
|
|
|
[super tile];
|
|
buttonframe =[button1 frame];
|
|
buttonframe2 =[button2 frame];
|
|
scrollerframe =[_horizScroller frame];
|
|
|
|
newframe.origin.y = scrollerframe.origin.y;
|
|
newframe.origin.x = scrollerframe.size.width - buttonframe.size.width;
|
|
newframe.size.width = buttonframe.size.width;
|
|
newframe.size.height = scrollerframe.size.height;
|
|
scrollerframe.size.width -= newframe.size.width;
|
|
[button1 setFrame:newframe];
|
|
newframe.size.width = buttonframe2.size.width;
|
|
newframe.origin.x -= newframe.size.width;
|
|
[button2 setFrame:newframe];
|
|
scrollerframe.size.width -= newframe.size.width;
|
|
|
|
[_horizScroller setFrame:scrollerframe];
|
|
|
|
return self;
|
|
}
|
|
|
|
/*
|
|
- superviewSizeChanged:(const NSSize *)oldSize
|
|
{
|
|
[super superviewSizeChanged: oldSize];
|
|
|
|
[[self docView] newSuperBounds];
|
|
|
|
return self;
|
|
}
|
|
*/
|
|
|
|
-(BOOL) acceptsFirstResponder
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
|
|
|
|
@end
|