branch | cpp_gui |
changeset 6286 | 6e8eec87fa9d |
parent 6285 | 187e3ef04cc9 |
child 6289 | be3d8bd9fb02 |
6285:187e3ef04cc9 | 6286:6e8eec87fa9d |
---|---|
161 |
161 |
162 |
162 |
163 |
163 |
164 template <> struct WindowT<WC_TEST1> : public BaseWindow { |
164 template <> struct WindowT<WC_TEST1> : public BaseWindow { |
165 |
165 |
166 gui::WidgetPtr m_label1; |
|
166 gui::WidgetPtr m_button1; |
167 gui::WidgetPtr m_button1; |
167 |
168 |
168 WindowT() |
169 WindowT() |
169 : BaseWindow(WC_TEST1, STR_015B_OPENTTD, COLOUR_BROWN, gui::FF_NONE) |
170 : BaseWindow(WC_TEST1, STR_015B_OPENTTD, COLOUR_BROWN, gui::FF_NONE) |
170 { |
171 { |
175 /* set common window properties */ |
176 /* set common window properties */ |
176 SetTopLeft(Point16(140, 40)); |
177 SetTopLeft(Point16(140, 40)); |
177 SetSize(Point16(336, 195)); |
178 SetSize(Point16(336, 195)); |
178 |
179 |
179 /* add controls */ |
180 /* add controls */ |
180 m_button1 = new gui::TextButton(this, 22, gui::FF_NONE, COLOUR_YELLOW, Rect16(104, 175, 231, 186), STR_0305_QUIT_OPENTTD, STR_0304_QUIT); |
181 m_label1 = new gui::Label(this, 22, gui::FF_NONE, Rect16(104, 155, 231, 166), STR_0305_QUIT_OPENTTD, STR_0305_QUIT_OPENTTD, COLOUR_BROWN); |
182 m_label1->SetAnchors(PIN_RIGHT | PIN_BOTTOM); |
|
183 AddWidget(m_label1); |
|
184 |
|
185 /* add controls */ |
|
186 m_button1 = new gui::TextButton(this, 23, gui::FF_NONE, COLOUR_YELLOW, Rect16(104, 175, 231, 186), STR_0305_QUIT_OPENTTD, STR_0304_QUIT); |
|
181 m_button1->SetAnchors(PIN_RIGHT | PIN_BOTTOM); |
187 m_button1->SetAnchors(PIN_RIGHT | PIN_BOTTOM); |
182 AddWidget(m_button1); |
188 AddWidget(m_button1); |
183 |
189 |
184 /* connect control callbacks */ |
190 /* connect control callbacks */ |
185 m_button1->AddReflectHandlerT(&WindowT::Button1_OnClick); |
191 m_button1->AddReflectHandlerT(&WindowT::Button1_OnClick); |