mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
731a123b79
The title bar is special in that it is always centered at the top of its owner, thus it takes no rect.
41 lines
565 B
R
41 lines
565 B
R
#include <string.h>
|
|
|
|
#include "qwaq-group.h"
|
|
#include "qwaq-titlebar.h"
|
|
|
|
@implementation TitleBar
|
|
|
|
-initWithTitle:(string) title
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
self.title = title;
|
|
length = strlen (title);
|
|
growMode = gfGrowHiX;
|
|
return self;
|
|
}
|
|
|
|
-setTitle:(string) newTitle
|
|
{
|
|
title = newTitle;
|
|
length = strlen (title);
|
|
[self redraw];
|
|
return self;
|
|
}
|
|
|
|
-setOwner: (Group *) owner
|
|
{
|
|
[super setOwner: owner];
|
|
size = [owner size];
|
|
return self;
|
|
}
|
|
|
|
-draw
|
|
{
|
|
[super draw];
|
|
[self mvaddstr: { (xlen - length) / 2, 0}, title];
|
|
return self;
|
|
}
|
|
|
|
@end
|