2004-02-04 02:35:57 +00:00
|
|
|
#include "gui/Group.h"
|
|
|
|
#include "gui/Point.h"
|
|
|
|
#include "Array.h"
|
|
|
|
|
|
|
|
@implementation Group
|
|
|
|
|
2004-02-13 02:51:38 +00:00
|
|
|
- (id) init
|
2004-02-04 02:35:57 +00:00
|
|
|
{
|
2004-02-13 02:51:38 +00:00
|
|
|
self = [super init];
|
2004-02-04 02:35:57 +00:00
|
|
|
views = [[Array alloc] init];
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
2004-11-18 05:08:00 +00:00
|
|
|
[views release];
|
2004-02-13 05:36:35 +00:00
|
|
|
[super dealloc];
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (View) addView: (View)aView
|
|
|
|
{
|
|
|
|
[views addItem:aView];
|
2004-02-13 02:51:38 +00:00
|
|
|
return aView;
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
2004-11-18 05:08:00 +00:00
|
|
|
- (id) addViews: (Array)viewlist
|
|
|
|
{
|
2005-06-12 08:38:47 +00:00
|
|
|
while ([viewlist count]) {
|
|
|
|
[self addView:[viewlist getItemAt:0]];
|
|
|
|
[viewlist removeItemAt:0];
|
|
|
|
}
|
2004-11-18 05:08:00 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2004-02-04 02:35:57 +00:00
|
|
|
- (void) moveTo: (integer)x y:(integer)y
|
|
|
|
{
|
|
|
|
[self setBasePos: x y:y];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setBasePos: (Point) pos
|
|
|
|
{
|
|
|
|
[super setBasePos:pos];
|
|
|
|
local Point point = [[Point alloc] initWithComponents:xabs :yabs];
|
|
|
|
[views makeObjectsPerformSelector:@selector (setBasePos:) withObject:point];
|
2004-11-18 05:08:00 +00:00
|
|
|
[point release];
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) draw
|
|
|
|
{
|
|
|
|
[views makeObjectsPerformSelector:@selector (draw)];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|