mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
0a60f46a64
Structs and arrays now work (though could be better, eg collapsible).
42 lines
680 B
R
42 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
|