
#include "Controller.h"

#include <appkit/Form.h>

@implementation Controller

- formInput:sender
{
    const char	*svalue;
    double	dvalue;
    float	fvalue;
    int		ivalue;
    int		row;
    
    row = [testForm selectedRow];
    switch (row) {
    case 0:
    	[inForm setStringValue:"String" at:0];
	svalue = [testForm stringValueAt:0];
	[inForm setStringValue:svalue at:1];
	break;
    case 1:
    	[inForm setStringValue:"Int" at:0];
	ivalue = [testForm intValueAt:1];
	[inForm setIntValue:ivalue at:1];
	break;
    case 2:
    	[inForm setStringValue:"Float" at:0];
	fvalue = [testForm floatValueAt:2];
	[inForm setFloatValue:fvalue at:1];
	break;
    case 3:
    	[inForm setStringValue:"Double" at:0];
	dvalue = [testForm floatValueAt:3];
	[inForm setDoubleValue:dvalue at:1];
	break;
    }
    return self;
}
- testSetDoubleValue:sender
{
    [testForm setDoubleValue:1.23456789 at:3];
    return self;
}

- testSetFloatValue:sender
{
    [testForm setFloatValue:1.23456789 at:2];
    return self;
}

- testSetIntValue:sender
{
    [testForm setIntValue:123456789 at:1];
    return self;
}

- testSetStringValue:sender
{
    [testForm setStringValue:"a string value" at:0];
    return self;
}


@end
