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

Method createCodeEditorInTabWidget

src/eepp/ui/tools/uicodeeditorsplitter.cpp:554–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554std::pair<UITab*, UICodeEditor*>
555UICodeEditorSplitter::createCodeEditorInTabWidget( UITabWidget* tabWidget ) {
556 eeASSERT( curWidgetExists() );
557 if ( nullptr == tabWidget )
558 return std::make_pair( (UITab*)nullptr, (UICodeEditor*)nullptr );
559 UICodeEditor* editor = createCodeEditor();
560 mAboutToAddEditor = editor;
561 editor->on( Event::OnDocumentChanged, [this]( const Event* event ) {
562 mClient->onDocumentStateChanged( event->getNode()->asType<UICodeEditor>(),
563 event->getNode()->asType<UICodeEditor>()->getDocument() );
564 } );
565 UITab* tab = tabWidget->add( editor->getDocument().getFilename(), editor );
566 editor->setData( (UintPtr)tab );
567 DocEvent docEvent( editor, &editor->getDocument(), Event::OnEditorTabReady );
568 editor->sendEvent( static_cast<const Event*>( &docEvent ) );
569 mAboutToAddEditor = nullptr;
570 mFirstCodeEditor = false;
571 mClient->onTabCreated( tab, editor );
572 return std::make_pair( tab, editor );
573}
574
575std::pair<UITab*, UIWidget*>
576UICodeEditorSplitter::createWidget( UIWidget* widget, const std::string& tabName, bool focus ) {

Callers 5

closeEditorsMethod · 0.80
onFileDroppedMethod · 0.80
closeEditorsMethod · 0.80
onCodeEditorCreatedMethod · 0.80
loadDocumentsMethod · 0.80

Calls 9

getNodeMethod · 0.80
getDocumentMethod · 0.80
getFilenameMethod · 0.80
onMethod · 0.45
addMethod · 0.45
setDataMethod · 0.45
sendEventMethod · 0.45
onTabCreatedMethod · 0.45

Tested by

no test coverage detected