| 191 | |
| 192 | template<typename Event = wxCommandEvent, typename EventType > |
| 193 | static Type NullaryCommandType( EventType type, const wxString &code ){ |
| 194 | const auto deserialize = |
| 195 | []( wxEventType evtType, const wxArrayStringEx &components) { |
| 196 | std::unique_ptr< wxCommandEvent > result; |
| 197 | if ( components.size() == 1 ) { |
| 198 | if ( auto pWindow = WindowPaths::FindByPath( components[0] ) ) { |
| 199 | result = std::make_unique< wxCommandEvent >( |
| 200 | evtType, pWindow->GetId() ); |
| 201 | result->SetEventObject( pWindow ); |
| 202 | } |
| 203 | } |
| 204 | return result; |
| 205 | }; |
| 206 | |
| 207 | return Type{ type, code, WindowEventSerialization, deserialize }; |
| 208 | } |
| 209 | |
| 210 | template<typename Event = wxCommandEvent, typename EventType > |
| 211 | static Type BooleanCommandType( EventType type, const wxString &code ){ |
no test coverage detected