quakeforge/ruamoko/qwaq/ui/stringview.r
Bill Currie 0a60f46a64 [qwaq] Implement more debugger def views
Structs and arrays now work (though could be better, eg collapsible).
2021-09-25 01:42:36 +09:00

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