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
|
|
|
}
|
|
|
|
|
2011-02-14 13:13:55 +00:00
|
|
|
- (View *) addView: (View *)aView
|
2004-02-04 02:35:57 +00:00
|
|
|
{
|
2010-12-12 10:40:24 +00:00
|
|
|
[views addObject:aView];
|
2004-02-13 02:51:38 +00:00
|
|
|
return aView;
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
2011-02-14 13:13:55 +00:00
|
|
|
- (id) addViews: (Array *)viewlist
|
2004-11-18 05:08:00 +00:00
|
|
|
{
|
2005-06-12 08:38:47 +00:00
|
|
|
while ([viewlist count]) {
|
2010-12-12 01:27:51 +00:00
|
|
|
[self addView: [viewlist objectAtIndex: 0]];
|
|
|
|
[viewlist removeObjectAtIndex: 0];
|
2005-06-12 08:38:47 +00:00
|
|
|
}
|
2004-11-18 05:08:00 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2011-03-25 07:46:32 +00:00
|
|
|
- (void) moveTo: (int)x y:(int)y
|
2004-02-04 02:35:57 +00:00
|
|
|
{
|
|
|
|
[self setBasePos: x y:y];
|
|
|
|
}
|
|
|
|
|
2011-03-25 07:46:32 +00:00
|
|
|
- (void) setBasePos: (int) x y: (int) y
|
2004-02-04 02:35:57 +00:00
|
|
|
{
|
2010-11-24 02:46:45 +00:00
|
|
|
[super setBasePos: x y:y];
|
|
|
|
local SEL sel = @selector (setBasePosFromView:);
|
|
|
|
[views makeObjectsPerformSelector:sel withObject:self];
|
|
|
|
}
|
|
|
|
|
2011-02-14 13:13:55 +00:00
|
|
|
- (void) setBasePosFromView: (View *) view
|
2010-11-24 02:46:45 +00:00
|
|
|
{
|
|
|
|
[super setBasePosFromView:view];
|
2010-11-17 09:59:39 +00:00
|
|
|
local SEL sel = @selector (setBasePosFromView:);
|
|
|
|
[views makeObjectsPerformSelector:sel withObject:self];
|
2004-02-04 02:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) draw
|
|
|
|
{
|
|
|
|
[views makeObjectsPerformSelector:@selector (draw)];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|