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


C++ CEdit::Cut方法代码示例

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


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

示例1: OnEditCut

void CBasicView::OnEditCut()
{
    CEdit* pEdit = (CEdit*)GetFocus();
    if (IsEdit(pEdit)) {
        pEdit->Cut();
    }
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:7,代码来源:BasicView.cpp

示例2: GetEditCtrl

// @pymethod |PyCEdit|Cut|Cuts the current selection to the clipboard.
static PyObject *PyCEdit_cut(PyObject *self, PyObject *args)
{
	CHECK_NO_ARGS(args);
	CEdit *pEdit = GetEditCtrl(self);
	if (!pEdit)
		return NULL;
	GUI_BGN_SAVE;
	pEdit->Cut(); // @pyseemfc CEdit|Cut
	GUI_END_SAVE;
	RETURN_NONE;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:12,代码来源:win32ctledit.cpp

示例3: PreTranslateMessage

BOOL CXTComboBoxEx::PreTranslateMessage(MSG* pMsg)
{
	CEdit* pEditCtrl = GetEditCtrl();
	if (pEditCtrl && ::IsWindow(pEditCtrl->m_hWnd))
	{
		if (pMsg->message == WM_KEYDOWN)
		{
			if (::GetKeyState(VK_CONTROL) < 0)
			{
				switch (pMsg->wParam)
				{
				case 'a':
				case 'A':
					pEditCtrl->SetSel(0, -1);
					return TRUE;
				case 'c':
				case 'C':
					pEditCtrl->Copy();
					return TRUE;
				case 'x':
				case 'X':
					pEditCtrl->Cut();
					return TRUE;
				case 'v':
				case 'V':
					pEditCtrl->Paste();
					return TRUE;
				}
			}
			else
			{
				if (::GetKeyState(VK_CLEAR))
				{
					pEditCtrl->Clear();
					return TRUE;
				}
			}
		}
	}

	return CComboBox::PreTranslateMessage(pMsg);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:42,代码来源:XTComboBoxEx.cpp

示例4: PreTranslateMessage


//.........这里部分代码省略.........
                }
                m_lstTabWords.RemoveAll ();
                // now find all words same as this one 
                CSmcDoc* pDoc = (CSmcDoc*)((CMainFrame*)AfxGetMainWnd())->GetActiveDocument ();
                if ( !pDoc ) 
                    return TRUE;

                m_lstTabWords.AddHead(strWord );
                POSITION pos = pDoc->m_lstTabWords.GetHeadPosition ();
                while ( pos ) {
                    CString str = pDoc->m_lstTabWords.GetNext(pos);
                    if ( !strnicmp(str, strWord, strWord.GetLength()) ) {
                        m_lstTabWords.AddTail (str);
                    }
                }

                if ( m_lstTabWords.GetCount () < 2 ) {
                    m_lstTabWords.RemoveAll ();
                    return TRUE;
                }
                m_bExtending = TRUE;
                m_posCurPos = m_lstTabWords.GetHeadPosition();
                m_lstTabWords.GetNext (m_posCurPos);
                strWord = m_lstTabWords.GetNext (m_posCurPos);
                strText = m_strStartLine + strWord + m_strEndLine;
                m_bExtendingChange = TRUE;
                pEdit ->SetWindowText (strText);
                int selpos = m_strStartLine.GetLength () + strWord.GetLength ();
                pEdit->SetSel (selpos, selpos);
                m_bExtendingChange = FALSE;
                return TRUE;

            }
            break;
        case VK_UP:
            if ( GetKeyState(VK_CONTROL) >= 0 ) {
                PrevLine();
                return TRUE;
            } else 
                return FALSE;
        case VK_DOWN:
            if ( GetKeyState(VK_CONTROL) >= 0 ) {
                NextLine();
                return TRUE;
            } else 
                return FALSE;
        case 'C':
            if ( GetKeyState(VK_CONTROL)&0x1000){
                pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Copy();
                return TRUE;
            }
            break;
		case VK_DELETE:
            if ( GetKeyState(VK_SHIFT)&0x1000){
                pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Cut();
                return TRUE;
            }
            break;
        case 'X':
            if ( GetKeyState(VK_CONTROL)&0x1000){
                pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Cut();
                return TRUE;
            }
            break;
		case VK_INSERT:
            if ( GetKeyState(VK_CONTROL)&0x1000){
                pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Copy();
                return TRUE;
            }
            if ( GetKeyState(VK_SHIFT)&0x1000){
                /*pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Paste();*/
                DoPaste();
                return TRUE;
            }
            break;
        case 'V':
            if ( GetKeyState(VK_CONTROL)&0x1000){
                /*pEdit = (CEdit*)GetDlgItem(IDC_EDIT);
                pEdit->Paste();*/
                DoPaste();
                return TRUE;
            }
            break;
        default:
            break;
        };
    }
	if ( pMsg->message == WM_SYSKEYDOWN ) {
        if ( ((CMainFrame*)AfxGetMainWnd())->GetActiveView()->PreTranslateMessage(pMsg) )
            return TRUE;

    }
    
	return CDialogBar::PreTranslateMessage(pMsg);
}
开发者ID:Liscar,项目名称:jmc,代码行数:101,代码来源:EditBar.cpp

示例5: EventProcess

bool CStudio::EventProcess(const Event &event)
{
    CWindow*    pw;
    CEdit*      edit;
    CSlider*    slider;

    if ( m_dialog != SD_NULL )  // dialogue exists?
    {
        return EventDialog(event);
    }

    if ( event.type == EVENT_FRAME )
    {
        EventFrame(event);
    }

    pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
    if ( pw == nullptr )  return false;

    edit = static_cast<CEdit*>(pw->SearchControl(EVENT_STUDIO_EDIT));
    if ( edit == nullptr )  return false;

    if ( event.type == pw->GetEventTypeClose() )
    {
        Event newEvent = event;
        newEvent.type = EVENT_STUDIO_OK;
        m_event->AddEvent(newEvent);
    }

    if ( event.type == EVENT_STUDIO_EDIT )  // text modifief?
    {
        ColorizeScript(edit);
    }

    if ( event.type == EVENT_STUDIO_LIST )  // list clicked?
    {
        m_main->StartDisplayInfo(const_cast<char *>(m_helpFilename.c_str()), -1); // TODO change to std::string when RobotMain changes
    }

    if ( event.type == EVENT_STUDIO_NEW )  // new?
    {
        m_script->New(edit, "");
    }

    if ( event.type == EVENT_STUDIO_OPEN )  // open?
    {
        StartDialog(SD_OPEN);
    }
    if ( event.type == EVENT_STUDIO_SAVE )  // save?
    {
        StartDialog(SD_SAVE);
    }

    if ( event.type == EVENT_STUDIO_UNDO )  // undo?
    {
        edit->Undo();
    }
    if ( event.type == EVENT_STUDIO_CUT )  // cut?
    {
        edit->Cut();
    }
    if ( event.type == EVENT_STUDIO_COPY )  // copy?
    {
        edit->Copy();
    }
    if ( event.type == EVENT_STUDIO_PASTE )  // paste?
    {
        edit->Paste();
    }

    if ( event.type == EVENT_STUDIO_SIZE )  // size?
    {
        slider = static_cast< CSlider* >(pw->SearchControl(EVENT_STUDIO_SIZE));
        if ( slider == nullptr )  return false;
        m_main->SetFontSize(9.0f+slider->GetVisibleValue()*12.0f);
        ViewEditScript();
    }

    if ( event.type == EVENT_STUDIO_TOOL &&  // instructions?
            m_dialog == SD_NULL )
    {
        m_main->StartDisplayInfo(SATCOM_HUSTON, false);
    }
    if ( event.type == EVENT_STUDIO_HELP &&  // help?
            m_dialog == SD_NULL )
    {
        m_main->StartDisplayInfo(SATCOM_PROG, false);
    }

    if ( event.type == EVENT_STUDIO_COMPILE )  // compile?
    {
        if ( m_script->GetScript(edit) )  // compile
        {
            std::string res;
            GetResource(RES_TEXT, RT_STUDIO_COMPOK, res);
            SetInfoText(res, false);
        }
        else
        {
            std::string error;
//.........这里部分代码省略.........
开发者ID:OdyX,项目名称:colobot,代码行数:101,代码来源:studio.cpp

示例6: OnEditCut

void CBibitemView::OnEditCut() 
{
	CEdit* edit = GetFocusEdit();
	if (edit)
		edit->Cut();
}
开发者ID:stievie,项目名称:bibedt,代码行数:6,代码来源:BibitemView.cpp

示例7: PreTranslateMessage

BOOL LListCtrl::PreTranslateMessage(MSG* pMsg)
{
    // If edit control is visible in tree view control, sending a
    // WM_KEYDOWN message to the edit control will dismiss the edit
    // control.  When ENTER key was sent to the edit control, the parent
    // window of the tree view control is responsible for updating the
    // item's label in TVN_ENDLABELEDIT notification code.
    if ( pMsg->message == WM_KEYDOWN )
    {
        CHAR ckey=toupper( pMsg->wParam &0xFF );

        if ( VK_RETURN == pMsg->wParam )
            m_bEditNext = TRUE;
        if ( VK_ESCAPE == pMsg->wParam )
            m_bEditNext = FALSE;


        if( GetKeyState( VK_CONTROL )<-1 && (ckey== 'A') )
        {
            SelectAll();
            return TRUE;
        }
        if( GetKeyState( VK_CONTROL )<-1 && (ckey== 'N') )
        {
            SelectNone();
            return TRUE;
        }


        CEdit* edit = GetEditControl();
        if (edit)
        {
            //			LTRACE("Control key status = %d %d\n",LOBYTE(GetKeyState( VK_CONTROL )),HIWORD(GetKeyState( VK_CONTROL )));

            if( GetKeyState( VK_CONTROL )<-1 && (ckey== _T( 'C' ) ) )
            {
                edit->Copy();
                return TRUE;
            }
            if( GetKeyState( VK_CONTROL )<-1 && (ckey== _T( 'V' ) ) )
            {
                edit->Paste();
                return TRUE;
            }
            if( GetKeyState( VK_CONTROL )<-1 && (ckey== _T( 'X' ) ) )
            {
                edit->Cut();
                return TRUE;
            }
            if( GetKeyState( VK_CONTROL )<-1 && (ckey== _T( 'Z' ) ) )
            {
                edit->Undo();
                return TRUE;
            }
            if( pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_CONTROL || pMsg->wParam == VK_INSERT || pMsg->wParam == VK_SHIFT )
            {
                edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam);
                return TRUE;
            }
        }
    }
    return CListCtrl::PreTranslateMessage(pMsg);
}
开发者ID:joshlong,项目名称:libcd,代码行数:63,代码来源:LineList.cpp


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