当前位置: 首页>>代码示例>>C++>>正文


C++ wxKeyEvent::Skip方法代码示例

本文整理汇总了C++中wxKeyEvent::Skip方法的典型用法代码示例。如果您正苦于以下问题:C++ wxKeyEvent::Skip方法的具体用法?C++ wxKeyEvent::Skip怎么用?C++ wxKeyEvent::Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxKeyEvent的用法示例。


在下文中一共展示了wxKeyEvent::Skip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnChar

void ContrastDialog::OnChar(wxKeyEvent &event)
{
   event.Skip(false);
   return;
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:5,代码来源:Contrast.cpp

示例2: OnChar

void MyListCtrl::OnChar(wxKeyEvent& event)
{
    wxLogMessage(wxT("Got char event."));

    event.Skip();
}
开发者ID:Bigpet,项目名称:wxWidgets,代码行数:6,代码来源:listtest.cpp

示例3: OnKeyDown

void TimeTextCtrl::OnKeyDown(wxKeyEvent &event)
{
   event.Skip(false);
   int keyCode = event.GetKeyCode();
   int digit = mFocusedDigit;

   if (mFocusedDigit < 0)
      mFocusedDigit = 0;
   if (mFocusedDigit >= (int)mDigits.GetCount())
      mFocusedDigit = mDigits.GetCount()-1;

   // Convert numeric keypad entries.
   if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9)) keyCode -= WXK_NUMPAD0 - '0';

   if (keyCode >= '0' && keyCode <= '9') {
      mValueString[mDigits[mFocusedDigit].pos] = wxChar(keyCode);
      ControlsToValue();
      ValueToControls();
      mFocusedDigit = (mFocusedDigit+1)%(mDigits.GetCount());
      Updated();
   }

   else if (keyCode == WXK_BACK) {
      // Moves left, replaces that char with '0', stays there...
      mFocusedDigit--;
      mFocusedDigit += mDigits.GetCount();
      mFocusedDigit %= mDigits.GetCount();
      mValueString[mDigits[mFocusedDigit].pos] = '0';
      ControlsToValue();
      ValueToControls();
      Updated();
   }

   else if (keyCode == WXK_LEFT) {
      mFocusedDigit--;
      mFocusedDigit += mDigits.GetCount();
      mFocusedDigit %= mDigits.GetCount();
      Refresh();
   }

   else if (keyCode == WXK_RIGHT) {
      mFocusedDigit++;
      mFocusedDigit %= mDigits.GetCount();
      Refresh();
   }
   
   else if (keyCode == WXK_HOME) {
      mFocusedDigit = 0;
      Refresh();
   }
   
   else if (keyCode == WXK_END) {
      mFocusedDigit = mDigits.GetCount() - 1;
      Refresh();
   }

   else if (keyCode == WXK_UP) {
      Increase(1);
      Updated();
   }

   else if (keyCode == WXK_DOWN) {
      Decrease(1);
      Updated();
   }

   else if (keyCode == WXK_TAB) {   
      wxWindow *parent = GetParent();
      wxNavigationKeyEvent nevent;
      nevent.SetWindowChange(event.ControlDown());
      nevent.SetDirection(!event.ShiftDown());
      nevent.SetEventObject(parent);
      nevent.SetCurrentFocus(parent);
      GetParent()->ProcessEvent(nevent);
   } 

   else if (keyCode == WXK_RETURN || keyCode == WXK_NUMPAD_ENTER) {
      wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
      wxWindow *def = tlw->GetDefaultItem();
      if (def && def->IsEnabled()) {
         wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
                               def->GetId());
         GetParent()->ProcessEvent(cevent);
      }
   }

   else {
      event.Skip();
      return;
   }

   if (digit != mFocusedDigit) {
      SetFieldFocus(mFocusedDigit);
   }

   event.Skip(false);
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:97,代码来源:TimeTextCtrl.cpp

示例4: OnChar

void CorrelationDialog::OnChar(wxKeyEvent& event){
	if (event.GetKeyCode() == WXK_ESCAPE){
		this->EndModal(wxCANCEL);
	}
	event.Skip();
};
开发者ID:DavidQuigley,项目名称:QuantitativeGenetics,代码行数:6,代码来源:DlgCorrelation.cpp

示例5: OnKeyDown

void wxCheckListBox::OnKeyDown(wxKeyEvent& event)
{
    // what do we do?
    enum
    {
        NONE,
        TOGGLE,
        SET,
        CLEAR
    } oper;

    switch ( event.GetKeyCode() )
    {
        case WXK_SPACE:
            oper = TOGGLE;
            break;

        case WXK_NUMPAD_ADD:
        case '+':
            oper = SET;
            break;

        case WXK_NUMPAD_SUBTRACT:
        case '-':
            oper = CLEAR;
            break;

        default:
            oper = NONE;
    }

    if ( oper != NONE )
    {
        wxArrayInt selections;
        int count = 0;
        if ( HasMultipleSelection() )
        {
            count = GetSelections(selections);
        }
        else
        {
            int sel = GetSelection();
            if (sel != -1)
            {
                count = 1;
                selections.Add(sel);
            }
        }

        for ( int i = 0; i < count; i++ )
        {
            int nItem = selections[i];

            switch ( oper )
            {
                case TOGGLE:
                    Toggle(nItem);
                    break;

                case SET:
                case CLEAR:
                    Check(nItem, oper == SET);
                    break;

                default:
                    wxFAIL_MSG( wxT("what should this key do?") );
            }

            // we should send an event as this has been done by the user and
            // not by the program
            SendEvent(nItem);
        }
    }
    else // nothing to do
    {
        event.Skip();
    }
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:78,代码来源:checklst.cpp

示例6: OnListCtrlErrorsKeyUp

void MemCheckOutputView::OnListCtrlErrorsKeyUp(wxKeyEvent& event)
{
    event.Skip();
    UpdateStatusSupp();
}
开发者ID:eranif,项目名称:codelite,代码行数:5,代码来源:memcheckoutputview.cpp

示例7: onTextureListKeyDown

// -----------------------------------------------------------------------------
// Called when a key is pressed in the texture list
// -----------------------------------------------------------------------------
void TextureXPanel::onTextureListKeyDown(wxKeyEvent& e)
{
	// Check if keypress matches any keybinds
	wxArrayString binds = KeyBind::getBinds(KeyBind::asKeyPress(e.GetKeyCode(), e.GetModifiers()));

	// Go through matching binds
	for (unsigned a = 0; a < binds.size(); a++)
	{
		string name = binds[a];

		// Copy
		if (name == "copy")
		{
			copy();
			return;
		}

		// Cut
		else if (name == "cut")
		{
			copy();
			removeTexture();
			return;
		}

		// Paste
		else if (name == "paste")
		{
			paste();
			return;
		}

		// Move texture up
		else if (name == "txed_tex_up")
		{
			moveUp();
			return;
		}

		// Move texture down
		else if (name == "txed_tex_down")
		{
			moveDown();
			return;
		}

		// New texture
		else if (name == "txed_tex_new")
		{
			newTexture();
			return;
		}

		// New texture from patch
		else if (name == "txed_tex_new_patch")
		{
			newTextureFromPatch();
			return;
		}

		// New texture from file
		else if (name == "txed_tex_new_file")
		{
			newTextureFromFile();
			return;
		}

		// Delete texture
		else if (name == "txed_tex_delete")
		{
			removeTexture();
			return;
		}
	}

	// Not handled here, send off to be handled by a parent window
	e.Skip();
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:81,代码来源:TextureXPanel.cpp

示例8: OnKeyDown

void wxSymbolListCtrl::OnKeyDown(wxKeyEvent& event)
{
    // No keyboard interface for now
    event.Skip();
#if 0
    // flags for DoHandleItemClick()
    int flags = ItemClick_Kbd;

    int currentLineNow = SymbolValueToLineNumber(m_current);

    int currentLine;
    switch ( event.GetKeyCode() )
    {
        case WXK_HOME:
            currentLine = 0;
            break;

        case WXK_END:
            currentLine = GetLineCount() - 1;
            break;

        case WXK_DOWN:
            if ( currentLineNow == (int)GetLineCount() - 1 )
                return;

            currentLine = currentLineNow + 1;
            break;

        case WXK_UP:
            if ( m_current == wxNOT_FOUND )
                currentLine = GetLineCount() - 1;
            else if ( currentLineNow != 0 )
                currentLine = currentLineNow - 1;
            else // currentLineNow == 0
                return;
            break;

        case WXK_PAGEDOWN:
            PageDown();
            currentLine = GetFirstVisibleLine();
            break;

        case WXK_PAGEUP:
            if ( currentLineNow == (int)GetFirstVisibleLine() )
            {
                PageUp();
            }

            currentLine = GetFirstVisibleLine();
            break;

        case WXK_SPACE:
            // hack: pressing space should work like a mouse click rather than
            // like a keyboard arrow press, so trick DoHandleItemClick() in
            // thinking we were clicked
            flags &= ~ItemClick_Kbd;
            currentLine = currentLineNow;
            break;

#ifdef __WXMSW__
        case WXK_TAB:
            // Since we are using wxWANTS_CHARS we need to send navigation
            // events for the tabs on MSW
            {
                wxNavigationKeyEvent ne;
                ne.SetDirection(!event.ShiftDown());
                ne.SetCurrentFocus(this);
                ne.SetEventObject(this);
                GetParent()->GetEventHandler()->ProcessEvent(ne);
            }
            // fall through to default
#endif
        default:
            event.Skip();
            currentLine = 0; // just to silent the stupid compiler warnings
            wxUnusedVar(currentNow);
            return;
    }

#if 0
    if ( event.ShiftDown() )
       flags |= ItemClick_Shift;
    if ( event.ControlDown() )
        flags |= ItemClick_Ctrl;

    DoHandleItemClick(current, flags);
#endif
#endif
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:89,代码来源:richtextsymboldlg.cpp

示例9: OnKeyPressed

void wxPropertyList::OnKeyPressed( wxKeyEvent &event )
{
    event.Skip();
}
开发者ID:AlexeyS,项目名称:cmake,代码行数:4,代码来源:PropertyList.cpp

示例10: ProcessEvent

void AutocompletePopup::ProcessEvent(wxKeyEvent& event)
{
  event.Skip();
}
开发者ID:andrejv,项目名称:wxmaxima,代码行数:4,代码来源:AutocompletePopup.cpp

示例11: OnKeyDown

void ClientBoard::OnKeyDown( wxKeyEvent& event )
{
    AILOCKT(CltTetrisEngine::getMe().m_SyncMsgList);

    stTetrisOperator cmd;

    int keycode = event.GetKeyCode();

    if (m_LogicBoard.isPaused)
        return;

    switch (keycode) {
    case WXK_LEFT:
    {
        cmd.btOperator = emTR_OPERATOR_LEFT;
    }
    break;
    case WXK_RIGHT:
    {
        cmd.btOperator = emTR_OPERATOR_RIGHT;
    }
    break;
    case WXK_DOWN:
    {
        cmd.btOperator = emTR_OPERATOR_DOWN;

    }
    break;
    case WXK_UP:
    {
        cmd.btOperator = emTR_OPERATOR_ROTATELEFT;
    }
    break;
    case WXK_SPACE:
    {
        cmd.btOperator = emTR_OPERATOR_START;
    }
    break;
    case 'd':
    {
        cmd.btOperator = emTR_OPERATOR_PAUSE;
    }
    break;
    case 'D':
    {
        cmd.btOperator = emTR_OPERATOR_PAUSE;
    }
    break;
    case 'O':
    case 'o':
    {
    } break;
    case 'p':
    case 'P':
    {
        cmd.btOperator = emTR_OPERATOR_PAUSE;
    }
    break;
    default:
        cmd.btOperator = emTR_OPERATOR_NULL;
        event.Skip();
    }

    if (cmd.btOperator !=emTR_OPERATOR_NULL)
    {
        if (CltTetrisEngine::getMe().m_boAlone) {
            stBaseMessage* bmsg = __copy_msg((stBaseCmd*)&cmd,sizeof(stTetrisOperator));
            if (bmsg)
                CltTetrisEngine::getMe().m_SyncMsgList.push_back(bmsg);
        } else {
            if (CltTetrisEngine::getMe().m_ClientSession)
                CltTetrisEngine::getMe().m_ClientSession->write((stBaseCmd*)&cmd,sizeof(stTetrisOperator));
        }
    }
}
开发者ID:bulue,项目名称:----,代码行数:75,代码来源:Clinetboard.cpp

示例12: OnKeyUp

void wxInputConsumer::OnKeyUp(wxKeyEvent& event)
{
    if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, false) )
        event.Skip();
}
开发者ID:chromylei,项目名称:third_party,代码行数:5,代码来源:inpcons.cpp

示例13: OnKeyDown

void ctlSQLBox::OnKeyDown(wxKeyEvent& event)
{
#ifdef __WXGTK__
    event.m_metaDown=false;
#endif

    // Get the line ending type
    wxString lineEnd;
    switch (GetEOLMode())
    {
        case wxSTC_EOL_LF:
            lineEnd = wxT("\n");
            break;
        case wxSTC_EOL_CRLF:
            lineEnd = wxT("\r\n");
            break;
        case wxSTC_EOL_CR:
            lineEnd = wxT("\r");
            break;
    }

    // Block comment/uncomment
    if (event.GetKeyCode() == 'K')
    {
        // Comment (Ctrl+k)
        if (event.GetModifiers() == wxMOD_CONTROL)
        {
            if (BlockComment(false))
                return;
        }
        // Uncomment (Ctrl+Shift+K)
        else if (event.GetModifiers() == (wxMOD_CONTROL | wxMOD_SHIFT))
        {
            if (BlockComment(true))
                return;
        }
    }

    // Autoindent
    if (m_autoIndent && event.GetKeyCode() == WXK_RETURN)
    {
        wxString indent, line;
        line = GetLine(GetCurrentLine());

        // Get the offset for the current line - basically, whether
        // or not it ends with a \r\n, \n or \r, and if so, the length
        int offset =  0;
        if (line.EndsWith(wxT("\r\n")))
            offset = 2;
        else if (line.EndsWith(wxT("\n")))
            offset = 1;
        else if (line.EndsWith(wxT("\r")))
            offset = 1;

        // Get the indent. This is every leading space or tab on the
        // line, up until the current cursor position.
        int x = 0;
        int max = line.Length() - (GetLineEndPosition(GetCurrentLine()) - GetCurrentPos()) - offset;
        while ((line[x] == '\t' || line[x] == ' ') && x < max)
            indent += line[x++];

        // Select any indent in front of the cursor to be removed. If
        // the cursor is positioned after any non-indent characters, 
        // we don't remove anything. If there is already some selected,
        // don't select anything new at all.
        if (indent.Length() != 0 && 
            (unsigned int)GetCurrentPos() <= ((GetLineEndPosition(GetCurrentLine()) - line.Length()) + indent.Length() + offset) && 
            GetSelectedText() == wxEmptyString)
            SetSelection(GetLineEndPosition(GetCurrentLine()) - line.Length() + offset, GetLineEndPosition(GetCurrentLine()) - line.Length() + indent.Length() + offset);

        // Lose any selected text.
        ReplaceSelection(wxEmptyString);

        // Insert a replacement \n (or whatever), and the indent at the insertion point.
        InsertText(GetCurrentPos(), lineEnd + indent);

        // Now, reset the position, and clear the selection
        SetCurrentPos(GetCurrentPos() + indent.Length() + lineEnd.Length());
        SetSelection(GetCurrentPos(), GetCurrentPos());
    }
    else if (m_dlgFindReplace && event.GetKeyCode() == WXK_F3)
    {
        m_dlgFindReplace->FindNext();
    }
    else
        event.Skip();
}
开发者ID:mhagander,项目名称:pgadmin3,代码行数:87,代码来源:ctlSQLBox.cpp

示例14: OnChar


//.........这里部分代码省略.........
        {
            if(current_pos < static_cast<int>(Historical.GetCount())-1)
            {
                ++current_pos;
                SetValue(Historical[current_pos]);
            }
            else
            {
                current_pos = Historical.GetCount();
                SetValue( m_original );
                SetInsertionPointEnd();
            }
        }
        else
		if(keyCode == WXK_TAB )
        {
			if ( ( modifier & wxMOD_CONTROL ) != 0 ){
				ui().mw().GetChatTab().AdvanceSelection( ( modifier & wxMOD_SHIFT ) == 0 );
			}
			else {
				wxString text = this->GetValue();
				long pos_Cursor = this->GetInsertionPoint();
				wxString selection_Begin_InsertPos = this->GetRange( 0, pos_Cursor );
				wxString selection_InsertPos_End = this->GetRange( pos_Cursor, this->GetLastPosition() );

				// Search for the shortest Match, starting from the Insertionpoint to the left, until we find a "\ "
				// Special Characters according to regular Expression Syntax needs to be escaped: [,]
				wxRegEx regex_currentWord;
				#ifdef wxHAS_REGEX_ADVANCED
				regex_currentWord.Compile( wxT("(_|\\[|\\]|\\w)+$"), wxRE_ADVANCED );
				#else
				regex_currentWord.Compile( wxT("(_|\\[|\\]|\\w)+$"), wxRE_EXTENDED );
				#endif

				if ( regex_currentWord.Matches( selection_Begin_InsertPos ) ) {
					wxString currentWord = regex_currentWord.GetMatch( selection_Begin_InsertPos );
					// std::cout << "#########: Current Word: (" << currentWord.char_str() << ")" << std::endl;

					wxString selection_Begin_BeforeCurrentWord = this->GetRange( 0, pos_Cursor - currentWord.length() );
					// std::cout << "#########: selection_Begin_BeforeCurrentWord: (" << selection_Begin_BeforeCurrentWord.char_str() << ")" << std::endl;

					HashMap_String_String hm = textcompletiondatabase.GetMapping( currentWord );

					// std::cout << "#########: Mapping-Size: (" << hm.size() << ")" << std::endl;

					wxString completed_Text;
					int new_Cursor_Pos = 0;
					if( hm.size() == 1 ) {
						completed_Text.append( selection_Begin_BeforeCurrentWord );
						completed_Text.append( hm.begin()->second );
						completed_Text.append( selection_InsertPos_End );
						new_Cursor_Pos = selection_Begin_BeforeCurrentWord.length() + hm.begin()->second.length();
					} else {
						//match nearest only makes sense when there's actually more than one match
						if ( hm.size() > 1 && sett().GetCompletionMethod() == Settings::MatchNearest ) {
							wxArrayString matches;
							GetArrayStringFromHashMap( hm , matches );
							wxString newWord = GetBestMatch( matches, currentWord );

							bool realCompletion = newWord.Len() >= currentWord.Len(); // otherwise we have actually less word than before :P
							if ( realCompletion )
								currentWord =  newWord;

							completed_Text.append( selection_Begin_BeforeCurrentWord );
							completed_Text.append( currentWord );
							completed_Text.append( selection_InsertPos_End );
							new_Cursor_Pos = selection_Begin_BeforeCurrentWord.length() + currentWord.length();

							// We ring the System Bell, to signalise the User, that no Completion was applied.
							if (!realCompletion)
								wxBell();
						}
						else {
							completed_Text.append( selection_Begin_BeforeCurrentWord );
							completed_Text.append( currentWord );
							completed_Text.append( selection_InsertPos_End );
							new_Cursor_Pos = selection_Begin_BeforeCurrentWord.length() + currentWord.length();
							// We ring the System Bell, to signalise the User, that no Completion was applied.
							wxBell();
						}
					}
					// Replace the old Text with our completed Text
					// or
					// if nothing was found remove the typed TAB, so that the User stays comfortable not to remove the TAB by himself.
					this->ChangeValue( completed_Text );
					this->SetInsertionPoint( new_Cursor_Pos );
				} else {
					wxString old_Text;
					old_Text.append( selection_Begin_InsertPos );
					old_Text.append( selection_InsertPos_End );
					this->ChangeValue( old_Text );
					this->SetInsertionPoint( selection_Begin_InsertPos.length() );
					wxBell();
				}
			}
        }
        else
            event.Skip();

}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:101,代码来源:wxtextctrlhist.cpp

示例15: OnKeyDown

void wxFlatButton::OnKeyDown(wxKeyEvent& event) { event.Skip(); }
开发者ID:lpc1996,项目名称:codelite,代码行数:1,代码来源:wxFlatButton.cpp


注:本文中的wxKeyEvent::Skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。