| 1 |
bearsoft |
1.1 |
#include "Button.h" |
| 2 |
|
|
#include "../System/System.h" |
| 3 |
|
|
#include "../System/SystemDefine.h" |
| 4 |
|
|
#include "../Array/ObjectArray.h"
|
| 5 |
|
|
|
| 6 |
|
|
/*
|
| 7 |
|
|
<a href="http://www.fukt.hk-r.se/~bearsoft/tmb/moose1998.html">
|
| 8 |
|
|
Productions 1998</a>
|
| 9 |
|
|
*/
|
| 10 |
|
|
|
| 11 |
|
|
Button::Button() |
| 12 |
|
|
{
|
| 13 |
|
|
name = new String();
|
| 14 |
|
|
value = new String();
|
| 15 |
|
|
data = new String();
|
| 16 |
|
|
width=-1;
|
| 17 |
|
|
} |
| 18 |
|
|
|
| 19 |
|
|
Button::~Button() |
| 20 |
|
|
{
|
| 21 |
|
|
if (name != null) |
| 22 |
|
|
{
|
| 23 |
|
|
delete name;
|
| 24 |
|
|
}
|
| 25 |
|
|
|
| 26 |
|
|
if (value != null)
|
| 27 |
|
|
{
|
| 28 |
|
|
delete value;
|
| 29 |
|
|
}
|
| 30 |
|
|
|
| 31 |
|
|
if (data != null)
|
| 32 |
|
|
{
|
| 33 |
|
|
delete data;
|
| 34 |
|
|
}
|
| 35 |
|
|
}
|
| 36 |
|
|
|
| 37 |
|
|
void Button::create()
|
| 38 |
|
|
{
|
| 39 |
|
|
String startData="<input type=submit name=";
|
| 40 |
|
|
|
| 41 |
|
|
if (width>=0)
|
| 42 |
|
|
{
|
| 43 |
|
|
data->setString(startData + name + " value=" + value + ">");
|
| 44 |
|
|
}
|
| 45 |
|
|
else
|
| 46 |
|
|
{
|
| 47 |
|
|
data->setString(startData + name + " value=" + value + " width=" + width + ">");
|
| 48 |
|
|
}
|
| 49 |
|
|
|
| 50 |
|
|
// System::println(data);
|
| 51 |
|
|
} |
| 52 |
|
|
|
| 53 |
|
|
void Button::setValue(char* iValue)
|
| 54 |
|
|
{
|
| 55 |
|
|
value->setString(iValue);
|
| 56 |
|
|
}
|
| 57 |
|
|
|
| 58 |
|
|
void Button::setName(char* iName)
|
| 59 |
|
|
{
|
| 60 |
|
|
name->setString(iName);
|
| 61 |
|
|
}
|
| 62 |
|
|
|
| 63 |
|
|
String *Button::getName()
|
| 64 |
|
|
{
|
| 65 |
|
|
return name;
|
| 66 |
|
|
}
|
| 67 |
|
|
|
| 68 |
|
|
String *Button::getValue()
|
| 69 |
|
|
{
|
| 70 |
|
|
return value;
|
| 71 |
|
|
}
|