mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
ac25d9f1c1
Now the device windows close properly when an input device is removed.
42 lines
675 B
R
42 lines
675 B
R
#include <string.h>
|
|
#include "ruamoko/qwaq/ui/tableview.h"
|
|
#include "ruamoko/qwaq/device/axisview.h"
|
|
#include "ruamoko/qwaq/device/nameview.h"
|
|
|
|
@implementation AxisView
|
|
|
|
-initWithAxis:(in_axisinfo_t *)axis
|
|
{
|
|
if (!(self = [super init])) {
|
|
return nil;
|
|
}
|
|
self.axis = axis;
|
|
return self;
|
|
}
|
|
|
|
+withAxis:(in_axisinfo_t *)axis
|
|
{
|
|
return [[[self alloc] initWithAxis:axis] retain];
|
|
}
|
|
|
|
-draw
|
|
{
|
|
[super draw];
|
|
[self mvprintf:{0, 0}, "%*d", xlen, axis.value];
|
|
return self;
|
|
}
|
|
|
|
-(int)rows
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
-(View *)viewAtRow:(int)row forColumn:(TableViewColumn *)column
|
|
{
|
|
if ([column name] == "axis") {
|
|
return [NameView withName:sprintf("%d", axis.axis)];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
@end
|