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

Method onMessage

src/tools/ecode/uistatusbar.cpp:121–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121Uint32 UIStatusBar::onMessage( const NodeMessage* msg ) {
122 if ( !isVisible() || nullptr == mContext || msg->getMsg() != NodeMessage::MouseClick ||
123 0 == ( msg->getFlags() & EE_BUTTON_LMASK ) || !msg->getSender()->isWidget() )
124 return 0;
125
126 UIWidget* widget = msg->getSender()->asType<UIWidget>();
127
128 if ( !widget->hasClass( "status_but" ) )
129 return 0;
130
131 int ret = 0;
132
133 if ( widget->getId() == "status_locate_bar" ) {
134 mContext->getUniversalLocator()->toggleLocateBar();
135 ret = 1;
136 } else if ( widget->getId() == "status_global_search_bar" ) {
137 mContext->getGlobalSearchController()->toggleGlobalSearchBar();
138 ret = 1;
139 } else if ( widget->getId() == "status_terminal_panel" ) {
140 mContext->getStatusTerminalController()->toggle();
141 ret = 1;
142 } else if ( widget->getId() == "status_build_output" ) {
143 mContext->getStatusBuildOutputController()->toggle();
144 ret = 1;
145 } else if ( widget->getId() == "status_app_output" ) {
146 mContext->getStatusAppOutputController()->toggle();
147 ret = 1;
148 } else {
149 auto elemIt = mElements.find( widget->getId() );
150 if ( elemIt != mElements.end() ) {
151 elemIt->second.second->toggle();
152 ret = 1;
153 }
154 }
155
156 if ( ret )
157 updateState();
158 return ret;
159}
160
161void UIStatusBar::setPluginContextProvider( PluginContextProvider* app ) {
162 mContext = app;

Callers

nothing calls this directly

Calls 15

updateStateFunction · 0.85
getFlagsMethod · 0.80
isWidgetMethod · 0.80
getSenderMethod · 0.80
toggleLocateBarMethod · 0.80
getUniversalLocatorMethod · 0.80
toggleGlobalSearchBarMethod · 0.80
getIdMethod · 0.65

Tested by

no test coverage detected