bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) { switch ( msg ) { case WM_CHAR: // for compatibility with wxTextCtrl, generate a special message // when Enter is pressed switch ( wParam ) { case VK_RETURN: { if (SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0)) return false; wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId); const int sel = GetSelection(); event.SetInt(sel); event.SetString(GetValue()); InitCommandEventWithItems(event, sel); if ( ProcessCommand(event) ) { // don't let the event through to the native control // because it doesn't need it and may generate an annoying // beep if it gets it return true; } } break; case VK_TAB: // If we have wxTE_PROCESS_ENTER style, we get all char // events, including those for TAB which are usually used // for keyboard navigation, but we should not process them // unless we also have wxTE_PROCESS_TAB style. if ( !HasFlag(wxTE_PROCESS_TAB) ) { int flags = 0; if ( !wxIsShiftDown() ) flags |= wxNavigationKeyEvent::IsForward; if ( wxIsCtrlDown() ) flags |= wxNavigationKeyEvent::WinChange; if ( Navigate(flags) ) return true; } break; } } if ( ShouldForwardFromEditToCombo(msg) ) { // For all the messages forward from the edit control the // result is not used. WXLRESULT result; return MSWHandleMessage(&result, msg, wParam, lParam); } return false; }
void CParticleControlWnd::OnPlayBtnClicked(wxCommandEvent& /*event*/) { BEATS_ASSERT(m_pAttachedEmitter != nullptr); bool bIsEmitterNodeDriven = m_pAttachedEmitter->GetParentNode() != nullptr; if (!bIsEmitterNodeDriven) { if (wxIsCtrlDown()) { m_pAttachedEmitter->ResetRandomSeed(); } m_pAttachedEmitter->IsPlaying() ? m_pAttachedEmitter->Pause() : m_pAttachedEmitter->Play(); if (m_pAttachedEmitter->GetParentEmitter() != nullptr) { CParticleManager::GetInstance()->AddPlayingEmitter(m_pAttachedEmitter); } } }
bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg) { // prevent command accelerators from stealing editing // hotkeys when we have the focus if (wxIsCtrlDown()) { WPARAM vkey = pMsg->wParam; switch (vkey) { case 'C': case 'V': case 'X': case VK_INSERT: case VK_DELETE: case VK_HOME: case VK_END: return false; } } return wxChoice::MSWShouldPreProcessMessage(pMsg); }