Code:
public static void pollTab(GameFont[] tda) {
Widget parent = addTabInterface(47000);
addSprite(47001, 106);
addText(47002, "Mikanscape Content Poll #1: Test Vote", tda, 2, 0xff981f, true, true);
addHoverButton_sprite_loader(47003, 107, 172, 20, "Close", -1, 47004, 1);
addHoveredButton_sprite_loader(47004, 108, 172, 20, 47005);
addText(47006, "You have not yet voted in this poll.", tda, 1, 0xFFFFFF, false, true);
addText(47007, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor \\nincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis \\nnostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
tda
, 1,
0xff981f,
false,
true);
addHoverButton_sprite_loader(47100, 487, 85, 22, "Submit", -1, 47101, 1);
addHoveredButton_sprite_loader(47101, 488, 85, 22, 47102);
addHoverButton_sprite_loader(47103, 487, 85, 22, "Cancel", -1, 47104, 1);
addHoveredButton_sprite_loader(47104, 488, 85, 22, 47105);
addText(47106, "Submit", tda, 0, 0xff981f, false, true);
addText(47107, "Results", tda, 0, 0xff981f, false, true);
Widget questionParent = addTabInterface(47008);
questionParent.width = 472;
questionParent.height = 262;
questionParent.scrollMax = 315;
addQuestion(47009, 1, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \\ntempor incididunt ut labore et dolore magna aliqua?", tda, false);
addQuestion(47023, 2, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \\ntempor incididunt ut labore et dolore magna aliqua?", tda, false);
addQuestion(47037, 3, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \\ntempor incididunt ut labore et dolore magna aliqua?", tda, false);
int parentChild = 0;
int questions = 3;
parent.totalChildren(12);
parent.child(parentChild++, 47001, 10, 2);
parent.child(parentChild++, 47002, 250, 12);
parent.child(parentChild++, 47003, 470, 9);
parent.child(parentChild++, 47004, 470, 9);
parent.child(parentChild++, 47006, 23, 42);
parent.child(parentChild++, 47100, 315, 38);
parent.child(parentChild++, 47101, 315, 38);
parent.child(parentChild++, 47103, 400, 38);
parent.child(parentChild++, 47104, 400, 38);
parent.child(parentChild++, 47107, 425, 43 );
parent.child(parentChild++, 47106, 340, 43);
parent.child(parentChild++, 47008, 0, 62);
int questionChild = 0;
int y = 60;
int id = 0;
questionParent.totalChildren(37);
questionParent.child(questionChild++, 47007, 23, 2);
for(int i = 0; i < questions; i++) {
questionParent.child(questionChild++, 47009 + 1 + id, 22, y + 2);
questionParent.child(questionChild++, 47009 + 2 + id, 20, y);
questionParent.child(questionChild++, 47009 + 3 + id, 24, y + 3);
questionParent.child(questionChild++, 47009 + 4 + id, 24, y + 14);
questionParent.child(questionChild++, 47009 + 5 + id, 24, y + 42);
questionParent.child(questionChild++, 47009 + 6 + id, 44, y + 46);
questionParent.child(questionChild++, 47009 + 7 + id, 24, y + 60);
questionParent.child(questionChild++, 47009 + 8 + id, 44, y + 64);
questionParent.child(questionChild++, 47009 + 9 + id, 70, y + 42);
questionParent.child(questionChild++, 47009 + 10 + id, 70, y + 60);
questionParent.child(questionChild++, 47009 + 11 + id, 260, y + 45);
questionParent.child(questionChild++, 47009 + 12 + id, 260, y + 63);
id += 14;
y += 85;
}
}
private static void addQuestion(int id, int i, String s, GameFont[] tda, boolean inactive) {
addBox(id + 1, 442, 80, 0xffffff, (byte)240, true);
addBox(id + 2, 446, 82, 0xffffff, (byte)190, false);
addText(id + 3, "Question " + i, tda, 0, 0xff981f, false, true);
addText(id + 4, s, tda, 1, 0xFFFFFF, false, true);
addButton(id + 5, 490, "Select");
addText(id + 6, "Yes", tda, 0, 0xff981f, false, true);
addButton(id + 7, 490, "Select");
addText(id + 8, "No", tda, 0, 0xff981f, false, true);
addBox(id + 9, 380, 17, 0x000000, (byte)180, true);
addBox(id + 10, 380, 17, 0x000000, (byte)200, true);
addText(id + 11, "100%", tda, 0, 0xffffff, true, true);
addText(id + 12, "100%", tda, 0, 0xffffff, true, true);
}
public static void addBox(int ID, int w, int h, int color, byte alpha, boolean filled) {
Widget t = interfaceCache[ID] = new Widget();
t.id = ID;
t.parent = ID;
t.type = 3;
t.atActionType = 1;
t.contentType = 0;
t.width = w;
t.height = h;
t.opacity = alpha;
t.textColor = color;
t.filled = filled;
t.drawsTransparent = true;
}