| 153 | } |
| 154 | |
| 155 | void StatusAppOutputController::createContainer() { |
| 156 | if ( mContainer ) |
| 157 | return; |
| 158 | const auto XML = R"xml( |
| 159 | <hboxce id="app_output" class="vertical_bar" lw="mp" lh="mp" visible="false"> |
| 160 | <rellayce id="app_command_executer" lw="0" lw8="1" lh="mp"> |
| 161 | <CodeEditor id="app_output_output" lw="mp" lh="mp" /> |
| 162 | </rellayce> |
| 163 | <vbox lw="16dp" lh="mp"> |
| 164 | <PushButton class="expand_status_bar_panel" lw="mp" tooltip="@string(expand_panel, Expand Panel)" /> |
| 165 | <PushButton id="app_output_clear" lw="mp" icon="icon(eraser, 12dp)" tooltip="@string(clear, Clear)" /> |
| 166 | <PushButton id="app_output_run" lw="mp" icon="icon(play, 12dp)" tooltip="@string(run, Run)" /> |
| 167 | <PushButton id="app_output_stop" lw="mp" icon="icon(stop, 12dp)" enabled="false" /> |
| 168 | <PushButton id="app_output_find" lw="mp" icon="icon(search, 12dp)" tooltip="@string(find, Find)" /> |
| 169 | <PushButton id="app_output_configure" lw="mp" icon="icon(settings, 12dp)" tooltip="@string(configure_ellipsis, Configure...)" /> |
| 170 | </vbox> |
| 171 | </hboxce> |
| 172 | )xml"; |
| 173 | |
| 174 | if ( mMainSplitter->getLastWidget() != nullptr ) { |
| 175 | mMainSplitter->getLastWidget()->setVisible( false ); |
| 176 | mMainSplitter->getLastWidget()->setParent( mUISceneNode ); |
| 177 | } |
| 178 | |
| 179 | mContainer = mContext->getUISceneNode() |
| 180 | ->loadLayoutFromString( XML, mMainSplitter ) |
| 181 | ->asType<UIHLinearLayoutCommandExecuter>(); |
| 182 | |
| 183 | mContext->getStatusBar()->registerStatusBarPanel( mContainer, mContainer ); |
| 184 | |
| 185 | auto editor = mContainer->find<UICodeEditor>( "app_output_output" ); |
| 186 | mContainer->getKeyBindings().addKeybindsStringUnordered( mContext->getStatusBarKeybindings() ); |
| 187 | editor->getKeyBindings().addKeybindsStringUnordered( mContext->getStatusBarKeybindings() ); |
| 188 | |
| 189 | editor->setLocked( true ); |
| 190 | editor->setLineBreakingColumn( 0 ); |
| 191 | editor->setShowLineNumber( false ); |
| 192 | editor->getDocument().reset(); |
| 193 | editor->setScrollY( editor->getMaxScroll().y ); |
| 194 | editor->setColorScheme( mContext->getSplitter()->getCurrentColorScheme() ); |
| 195 | mAppOutput = editor; |
| 196 | mAppOutput->on( Event::OnScrollChange, [this]( auto ) { |
| 197 | mScrollLocked = mAppOutput->getMaxScroll().y == mAppOutput->getScroll().y; |
| 198 | } ); |
| 199 | mContainer->setVisible( false ); |
| 200 | mContainer->on( Event::OnFocus, [this]( auto ) { mAppOutput->setFocus(); } ); |
| 201 | mContainer->on( Event::KeyDown, [this]( const Event* event ) { |
| 202 | auto ke = event->asKeyEvent(); |
| 203 | if ( ke->getSanitizedMod() == 0 && ke->getKeyCode() == EE::Window::KEY_ESCAPE && |
| 204 | mSplitter->getCurEditor() ) { |
| 205 | mSplitter->getCurEditor()->setFocus(); |
| 206 | } |
| 207 | } ); |
| 208 | |
| 209 | mContainer->bind( "app_output_clear", mClearButton ); |
| 210 | mContainer->bind( "app_output_run", mRunButton ); |
| 211 | mContainer->bind( "app_output_stop", mStopButton ); |
| 212 | mContainer->bind( "app_output_find", mFindButton ); |
nothing calls this directly
no test coverage detected