MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / FormPreview

Method FormPreview

game/ui/debugtools/formpreview.cpp:18–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{
17
18FormPreview::FormPreview() : Stage()
19{
20 displayform = nullptr;
21 currentSelected = nullptr;
22 currentSelectedControl = nullptr;
23 glowindex = 0;
24
25 previewselector = mksp<Form>();
26 previewselector->Size = {200, 300};
27 previewselector->Location = {2, 2};
28 previewselector->BackgroundColour = {192, 192, 192, 255};
29
30 auto ch = previewselector->createChild<Control>();
31 ch->Location = {2, 2};
32 ch->Size = previewselector->Size - 4;
33 ch->BackgroundColour = {80, 80, 80, 255};
34
35 auto c = ch->createChild<Control>();
36 c->Location = {2, 2};
37 c->Size = previewselector->Size - 4;
38 c->BackgroundColour = {80, 80, 80, 255};
39
40 auto l = c->createChild<Label>("Pick Form:", ui().getFont("smalfont"));
41 l->Location = {0, 0};
42 l->Size.x = c->Size.x;
43 l->Size.y = ui().getFont("smalfont")->getFontHeight();
44 l->BackgroundColour = {80, 80, 80, 255};
45
46 interactWithDisplay = c->createChild<CheckBox>(
47 fw().data->loadImage(
48 "PCK:xcom3/ufodata/newbut.pck:xcom3/ufodata/newbut.tab:65:ui/menuopt.pal"),
49 fw().data->loadImage(
50 "PCK:xcom3/ufodata/newbut.pck:xcom3/ufodata/newbut.tab:64:ui/menuopt.pal"));
51 interactWithDisplay->Size = {19, 16};
52 interactWithDisplay->Location.x = 0;
53 interactWithDisplay->Location.y = c->Size.y - interactWithDisplay->Size.y * 2;
54 interactWithDisplay->BackgroundColour = {80, 80, 80, 255};
55 interactWithDisplay->setChecked(true);
56
57 l = c->createChild<Label>("Interact?", ui().getFont("smalfont"));
58 l->Location.x = interactWithDisplay->Size.x + 2;
59 l->Location.y = interactWithDisplay->Location.y;
60 l->Size.x = c->Size.x - l->Location.x;
61 l->Size.y = interactWithDisplay->Size.y;
62 l->BackgroundColour = {80, 80, 80, 255};
63
64 reloadButton = c->createChild<TextButton>("Reload xml forms", ui().getFont("smalfont"));
65 reloadButton->Location = {0, interactWithDisplay->Location.y + interactWithDisplay->Size.y};
66 reloadButton->Name = "FORM_RELOAD";
67 reloadButton->Size = {c->Size.x, interactWithDisplay->Size.y};
68 reloadButton->BackgroundColour = {80, 80, 80, 255};
69
70 auto lb = c->createChild<ListBox>();
71 lb->Location.x = 0;
72 lb->Location.y = ui().getFont("smalfont")->getFontHeight();
73 lb->Size.x = c->Size.x;
74 lb->Size.y = interactWithDisplay->Location.y - lb->Location.y;
75 lb->Name = "FORM_LIST";

Callers

nothing calls this directly

Calls 9

getFormIDsMethod · 0.80
endMethod · 0.80
displayGetHeightMethod · 0.80
getFontMethod · 0.45
getFontHeightMethod · 0.45
loadImageMethod · 0.45
setCheckedMethod · 0.45
beginMethod · 0.45
getTextMethod · 0.45

Tested by

no test coverage detected