| 2204 | } |
| 2205 | |
| 2206 | char temp[8]; |
| 2207 | p = _text + CopyTextElement(_text, static_cast<int>(q - (const char*)_text), _font->GetLangID(), temp, |
| 2208 | sizeof(temp)); |
| 2209 | width += GLOB_ENGINE->GetTextWidth(size, _font, temp); |
| 2210 | |
| 2211 | if (width > lineWidth) |
| 2212 | { |
| 2213 | if (n > 0) |
| 2214 | { |
| 2215 | p = word; |
| 2216 | } |
| 2217 | else |
| 2218 | { |
| 2219 | p = q; |
| 2220 | } |
| 2221 | _lines.Add(p - (const char*)_text); |
| 2222 | break; |
| 2223 | } |
| 2224 | } |
| 2225 | } |
| 2226 | } |
| 2227 | |
| 2228 | CButton::CButton(ControlsContainer* parent, const ParamEntry& cls, float x, float y, float w, float h) |
| 2229 | : Control(parent, CT_BUTTON, cls >> "idc", cls >> "style", x, y, w, h) |
| 2230 | { |
| 2231 | _text = DecodeControlText(cls >> "text"); |
| 2232 | _ftColor = GetPackedColor(cls >> "colorText"); |
| 2233 | _font = GLOB_ENGINE->LoadFont(GetFontID(cls >> "font")); |
| 2234 | const ParamEntry* entry = cls.FindEntry("size"); |
| 2235 | if (entry) |
| 2236 | { |
| 2237 | _size = (float)(*entry) * _font->Height(); |
nothing calls this directly
no test coverage detected