MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / onMouseUp

Method onMouseUp

Engine/source/gui/controls/guiMLTextCtrl.cpp:828–862  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getMouseLockedControlMethod · 0.80
createSubstring8Method · 0.80
lenMethod · 0.45

Tested by

no test coverage detected