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

Method onMouseUp

Engine/source/gui/controls/guiMLTextCtrl.cpp:832–866  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

830
831//--------------------------------------------------------------------------
832void 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//--------------------------------------------------------------------------
869void 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