MCPcopy Create free account
hub / github.com/SpartanJ/eepp / onMouseClick

Method onMouseClick

src/eepp/ui/uicodeeditor.cpp:1865–1902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1863}
1864
1865Uint32 UICodeEditor::onMouseClick( const Vector2i& position, const Uint32& flags ) {
1866 mLastActivity.restart();
1867 for ( auto& plugin : mPlugins )
1868 if ( plugin->onMouseClick( this, position, flags ) )
1869 return UIWidget::onMouseClick( position, flags );
1870
1871 if ( mMinimapEnabled ) {
1872 Rectf rect( getMinimapRect( getScreenStart() ) );
1873 if ( ( flags & EE_BUTTON_LMASK ) && rect.contains( position.asFloat() ) )
1874 return 1;
1875 }
1876
1877 MouseBindings::Shortcut shortcut{ MouseAction::Click, flags,
1878 getInput()->getSanitizedModState() };
1879
1880 if ( tryExecuteMouseBinding( shortcut ) )
1881 return 1;
1882
1883 if ( ( flags & EE_BUTTON_LMASK ) && getInput()->isKeyModPressed() ) {
1884 String link( checkMouseOverLink( position ) );
1885 if ( !link.empty() ) {
1886 Engine::instance()->openURI( link.toUtf8() );
1887 resetLinkOver( position );
1888 }
1889 } else if ( ( flags & EE_BUTTON_MMASK ) && isMouseOverMeOrChildren() ) {
1890 auto txt( getUISceneNode()->getWindow()->getClipboard()->getText() );
1891 if ( !isLocked() && !txt.empty() ) {
1892 if ( mDoc->hasSelection() ) {
1893 auto selTxt = mDoc->getSelectedText();
1894 if ( !selTxt.empty() )
1895 txt = selTxt;
1896 }
1897 mDoc->setSelection( resolveScreenPosition( position.asFloat() ) );
1898 mDoc->textInput( txt );
1899 }
1900 }
1901 return 1;
1902}
1903
1904Uint32 UICodeEditor::onMouseDoubleClick( const Vector2i& position, const Uint32& flags ) {
1905 mLastActivity.restart();

Callers

nothing calls this directly

Calls 15

getSanitizedModStateMethod · 0.80
isKeyModPressedMethod · 0.80
openURIMethod · 0.80
toUtf8Method · 0.80
getSelectedTextMethod · 0.80
textInputMethod · 0.80
restartMethod · 0.45
containsMethod · 0.45
asFloatMethod · 0.45
emptyMethod · 0.45
getTextMethod · 0.45
getClipboardMethod · 0.45

Tested by

no test coverage detected