2004-02-03 08:31:26 +00:00
|
|
|
#include "gui/Size.h"
|
|
|
|
#include "gui/Point.h"
|
|
|
|
#include "gui/Rect.h"
|
|
|
|
#include "gui/View.h"
|
|
|
|
|
|
|
|
@implementation View
|
|
|
|
|
|
|
|
- (id) initWithComponents: (integer)x : (integer)y : (integer)w : (integer)h
|
|
|
|
{
|
2004-02-13 02:51:38 +00:00
|
|
|
self = [self init];
|
2004-02-03 08:31:26 +00:00
|
|
|
xpos = xabs = x;
|
|
|
|
ypos = yabs = y;
|
|
|
|
xlen = w;
|
2004-02-13 05:36:35 +00:00
|
|
|
ylen = h;
|
2004-02-03 08:31:26 +00:00
|
|
|
parent = NIL;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithOrigin: (Point)anOrigin size: (Size)aSize
|
|
|
|
{
|
|
|
|
return [self initWithComponents:anOrigin.x :anOrigin.y
|
|
|
|
:aSize.width :aSize.height];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithBounds: (Rect)aRect
|
|
|
|
{
|
|
|
|
return [self initWithOrigin:aRect.origin size:aRect.size];
|
|
|
|
}
|
|
|
|
|
2004-11-18 05:08:00 +00:00
|
|
|
- (id) canFocus: (integer) cf
|
|
|
|
{
|
|
|
|
flags |= 1;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (integer) canFocus
|
|
|
|
{
|
|
|
|
return flags & 1;
|
|
|
|
}
|
|
|
|
|
2010-11-17 09:59:39 +00:00
|
|
|
- (Point) basePos
|
|
|
|
{
|
|
|
|
return makePoint (xabs, yabs);
|
|
|
|
}
|
|
|
|
|
2004-02-03 08:31:26 +00:00
|
|
|
- (void) setBasePos: (integer) x y: (integer) y
|
|
|
|
{
|
2010-11-17 06:50:07 +00:00
|
|
|
local Point point = {x, y};
|
2010-11-17 09:59:39 +00:00
|
|
|
xabs = xpos + x;
|
|
|
|
yabs = ypos + y;
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
2010-11-17 09:59:39 +00:00
|
|
|
- (void) setBasePosFromView: (View) view
|
2004-02-04 02:35:57 +00:00
|
|
|
{
|
2010-11-17 09:59:39 +00:00
|
|
|
Point pos = [view basePos];
|
2004-02-04 02:35:57 +00:00
|
|
|
xabs = xpos + pos.x;
|
|
|
|
yabs = ypos + pos.y;
|
2004-02-03 08:31:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-(void) draw
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-11-18 05:08:00 +00:00
|
|
|
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-02-03 08:31:26 +00:00
|
|
|
@end
|