| 45 | } |
| 46 | |
| 47 | void CEntryText::OnClick( |
| 48 | CGump *gump, uint8_t font, bool unicode, int x, int y, TEXT_ALIGN_TYPE align, uint16_t flags) |
| 49 | { |
| 50 | if (g_EntryPointer != this) |
| 51 | { |
| 52 | CGump *gumpEntry = g_GumpManager.GetTextEntryOwner(); |
| 53 | if (gumpEntry != nullptr) |
| 54 | { |
| 55 | gumpEntry->FrameCreated = false; |
| 56 | } |
| 57 | |
| 58 | g_EntryPointer = this; |
| 59 | Changed = true; |
| 60 | } |
| 61 | if (g_EntryPointer == this) |
| 62 | { |
| 63 | int oldPos = m_Position; |
| 64 | if (unicode) |
| 65 | { |
| 66 | m_Position = g_FontManager.CalculateCaretPosW(font, WText, x, y, Width, align, flags); |
| 67 | } |
| 68 | else |
| 69 | { |
| 70 | m_Position = |
| 71 | g_FontManager.CalculateCaretPosA(font, GetTextA(), x, y, Width, align, flags); |
| 72 | } |
| 73 | |
| 74 | if (oldPos != m_Position) |
| 75 | { |
| 76 | Changed = true; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | if (gump != nullptr) |
| 81 | { |
| 82 | gump->FrameCreated = false; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | void CEntryText::OnKey(CGump *gump, Keycode key) |
| 87 | { |
nothing calls this directly
no test coverage detected