void raiseMovementEvent( wxWindow &Control, std::shared_ptr<StateAccessToken> &Access, std::function<seec::cm::MovementResult (seec::cm::ProcessState &State)> Mover) { auto const Handler = Control.GetEventHandler(); if (!Handler) { wxLogDebug("raiseMovementEvent: wxWindow does not have an event handler."); return; } if (!Access) { wxLogDebug("raiseMovementEvent: no access provided."); return; } auto LockAccess = Access->getAccess(); if (!LockAccess) { // Token is out of date. wxLogDebug("raiseMovementEvent: access token is outdated."); return; } ProcessMoveEvent Ev { SEEC_EV_PROCESS_MOVE, Control.GetId(), std::move(Mover) }; Ev.SetEventObject(&Control); LockAccess.release(); Handler->AddPendingEvent(Ev); }
void WindowTestCase::Properties() { m_window->SetLabel("label"); CPPUNIT_ASSERT_EQUAL("label", m_window->GetLabel()); m_window->SetName("name"); CPPUNIT_ASSERT_EQUAL("name", m_window->GetName()); //As we used wxID_ANY we should have a negative id CPPUNIT_ASSERT(m_window->GetId() < 0); m_window->SetId(wxID_HIGHEST + 10); CPPUNIT_ASSERT_EQUAL(wxID_HIGHEST + 10, m_window->GetId()); }