| 99 | } |
| 100 | |
| 101 | void TextField::onButton(const ButtonEvent& e) { |
| 102 | OpaqueWidget::onButton(e); |
| 103 | |
| 104 | if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) { |
| 105 | cursor = selection = getTextPosition(e.pos); |
| 106 | } |
| 107 | |
| 108 | if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_RIGHT) { |
| 109 | createContextMenu(); |
| 110 | e.consume(this); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | void TextField::onSelectText(const SelectTextEvent& e) { |
| 115 | std::u32string s32(1, char32_t(e.codepoint)); |