MCPcopy Create free account
hub / github.com/crossuo/crossuo / OnClick

Method OnClick

src/TextEngine/EntryText.cpp:47–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void 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
86void CEntryText::OnKey(CGump *gump, Keycode key)
87{

Callers

nothing calls this directly

Calls 3

GetTextEntryOwnerMethod · 0.80
CalculateCaretPosWMethod · 0.80
CalculateCaretPosAMethod · 0.80

Tested by

no test coverage detected