quakeforge/tools/Forge/PopScrollView.m
Jeff Teunissen 317d3bddb8 New program (incomplete, and horridly broken): Forge.app. It's going to be
a GNUstep port of the original Quake editor for NeXTstep, QuakeEd.app.
2001-02-09 01:52:44 +00:00

87 lines
1.5 KiB
Objective-C

#import "qedefs.h"
@implementation PopScrollView
/*
====================
initFrame: button:
Initizes a scroll view with a button at it's lower right corner
====================
*/
- initFrame:(const NXRect *)frameRect button1:b1 button2:b2
{
[super initFrame: frameRect];
[self addSubview: b1];
[self addSubview: b2];
button1 = b1;
button2 = b2;
[self setHorizScrollerRequired: YES];
[self setVertScrollerRequired: YES];
[self setBorderType: NX_BEZEL];
return self;
}
/*
================
tile
Adjust the size for the pop up scale menu
=================
*/
- tile
{
NXRect scrollerframe;
NXRect buttonframe, buttonframe2;
NXRect newframe;
[super tile];
[button1 getFrame: &buttonframe];
[button2 getFrame: &buttonframe2];
[hScroller getFrame: &scrollerframe];
newframe.origin.y = scrollerframe.origin.y;
newframe.origin.x = frame.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;
[hScroller setFrame: &scrollerframe];
return self;
}
- superviewSizeChanged:(const NXSize *)oldSize
{
[super superviewSizeChanged: oldSize];
[[self docView] newSuperBounds];
return self;
}
-(BOOL) acceptsFirstResponder
{
return YES;
}
@end