这篇教程C++ GetEditCtrl函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetEditCtrl函数的典型用法代码示例。如果您正苦于以下问题:C++ GetEditCtrl函数的具体用法?C++ GetEditCtrl怎么用?C++ GetEditCtrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetEditCtrl函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Filesvoid CEditorView::OnPopupLoad() { // TODO: Add your command handler code here BOOL endmarker; CString FileName; CString WindowText; CString WindowLine; static char BASED_CODE szFilter[] = "Text Files (*.txt)|*.txt|Data Files (*.dat)|*.dat|All Files (*.*)|*.*||"; CFileDialog* pLoadFile = new CFileDialog(TRUE,NULL,NULL,0,&szFilter[0],NULL); if (IDOK==pLoadFile->DoModal()) { WindowText = ""; FileName = pLoadFile->GetPathName(); delete pLoadFile; CStdioFile* pFile = new CStdioFile(FileName,CFile::modeRead); do { endmarker = pFile->ReadString(WindowLine); WindowText = WindowText+WindowLine+"/r/n"; } while (endmarker); GetEditCtrl().SetSel(-1,0,FALSE); GetEditCtrl().ReplaceSel(WindowText); pFile->Close(); delete pFile; } }
开发者ID:skappert,项目名称:mcp,代码行数:28,
示例2: DefaultLRESULT COXNotesEditView::OnSetMargins(WPARAM wParam, LPARAM lParam){ if (m_bUpdatingMargins) return Default(); switch (wParam) { case EC_USEFONTINFO: { LRESULT lRslt=Default(); m_bUpdatingMargins=TRUE; m_nMargins=PtrToUint(SendMessage(EM_GETMARGINS,0,0)); switch (m_nSide) { case SIDE_LEFT: GetEditCtrl().SetMargins(LOWORD(m_nMargins)+m_nNotesWidth, HIWORD(m_nMargins)); break; case SIDE_RIGHT: GetEditCtrl().SetMargins(LOWORD(m_nMargins), HIWORD(m_nMargins)+m_nNotesWidth); break; } m_bUpdatingMargins=FALSE; return lRslt; } break; case EC_LEFTMARGIN: m_nMargins=MAKELONG(lParam,HIWORD(m_nMargins)); if (m_nSide==SIDE_LEFT) { m_bUpdatingMargins=TRUE; LPARAM lPrm=MAKELONG(LOWORD(m_nMargins)+m_nNotesWidth, HIWORD(m_nMargins)); LRESULT lRslt=SendMessage(EM_SETMARGINS,wParam,lPrm); m_bUpdatingMargins=FALSE; return lRslt; } else return Default(); break; case EC_RIGHTMARGIN: m_nMargins=MAKELONG(LOWORD(m_nMargins),lParam); if (m_nSide==SIDE_RIGHT) { m_bUpdatingMargins=TRUE; LPARAM lPrm=MAKELONG(LOWORD(m_nMargins), HIWORD(m_nMargins)+m_nNotesWidth); LRESULT lRslt=SendMessage(EM_SETMARGINS,wParam,lPrm); m_bUpdatingMargins=FALSE; return lRslt; } else return Default(); break; default: return Default(); }}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:58,
示例3: _Tvoid MsgWndView::DisplayMessage(LPCTSTR msg){ CString strTemp = msg; strTemp += _T("/r/n"); int len = GetEditCtrl().GetWindowTextLength(); GetEditCtrl().SetSel(len, len); GetEditCtrl().ReplaceSel(strTemp);}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:9,
示例4: goDlgvoid CSynBCGPEditView::OnEditGotoLine(){ CGotoLineDlg goDlg(this, GetEditCtrl()->GetLineCount()); if (goDlg.DoModal() != IDOK) { return; } GetEditCtrl()->GoToLine(goDlg.m_nLineNumber);}
开发者ID:20400992,项目名称:CoolFormat,代码行数:10,
示例5: GetEditCtrlBOOL CxEditView::OnEscape(UINT){ BOOL bHandled = FALSE; if (GetEditCtrl().IsSelection()) { GetEditCtrl().SelectNone(); bHandled = TRUE; } return bHandled;}
开发者ID:burzumishi,项目名称:arnold,代码行数:10,
示例6: ASSERT_VALIDvoid CEditView::ReadFromArchive(CArchive& ar, UINT nLen) // Read certain amount of text from the file, assume at least nLen // characters (not bytes) are in the file.{ ASSERT_VALID(this); LPVOID hText = LocalAlloc(LMEM_MOVEABLE, (nLen+1)*sizeof(TCHAR)); if (hText == NULL) AfxThrowMemoryException(); LPTSTR lpszText = (LPTSTR)LocalLock(hText); ASSERT(lpszText != NULL); if (ar.Read(lpszText, nLen*sizeof(TCHAR)) != nLen*sizeof(TCHAR)) { LocalUnlock(hText); LocalFree(hText); AfxThrowArchiveException(CArchiveException::endOfFile); } // Replace the editing edit buffer with the newly loaded data lpszText[nLen] = '/0';#ifndef _UNICODE if (afxData.bWin32s) { // set the text with SetWindowText, then free BOOL bResult = ::SetWindowText(m_hWnd, lpszText); LocalUnlock(hText); LocalFree(hText); // make sure that SetWindowText was successful if (!bResult || ::GetWindowTextLength(m_hWnd) < (int)nLen) AfxThrowMemoryException(); // remove old shadow buffer delete[] m_pShadowBuffer; m_pShadowBuffer = NULL; m_nShadowSize = 0; ASSERT_VALID(this); return; }#endif LocalUnlock(hText); HLOCAL hOldText = GetEditCtrl().GetHandle(); ASSERT(hOldText != NULL); LocalFree(hOldText); GetEditCtrl().SetHandle((HLOCAL)(UINT)(DWORD)hText); Invalidate(); ASSERT_VALID(this);}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:49,
示例7: GetEditCtrlBOOL COXNotesEditView::ShowBookmark(UINT nChar){ if (IsMarked(nChar)) { UINT nLine=GetEditCtrl().LineFromChar(nChar); UINT nFirstVisible=GetEditCtrl().GetFirstVisibleLine(); UINT nLastVisible=GetLastVisibleLine(); if (nFirstVisible>nLine || nLastVisible<nLine) GetEditCtrl().LineScroll(nLine-nFirstVisible); return TRUE; } else return FALSE;}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:15,
示例8: dlgvoid CxEditView::OnFormatFont() { CxFontDialog dlg(this); dlg.m_sample = GetEditCtrl().GetSelText(); ::FontDialog(this, &m_font, CF_EFFECTS | CF_SCREENFONTS, &dlg);}
开发者ID:burzumishi,项目名称:arnold,代码行数:7,
示例9: PyCEdit_create_window// @pymethod |PyCEdit|CreateWindow|Creates the window for a new Edit object.static PyObject *PyCEdit_create_window(PyObject *self, PyObject *args){ int style, id; PyObject *obParent; RECT rect; if (!PyArg_ParseTuple(args, "i(iiii)Oi:CreateWindow", &style, // @pyparm int|style||The style for the Edit. Use any of the win32con.BS_* constants. &rect.left,&rect.top,&rect.right,&rect.bottom, // @pyparm (left, top, right, bottom)|rect||The size and position of the Edit. &obParent, // @pyparm <o PyCWnd>|parent||The parent window of the Edit. Usually a <o PyCDialog>. &id )) // @pyparm int|id||The Edits control ID. return NULL; if (!ui_base_class::is_uiobject(obParent, &PyCWnd::type)) RETURN_TYPE_ERR("parent argument must be a window object"); CWnd *pParent = GetWndPtr( obParent ); if (pParent==NULL) return NULL; CEdit *pEdit = GetEditCtrl(self); if (!pEdit) return NULL; BOOL ok; GUI_BGN_SAVE; ok = pEdit->Create(style, rect, pParent, id ); GUI_END_SAVE; if (!ok) RETURN_ERR("CEdit::Create"); RETURN_NONE;}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:33,
示例10: GetEditCtrl// @pymethod |PyCEdit|SetSel|Sets the selection in the edit control.static PyObject *PyCEdit_set_sel(PyObject *self, PyObject *args){ CEdit *pEdit = GetEditCtrl(self); int start=0,end=0; BOOL bNoScroll = FALSE; if (!pEdit) return NULL; if (!PyArg_ParseTuple(args, "i|ii:SetSel", &start, // @pyparm int|start||Specifies the starting position. // If start is 0 and end is -1, all the text in the edit control is selected. // If start is -1, any current selection is removed. &end, // @pyparm int|end|start|Specifies the ending position. &bNoScroll)) { // @pyparm int|bNoScroll|0|Indicates whether the caret should be scrolled into view. If 0, the caret is scrolled into view. If 1, the caret is not scrolled into view. PyErr_Clear(); bNoScroll = FALSE; if (!PyArg_ParseTuple(args, "(ii)|i:SetSel", &start, // @pyparmalt2 (int, int)|start,end)||As for normal start, end args. &end, &bNoScroll)) // @pyparmalt2 int|bNoScroll|0|Indicates whether the caret should be scrolled into view. If 0, the caret is scrolled into view. If 1, the caret is not scrolled into view. return NULL; } if (start!=end && end==0) end=start; GUI_BGN_SAVE; pEdit->SetSel(start,end,bNoScroll); // @pyseemfc CEdit|SetSel GUI_END_SAVE; RETURN_NONE;}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:29,
示例11: BeginNewLinevoid CBaseView::OutputMsgLine( const char * line ){ BeginNewLine( ); OutputMsgHeader( ); m_astrMsg.Add( line ); GetEditCtrl().ReplaceSel( line );}
开发者ID:darwinbeing,项目名称:trade,代码行数:7,
示例12: GetEditCtrlvoid CBaseView::BeginNewLine( ){ GetEditCtrl().SetSel( -1, -1 ); int nLineCount = GetEditCtrl().GetLineCount(); if( nLineCount >= 1 ) { //int nLineIndex = GetEditCtrl().LineIndex( nLineCount-1 ); //int nLineLen = GetEditCtrl().LineLength( nLineIndex ); CPoint point = GetEditCtrl().PosFromChar( UINT(-1)/*nLineIndex+nLineLen*/ ); GetEditCtrl().SetCaretPos( point ); } CString string = STRING_CRLF; GetEditCtrl().ReplaceSel( string );}
开发者ID:darwinbeing,项目名称:trade,代码行数:16,
示例13: ImageFromLineint COXNotesEditView::ImageFromLine(UINT nLine) const{ int nRet=-1; CEdit& edt=GetEditCtrl(); UINT nFirst=edt.LineIndex(nLine); UINT nLast=edt.LineLength(edt.LineIndex(nLine)); if (nLast) nLast=nLast+nFirst-1; else nLast=nFirst; for (int n=0;n<m_arBookmarks.GetSize();n++) { //every value in the m_arBookmarks array //consists of index of the char the bookmark set to //(that is 24 least significant bits in the value) and //8 most significant bits represents image index of //the bookmark in m_imgBookmarks DWORD dwIndex=m_arBookmarks.GetAt(n); DWORD dwChar=0x00FFFFFF & dwIndex; if (dwChar>=nFirst) { if (dwChar<=nLast) nRet=dwIndex>>24; else return nRet; } }
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:30,
示例14: GetNotesRectvoid COXNotesEditView::OnLButtonDblClk(UINT nFlags, CPoint point) { CRect rct; GetNotesRect(&rct); if (rct.PtInRect(point)) { int n=HIWORD(GetEditCtrl().CharFromPos(point)); int nChar=GetEditCtrl().LineIndex(n); if (IsMarked(nChar)) RemoveBookmarks(nChar,nChar); else SetBookmark(nChar); } CEditView::OnLButtonDblClk(nFlags, point);}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:16,
示例15: GetParentFramevoid CMsgView::OnContextMenu(CWnd *pWnd, CPoint point) { CFrameWnd *pFrame; CMenu menu; CMenu *pPopupMenu; int nStart; int nEnd; UINT uiEnable; // make sure window is active pFrame = GetParentFrame (); ASSERT (pFrame != NULL); if (pFrame != NULL) { pFrame->ActivateFrame (); }; if (!menu.LoadMenu (IDR_COMPILEVW_POPUP)) { return; } pPopupMenu = menu.GetSubMenu (0); ASSERT (pPopupMenu != NULL); if (pPopupMenu == NULL) { return; } GetEditCtrl().GetSel(nStart, nEnd); uiEnable = (nStart == nEnd) ? MF_DISABLED | MF_GRAYED : MF_ENABLED; pPopupMenu->EnableMenuItem(IDM_MSG_COPY, uiEnable); pPopupMenu->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:33,
示例16: GetEditCtrl/** * show previous error. * * selects the previous error message and displays the source location. * * @param - * @return - * @exception - * @see GetLine(), SelectLine(), EvaluateErrorMessage(), ShowSourceLocation()*/void CMsgView::ShowPreviousError(){ int iLine; BOOL bFound = FALSE; CString strLine; CString strSourceFile; CString strLocation; CEdit& editCtrl = GetEditCtrl(); iLine = editCtrl.LineFromChar(); --iLine; if(iLine < 0) { iLine = editCtrl.GetLineCount() - 1; } while(GetLine(iLine, strLine)) { if(EvaluateErrorMessage(strLine, strSourceFile, strLocation)) { SelectLine(iLine); GetCDInfo(iLine-1, editCtrl, strSourceFile, dynamic_cast<CMsgFrame*>(GetParentFrame()), GetDocument()); ShowSourceLocation(strSourceFile, strLocation); bFound = TRUE; break; } --iLine; } if(!bFound) { MessageBeep(-1); }}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:43,
示例17: OnCmdMsgBOOL CSynBCGPEditView::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo){ ((CCoolFormat3View *)GetParent()->GetParent())->GetDocument()->SetModifiedFlag(GetEditCtrl()->IsModified()); ((CCoolFormat3View *)GetParent()->GetParent())->GetDocument()->CheckTitle(); return CBCGPEditView::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);}
开发者ID:20400992,项目名称:CoolFormat,代码行数:7,
示例18: OnInitialUpdatevoid EditTxt::OnInitialUpdate() { CFont * f; CEdit & n_edit=GetEditCtrl(); CEditView::OnInitialUpdate(); CMainFrame *pFrm=(CMainFrame *)AfxGetMainWnd(); pFrm->m_edit=(EditTxt*)this; // TODO: Add your specialized code here and/or call the base class pEdit=&n_edit; //设置字体 f = new CFont; f->CreateFont(15, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation 0, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("Arial")); // lpszFac pEdit->SetFont(f); //IDC_EDIT_RECEIVE是Edit框标号}
开发者ID:liguyu,项目名称:cppexample,代码行数:30,
示例19: GetDocumentvoid CXMLTextView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { CXMLTreeDoc *pDoc = GetDocument(); //从文档类中得到要显示的字符串 m_strContent = pDoc->m_strContent; //显示字符串 GetEditCtrl().SetWindowText(m_strContent);}
开发者ID:ZhangzheBJUT,项目名称:CPlusProject,代码行数:8,
示例20: GetEditCtrlvoid COutputView::OnDestroy() { CEdit &theEdit = GetEditCtrl(); theEdit.GetWindowText(GetDocument()->GetOutputText()); CEditView::OnDestroy();}
开发者ID:dewhisna,项目名称:m6811dis,代码行数:8,
示例21: return/** * Function name CMsgView::OnCreate * Description * @param LPCREATESTRUCT lpCreateStruct * @return int * @exception * @see */int CMsgView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate (lpCreateStruct) == -1) { return (-1); }; CFont *pFont; // Set fixed font pFont = CFont::FromHandle((HFONT)GetStockObject (ANSI_FIXED_FONT)); GetEditCtrl().SetFont(pFont); GetEditCtrl().SetReadOnly(); // set text limit to maximum of Windows 95/98 GetEditCtrl().SetLimitText(MSGWND_MAXTEXTLEN); UpdateEditText (); return (0);}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:26,
示例22: ShowMessagevoid CServerView::ShowMessage(CString str){ CEdit& Edit=GetEditCtrl(); m_criticalShowMess.Lock(); int len=Edit.GetWindowTextLength(); Edit.SetSel(len,len); Edit.ReplaceSel(str+"/r/n"); m_criticalShowMess.Unlock();}
开发者ID:bugou,项目名称:test,代码行数:9,
示例23: ASSERTvoid CPadView::OnScrollTo(CDC*, CPrintInfo* pInfo, POINT){ UINT nPage = pInfo->m_nCurPage; ASSERT(nPage < (UINT)m_aPageStart.GetSize()); if (nPage != m_nPreviewPage) { UINT nIndex = m_aPageStart[nPage]; GetEditCtrl().SetSel((int)nIndex, (int)nIndex); }}
开发者ID:jetlive,项目名称:skiaming,代码行数:10,
注:本文中的GetEditCtrl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetEditable函数代码示例 C++ GetEdge函数代码示例 |