--------------------------------------------------------------------------
| 830 | |
| 831 | //-------------------------------------------------------------------------- |
| 832 | void GuiMLTextCtrl::onMouseUp(const GuiEvent& event) |
| 833 | { |
| 834 | if (!mActive || (getRoot()->getMouseLockedControl() != this)) |
| 835 | return; |
| 836 | |
| 837 | mouseUnlock(); |
| 838 | |
| 839 | //see if we've clicked on a URL |
| 840 | Atom *hitAtom = findHitAtom(globalToLocalCoord(event.mousePoint)); |
| 841 | if (mHitURL && hitAtom && hitAtom->url == mHitURL && mHitURL->mouseDown) |
| 842 | { |
| 843 | mHitURL->mouseDown = false; |
| 844 | |
| 845 | // Convert URL from UTF16 to UTF8. |
| 846 | UTF8* url = mTextBuffer.createSubstring8(mHitURL->textStart, mHitURL->len); |
| 847 | onURL_callback(url); |
| 848 | |
| 849 | delete[] url; |
| 850 | mHitURL = NULL; |
| 851 | |
| 852 | setUpdate(); |
| 853 | return; |
| 854 | } |
| 855 | |
| 856 | //else, update our selection |
| 857 | else |
| 858 | { |
| 859 | if ((event.mousePoint - mSelectionAnchorDropped).len() < 3) |
| 860 | mSelectionActive = false; |
| 861 | |
| 862 | setCursorPosition(getTextPosition(globalToLocalCoord(event.mousePoint))); |
| 863 | mVertMoveAnchorValid = false; |
| 864 | setUpdate(); |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | //-------------------------------------------------------------------------- |
| 869 | void GuiMLTextCtrl::getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent) |
nothing calls this directly
no test coverage detected