4 * Created on: Sep 9, 2012
10 #include "../loader/Interpreter.h"
11 #include "../loader/TypeDescription.h"
13 using loader::FieldDescription;
14 using loader::Interpreter;
15 using loader::TypeDescription;
19 void MenuProperties::CreateTypeDescription() {
22 TypeDescription &td(TypeDescription::Create(TYPE_ID, "MenuProperties"));
23 td.SetConstructor(&Construct);
24 td.SetSize(sizeof(MenuProperties));
26 td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), Font::TYPE_ID).SetReferenced().SetDescription("the font to use for normal/enabled entries"));
27 td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), Font::TYPE_ID).SetReferenced().SetDescription("the font for disabled entries"));
28 td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), Sprite::TYPE_ID).SetReferenced().SetDescription("the cursor sprite indicating the current selection"));
29 td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("width of an entry in characters"));
30 td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("number of visible rows"));
31 td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between rows in pixles"));
32 td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space reserved for icons in pixels"));
33 td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("number of columns"));
34 td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between cols in pixels"));
35 td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), Interpreter::STRING_ID).SetDescription("delimiter between text and number; only first character is used"));
36 td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("maximum width of a number in chars"));
37 td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("maximum number of additional text characters"));
38 td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between normal and additional text in pixels"));
41 void MenuProperties::Construct(void *data) {
42 new (data) MenuProperties;