mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-15 01:11:27 +00:00
43 lines
680 B
R
43 lines
680 B
R
|
#include <string.h>
|
||
|
|
||
|
#include "ruamoko/qwaq/ui/group.h"
|
||
|
#include "ruamoko/qwaq/ui/stringview.h"
|
||
|
|
||
|
@implementation StringView
|
||
|
|
||
|
-initWithRect:(Rect)rect string:(string)str
|
||
|
{
|
||
|
if (!(self = [super initWithRect:rect])) {
|
||
|
return nil;
|
||
|
}
|
||
|
self.str = str;
|
||
|
growMode = gfGrowHiX;
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
+(StringView *)withRect:(Rect)rect
|
||
|
{
|
||
|
return [[[self alloc] initWithRect:rect string:nil] autorelease];
|
||
|
}
|
||
|
|
||
|
+(StringView *)withRect:(Rect)rect string:(string)str
|
||
|
{
|
||
|
return [[[self alloc] initWithRect:rect string:str] autorelease];
|
||
|
}
|
||
|
|
||
|
-setString:(string) newTitle
|
||
|
{
|
||
|
str = newTitle;
|
||
|
[self redraw];
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
-draw
|
||
|
{
|
||
|
[super draw];
|
||
|
[self mvaddstr: { 0, 0}, str];
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
@end
|