这篇教程C++ CanPaste函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CanPaste函数的典型用法代码示例。如果您正苦于以下问题:C++ CanPaste函数的具体用法?C++ CanPaste怎么用?C++ CanPaste使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CanPaste函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PasteTextvoid CPWL_Edit::PasteText() { if (!CanPaste()) return; CFX_WideString swClipboard; if (IFX_SystemHandler* pSH = GetSystemHandler()) swClipboard = pSH->GetClipboardText(GetAttachedHWnd()); if (m_pFillerNotify) { FX_BOOL bRC = TRUE; FX_BOOL bExit = FALSE; CFX_WideString strChangeEx; int nSelStart = 0; int nSelEnd = 0; GetSel(nSelStart, nSelEnd); m_pFillerNotify->OnBeforeKeyStroke(GetAttachedData(), swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0); if (!bRC) return; if (bExit) return; } if (swClipboard.GetLength() > 0) { Clear(); InsertText(swClipboard.c_str()); }}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:29,
示例2: switchvoid wxTextCtrl::OnKeyDown(wxKeyEvent& event){ if ( event.GetModifiers() == wxMOD_CONTROL ) { switch( event.GetKeyCode() ) { case 'A': SelectAll(); return; case 'C': if ( CanCopy() ) Copy() ; return; case 'V': if ( CanPaste() ) Paste() ; return; case 'X': if ( CanCut() ) Cut() ; return; default: break; } } // no, we didn't process it event.Skip();}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:28,
示例3: Pastevoid wxTextCtrl::Paste(){ if (CanPaste()) { ::SendMessage(GetBuddyHwnd(), WM_PASTE, 0, 0L); }}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:7,
示例4: wxCHECK_RETvoid wxTextEntry::Paste(){ wxCHECK_RET( GetTextPeer(), "Must create the control first" ); if (CanPaste()) GetTextPeer()->Paste() ;}
开发者ID:chromylei,项目名称:third_party,代码行数:7,
示例5: Pastevoid wxTextCtrl::Paste(){ if (CanPaste()) { HWND hWnd = GetHwnd(); ::WinSendMsg(hWnd, EM_PASTE, 0, 0); }} // end of wxTextCtrl::Paste
开发者ID:EdgarTx,项目名称:wx,代码行数:9,
示例6: switch bool NativeTextfieldWin::IsCommandIdEnabled(int command_id) const { switch(command_id) { case IDS_APP_UNDO: return !textfield_->read_only() && !!CanUndo(); case IDS_APP_CUT: return !textfield_->read_only() && !textfield_->IsPassword() && !!CanCut(); case IDS_APP_COPY: return !!CanCopy() && !textfield_->IsPassword(); case IDS_APP_PASTE: return !textfield_->read_only() && !!CanPaste(); case IDS_APP_SELECT_ALL: return !!CanSelectAll(); default: NOTREACHED(); return false; } }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:14,
示例7: GetSelvoid CRichEditCtrlX::OnContextMenu(CWnd* pWnd, CPoint point){ long iSelStart, iSelEnd; GetSel(iSelStart, iSelEnd); int iTextLen = GetWindowTextLength(); // Context menu of standard edit control // // Undo // ---- // Cut // Copy // Paste // Delete // ------ // Select All bool bReadOnly = (GetStyle() & ES_READONLY); CMenu menu; menu.CreatePopupMenu(); if (!bReadOnly){ menu.AppendMenu(MF_STRING, MP_UNDO, GetResString(IDS_UNDO)); menu.AppendMenu(MF_SEPARATOR); } if (!bReadOnly) menu.AppendMenu(MF_STRING, MP_CUT, GetResString(IDS_CUT)); menu.AppendMenu(MF_STRING, MP_COPYSELECTED, GetResString(IDS_COPY)); if (!bReadOnly){ menu.AppendMenu(MF_STRING, MP_PASTE, GetResString(IDS_PASTE)); menu.AppendMenu(MF_STRING, MP_REMOVESELECTED, GetResString(IDS_DELETESELECTED)); } menu.AppendMenu(MF_SEPARATOR); menu.AppendMenu(MF_STRING, MP_SELECTALL, GetResString(IDS_SELECTALL)); menu.EnableMenuItem(MP_UNDO, CanUndo() ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_CUT, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_COPYSELECTED, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_PASTE, CanPaste() ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_REMOVESELECTED, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_SELECTALL, iTextLen > 0 ? MF_ENABLED : MF_GRAYED); if (point.x == -1 && point.y == -1) { point.x = 16; point.y = 32; ClientToScreen(&point); } menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:50,
示例8: Pastevoid wxTextCtrl::Paste(){ if (CanPaste()) { wxClipboardTextEvent evt(wxEVT_TEXT_PASTE, GetId()); evt.SetEventObject(this); if (!GetEventHandler()->ProcessEvent(evt)) { wxTextEntry::Paste(); // TODO: eventually we should add setting the default style again SendTextUpdatedEvent(); } }}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:15,
示例9: ASSERT/// report clipboard content availability. This function checks whole clipboard /// content. It may return false if some objects cannot be pasted. i.e. events/// cannot be pasted as children of state machine object/// /param pParentName - name of object to paste/// /return true if whole clipboard content cannot be pasted for passed parentbool CStateMachineClipboard::CanPastePartially( IHashString *pParentName ) const{ ASSERT( pParentName != NULL ); if( !CanPaste() ) { return false; } static const DWORD hash_CQHState = CHashString( _T("CQHState") ).GetUniqueID(); if( hash_CQHState != GetComponentType( pParentName ).GetUniqueID() ) { IXMLArchive *pArchive = GetClipboardDataArchive(); ASSERT( pArchive != NULL ); CStateMachineClipboardPreprocessor preprocessor; VERIFY( preprocessor.Prepare( pParentName, pArchive ) ); pArchive->Close(); return preprocessor.HasTopLevelEvents(); } return false;}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:25,
示例10: ZeroMemoryvoid CLeftView::OnContextMenu(CWnd* pWnd, CPoint point) { char cStr[64]; ZeroMemory( cStr, sizeof(cStr) ); CMenu menu; CFoulerDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); menu.CreatePopupMenu(); CListCtrl& refCtrl = GetListCtrl(); int iCount = refCtrl.GetSelectedCount(); if( iCount > 0 ) { wsprintf( cStr, "%d items have been selected", iCount ); menu.AppendMenu( MF_STRING, NULL, cStr ); menu.AppendMenu( MF_STRING, ID_EDIT_COPY, "Copy" ); } if( CanPaste() ) menu.AppendMenu( MF_STRING, ID_EDIT_PASTE, "Paste" ); SetForegroundWindow(); menu.TrackPopupMenu( TPM_LEFTALIGN, point.x, point.y, this, NULL );}
开发者ID:WisemanLim,项目名称:femos,代码行数:20,
示例11: Paste/// /brief paste objects from clipboard/// /param pParentName - name of the state machine or single state to paste/// /param object - list with created objects/// /return true if objects were pasted from the clipboardbool CStateMachineClipboard::Paste( IHashString *pParentName, vector<ObjectInfo> &objects ) const{ if( !CanPaste() ) { return false; } IXMLArchive *pArchive = GetClipboardDataArchive(); if( pArchive == NULL ) { return false; } if( !IsValidArchive( pArchive )) { pArchive->Close(); return false; } CStateMachineClipboardPreprocessor preprocessor; if( !preprocessor.Prepare( pParentName, pArchive ) ) { pArchive->Close(); return false; } IXMLArchive *pTransformedArchive = TransformXMLArchive( pArchive, preprocessor ); if( pTransformedArchive == NULL ) { pArchive->Close(); return false; }#ifdef _DEBUG DumpStream( pTransformedArchive, _T("c://stateMachine.transformed.xml") );#endif bool res = CreateObjects( pParentName, pTransformedArchive, objects ); pTransformedArchive->Close(); return res;}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:45,
示例12: SetFocusvoid CMuleTextCtrl::OnRightDown( wxMouseEvent& evt ){ // If this control doesn't have focus, then set it if ( FindFocus() != this ) SetFocus(); wxMenu popup_menu; popup_menu.Append( CMTCE_Cut, _("Cut") ); popup_menu.Append( CMTCE_Copy, _("Copy") ); popup_menu.Append( CMTCE_Paste, _("Paste") ); popup_menu.Append( CMTCE_Clear, _("Clear") ); popup_menu.AppendSeparator(); popup_menu.Append( CMTCE_SelAll, _("Select All") ); // wxMenu will automatically enable/disable the Cut and Copy items, // however, were are a little more pricky about the Paste item than they // are, so we enable/disable it on our own, depending on whenever or not // there's actually something to paste bool canpaste = false; if ( CanPaste() ) { if ( wxTheClipboard->Open() ) { if ( wxTheClipboard->IsSupported( wxDF_TEXT ) ) { wxTextDataObject data; wxTheClipboard->GetData( data ); canpaste = (data.GetTextLength() > 0); } wxTheClipboard->Close(); } } popup_menu.Enable( CMTCE_Paste, canpaste ); popup_menu.Enable( CMTCE_Clear, IsEditable() && !GetValue().IsEmpty() ); PopupMenu( &popup_menu, evt.GetX(), evt.GetY() );}
开发者ID:dreamerc,项目名称:amule,代码行数:41,
示例13: SetFocusvoid CMyRichEdit::OnRButtonDown(UINT nFlags, CPoint point) { //设置为焦点 SetFocus(); //创建一个弹出式菜单 CMenu popmenu; popmenu.CreatePopupMenu(); //添加菜单项目 popmenu.AppendMenu(0, ID_RICH_UNDO, _T("撤消(&U)")); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_CUT, _T("剪切(&T)")); popmenu.AppendMenu(0, ID_RICH_COPY, _T("复制(&T)")); popmenu.AppendMenu(0, ID_RICH_PASTE, _T("粘贴(&P)")); popmenu.AppendMenu(0, ID_RICH_CLEAR, _T("删除(&D)")); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_SELECTALL, _T("全选(&A)")); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_SETFONT, _T("设置字体(&F)")); //初始化菜单项 UINT nUndo=(CanUndo() ? 0 : MF_GRAYED ); popmenu.EnableMenuItem(ID_RICH_UNDO, MF_BYCOMMAND|nUndo); UINT nSel=((GetSelectionType()!=SEL_EMPTY) ? 0 : MF_GRAYED) ; popmenu.EnableMenuItem(ID_RICH_CUT, MF_BYCOMMAND|nSel); popmenu.EnableMenuItem(ID_RICH_COPY, MF_BYCOMMAND|nSel); popmenu.EnableMenuItem(ID_RICH_CLEAR, MF_BYCOMMAND|nSel); UINT nPaste=(CanPaste() ? 0 : MF_GRAYED) ; popmenu.EnableMenuItem(ID_RICH_PASTE, MF_BYCOMMAND|nPaste); //显示菜单 CPoint pt; GetCursorPos(&pt); popmenu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this); popmenu.DestroyMenu(); CRichEditCtrl::OnRButtonDown(nFlags, point);}
开发者ID:janker007,项目名称:cocoshun,代码行数:38,
示例14: SetFocusvoid CTWScriptEdit::OnRButtonDown(UINT nFlags, CPoint point) { //设置为焦点 SetFocus(); //创建一个弹出式菜单 CMenu popmenu; popmenu.CreatePopupMenu(); //添加菜单项目 popmenu.AppendMenu(0, ID_RICH_UNDO, "&Undo"); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_CUT, "&Cut"); popmenu.AppendMenu(0, ID_RICH_COPY, "C&opy"); popmenu.AppendMenu(0, ID_RICH_PASTE, "&Paste"); popmenu.AppendMenu(0, ID_RICH_CLEAR, "C&lear"); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_SELECTALL, "Select &All"); popmenu.AppendMenu(0, MF_SEPARATOR); popmenu.AppendMenu(0, ID_RICH_SETFONT, "Select &Font"); //初始化菜单项 UINT nUndo=(CanUndo() ? 0 : MF_GRAYED ); popmenu.EnableMenuItem(ID_RICH_UNDO, MF_BYCOMMAND|nUndo); UINT nSel=((GetSelectionType()!=SEL_EMPTY) ? 0 : MF_GRAYED) ; popmenu.EnableMenuItem(ID_RICH_CUT, MF_BYCOMMAND|nSel); popmenu.EnableMenuItem(ID_RICH_COPY, MF_BYCOMMAND|nSel); popmenu.EnableMenuItem(ID_RICH_CLEAR, MF_BYCOMMAND|nSel); UINT nPaste=(CanPaste() ? 0 : MF_GRAYED) ; popmenu.EnableMenuItem(ID_RICH_PASTE, MF_BYCOMMAND|nPaste); //显示菜单 CPoint pt; GetCursorPos(&pt); popmenu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this); popmenu.DestroyMenu(); CRichEditCtrl::OnRButtonDown(nFlags, point);}
开发者ID:gitrider,项目名称:wxsj2,代码行数:38,
示例15: _ENABLEvoid FB_Frame::OnMenuOpen ( wxMenuEvent& event ){ if ( event.GetMenu() == m_EditMenu ) { FB_STC * stc = 0; if( m_Code_areaTab != 0 ) stc = reinterpret_cast<FB_STC *>( m_Code_areaTab->GetCurrentPage() ); #define _ENABLE( id, func ) m_EditMenu->Enable( id, ( stc != 0 ) ? stc -> func : false ) _ENABLE( wxID_UNDO, CanUndo() ); _ENABLE( wxID_REDO, CanRedo() ); _ENABLE( wxID_COPY, HasSelection() ); _ENABLE( wxID_CUT, HasSelection() ); _ENABLE( wxID_PASTE, CanPaste() ); _ENABLE( wxID_SELECTALL, GetLength() ); _ENABLE( fbideID_SelectLine, GetLength() ); _ENABLE( fbideID_CommentBlock, CanComment() ); _ENABLE( fbideID_UncommentBlock, CanComment() ); #undef _ENABLE m_EditMenu->Enable(wxID_JUSTIFY_RIGHT, ( stc ) ? true : false ); m_EditMenu->Enable(wxID_JUSTIFY_LEFT, ( stc ) ? true : false ); }}
开发者ID:bihai,项目名称:fbide,代码行数:23,
示例16: CanPaste void Input::Clipboard::OnMenuKeyboard(const Window::Menu::PopupHandler::Param& param) { param.menu[IDM_MACHINE_EXT_KEYBOARD_PASTE].Enable( !param.show || CanPaste() ); }
开发者ID:JasonGoemaat,项目名称:NestopiaDx9,代码行数:4,
示例17: OnEditPastevoid Edit::OnEditPaste (wxCommandEvent &WXUNUSED(event)) { if (!CanPaste()) return; Paste ();}
开发者ID:jfiguinha,项目名称:Regards,代码行数:4,
示例18: Pastevoid wxWebFrame::Paste(){ if (CanPaste()) m_impl->frame->editor()->paste();}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:6,
示例19: CanPastevoid wxComboBox::OnUpdatePaste(wxUpdateUIEvent& event){ event.Enable( CanPaste() );}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:4,
示例20: lEnableMenuItem/** Set the state of the items in the main* program menu.*/void Explorerplusplus::SetProgramMenuItemStates(HMENU hProgramMenu){ LONG WindowStyle; UINT ItemToCheck; UINT ListViewStyle; BOOL bVirtualFolder; UINT uViewMode; m_pShellBrowser[m_iObjectIndex]->GetCurrentViewMode(&uViewMode); bVirtualFolder = m_pActiveShellBrowser->InVirtualFolder(); lEnableMenuItem(hProgramMenu,IDM_FILE_COPYITEMPATH,CheckItemSelection()); lEnableMenuItem(hProgramMenu,IDM_FILE_COPYUNIVERSALFILEPATHS,CheckItemSelection()); lEnableMenuItem(hProgramMenu,IDM_FILE_SETFILEATTRIBUTES,CheckItemSelection()); lEnableMenuItem(hProgramMenu,IDM_FILE_OPENCOMMANDPROMPT,!bVirtualFolder); lEnableMenuItem(hProgramMenu,IDM_FILE_SAVEDIRECTORYLISTING,!bVirtualFolder); lEnableMenuItem(hProgramMenu,IDM_FILE_COPYCOLUMNTEXT,m_nSelected && (uViewMode == VM_DETAILS)); lEnableMenuItem(hProgramMenu,IDM_FILE_RENAME,IsRenamePossible()); lEnableMenuItem(hProgramMenu,IDM_FILE_DELETE,IsDeletionPossible()); lEnableMenuItem(hProgramMenu,IDM_FILE_DELETEPERMANENTLY,IsDeletionPossible()); lEnableMenuItem(hProgramMenu,IDM_FILE_PROPERTIES,CanShowFileProperties()); lEnableMenuItem(hProgramMenu,IDM_EDIT_UNDO,m_FileActionHandler.CanUndo()); lEnableMenuItem(hProgramMenu,IDM_EDIT_PASTE,CanPaste()); lEnableMenuItem(hProgramMenu,IDM_EDIT_PASTESHORTCUT,CanPaste()); lEnableMenuItem(hProgramMenu,IDM_EDIT_PASTEHARDLINK,CanPaste()); /* The following menu items are only enabled when one or more files are selected (they represent file actions, cut/copy, etc). */ /* TODO: Split CanCutOrCopySelection() into two, as some items may only be copied/cut (not both). */ lEnableMenuItem(hProgramMenu,IDM_EDIT_COPY,CanCutOrCopySelection()); lEnableMenuItem(hProgramMenu,IDM_EDIT_CUT,CanCutOrCopySelection()); lEnableMenuItem(hProgramMenu,IDM_EDIT_COPYTOFOLDER,CanCutOrCopySelection() && GetFocus() != m_hTreeView); lEnableMenuItem(hProgramMenu,IDM_EDIT_MOVETOFOLDER,CanCutOrCopySelection() && GetFocus() != m_hTreeView); lEnableMenuItem(hProgramMenu,IDM_EDIT_WILDCARDDESELECT,m_nSelected); lEnableMenuItem(hProgramMenu,IDM_EDIT_SELECTNONE,m_nSelected); lEnableMenuItem(hProgramMenu,IDM_EDIT_SHOWFILESLACK,m_nSelected); lEnableMenuItem(hProgramMenu,IDM_EDIT_RESOLVELINK,m_nSelected); lCheckMenuItem(hProgramMenu,IDM_VIEW_STATUSBAR,m_bShowStatusBar); lCheckMenuItem(hProgramMenu,IDM_VIEW_FOLDERS,m_bShowFolders); lCheckMenuItem(hProgramMenu,IDM_VIEW_DISPLAYWINDOW,m_bShowDisplayWindow); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_ADDRESSBAR,m_bShowAddressBar); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_MAINTOOLBAR,m_bShowMainToolbar); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_BOOKMARKSTOOLBAR,m_bShowBookmarksToolbar); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_DRIVES,m_bShowDrivesToolbar); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_APPLICATIONTOOLBAR,m_bShowApplicationToolbar); lCheckMenuItem(hProgramMenu,IDM_TOOLBARS_LOCKTOOLBARS,m_bLockToolbars); lCheckMenuItem(hProgramMenu,IDM_VIEW_SHOWHIDDENFILES,m_pActiveShellBrowser->QueryShowHidden()); lCheckMenuItem(hProgramMenu,IDM_FILTER_APPLYFILTER,m_pActiveShellBrowser->GetFilterStatus()); lEnableMenuItem(hProgramMenu,IDM_ACTIONS_NEWFOLDER,!bVirtualFolder); lEnableMenuItem(hProgramMenu,IDM_ACTIONS_SPLITFILE,(m_pActiveShellBrowser->QueryNumSelectedFiles() == 1) && !bVirtualFolder); lEnableMenuItem(hProgramMenu,IDM_ACTIONS_MERGEFILES,m_nSelected > 1); lEnableMenuItem(hProgramMenu,IDM_ACTIONS_DESTROYFILES,m_nSelected); WindowStyle = GetWindowLong(m_hActiveListView,GWL_STYLE); ListViewStyle = (WindowStyle & LVS_TYPEMASK); ItemToCheck = GetViewModeMenuId(uViewMode); CheckMenuRadioItem(hProgramMenu,IDM_VIEW_THUMBNAILS,IDM_VIEW_EXTRALARGEICONS,ItemToCheck,MF_BYCOMMAND); lEnableMenuItem(hProgramMenu,IDM_FILE_CLOSETAB,TabCtrl_GetItemCount(m_hTabCtrl)); lEnableMenuItem(hProgramMenu,IDM_GO_BACK,m_pActiveShellBrowser->IsBackHistory()); lEnableMenuItem(hProgramMenu,IDM_GO_FORWARD,m_pActiveShellBrowser->IsForwardHistory()); lEnableMenuItem(hProgramMenu,IDM_GO_UPONELEVEL,m_pActiveShellBrowser->CanBrowseUp()); lEnableMenuItem(hProgramMenu,IDM_VIEW_AUTOSIZECOLUMNS,uViewMode == VM_DETAILS); if(uViewMode == VM_DETAILS) { /* Disable auto arrange menu item. */ lEnableMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,FALSE); lCheckMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,FALSE); lEnableMenuItem(hProgramMenu,IDM_VIEW_GROUPBY,TRUE); } else if(uViewMode == VM_LIST) { /* Disable group menu item. */ lEnableMenuItem(hProgramMenu,IDM_VIEW_GROUPBY,FALSE); /* Disable auto arrange menu item. */ lEnableMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,FALSE); lCheckMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,FALSE); } else { lEnableMenuItem(hProgramMenu,IDM_VIEW_GROUPBY,TRUE); lEnableMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,TRUE); lCheckMenuItem(hProgramMenu,IDM_ARRANGEICONSBY_AUTOARRANGE,m_pActiveShellBrowser->QueryAutoArrange());//.........这里部分代码省略.........
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:101,
示例21: OnPasteUpdate/*---------------------------------------------------------------------------*/void wxSQLEditorBase::OnPasteUpdate(wxUpdateUIEvent& event){ event.Enable(CanPaste());}
开发者ID:eriser,项目名称:wxsqlite3,代码行数:5,
示例22: OnPastevoid FB_STC::OnPaste ( wxCommandEvent& event ) { if (!CanPaste()) return; Paste ();}
开发者ID:bihai,项目名称:fbide,代码行数:4,
示例23: pasteEventvoid fbtTextFile::pasteEvent(wxCommandEvent& evt){ if (!CanPaste()) return; Paste();}
开发者ID:Ali-il,项目名称:gamekit,代码行数:6,
示例24: MyFilterstatic pascal Boolean MyFilter(DialogPtr dlog, EventRecord *evt, short *itemHit) { Boolean ans=FALSE,doHilite=FALSE; WindowPtr w; short type,ch; Handle hndl; Rect box; static long then; static Point clickPt; w = (WindowPtr)(evt->message); switch(evt->what) { case updateEvt: if (w == dlog) { /* Update our dialog contents */ DoDialogUpdate(dlog); ans = TRUE; *itemHit = 0; } else { /* * Call your main event loop DoUpdate(w) routine here if you * don't want unsightly holes in background windows caused * by nested alerts, balloon help, or screen savers (see * Tech Note #304). */ } break; case activateEvt: if (w == dlog) { DoDialogActivate(dlog,(evt->modifiers & activeFlag)!=0); *itemHit = 0; } else { /* * Call your main event loop DoActivate(w) routine here if * you want to deactivate the former frontmost window, in order * to unhighlight any selection, scroll bars, etc. */ } break; case mouseDown: case mouseUp: where = evt->where; /* Make info available to DoDialog() */ GlobalToLocal(&where); modifiers = evt->modifiers; ans = CheckUserItems(where,itemHit); break; case keyDown: if ((ch=(unsigned char)evt->message)=='/r' || ch==ENTERkey) { *itemHit = OK_ITEM /* Default Item Number here */; doHilite = ans = TRUE; } else if (evt->modifiers & cmdKey) { ch = (unsigned char)evt->message; switch(ch) { case 'x': case 'X': if (TextSelected(dlog)) { SystemEdit(3); ZeroScrap(); DialogCut(dlog); TEToScrap(); } else { /* Cut from anything else cuttable, like a list */ } break; case 'c': case 'C': if (TextSelected(dlog)) { SystemEdit(3); ZeroScrap(); DialogCopy(dlog); TEToScrap(); } else { /* Copy from anything else copyable, like a list */ } break; case 'v': case 'V': if (CanPaste(1,'TEXT')) { TEFromScrap(); DialogPaste(dlog); } else { /* Deal with any other pasteable scraps here */ } break; case 'a': case 'A': if (((DialogPeek)dlog)->editField >= 0) { /* Dialog has text edit item: select all */ SelectDialogItemText(dlog,((DialogPeek)dlog)->editField+1,0,32767); } else { } *itemHit = 0; break; case '.': *itemHit = CANCEL_ITEM; doHilite = TRUE; break; } ans = TRUE; /* Other cmd-chars ignored */ } break; } if (doHilite) { GetDialogItem(dlog,*itemHit,&type,&hndl,&box); /* Reality check */ if (type == (btnCtrl+ctrlItem)) { long soon = TickCount() + 7; /* Or whatever feels right */ HiliteControl((ControlHandle)hndl,1);//.........这里部分代码省略.........
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:101,
示例25: GetClientRectvoid CRichEditCtrlX::OnContextMenu(CWnd* /*pWnd*/, CPoint point){ if (point.x != -1 || point.y != -1) { CRect rcClient; GetClientRect(&rcClient); ClientToScreen(&rcClient); if (!rcClient.PtInRect(point)) { Default(); return; } } long iSelStart, iSelEnd; GetSel(iSelStart, iSelEnd); int iTextLen = GetWindowTextLength(); // Context menu of standard edit control // // Undo // ---- // Cut // Copy // Paste // Delete // ------ // Select All bool bReadOnly = (GetStyle() & ES_READONLY)!=0; CMenu menu; menu.CreatePopupMenu(); if (!bReadOnly){ menu.AppendMenu(MF_STRING, MP_UNDO, GetResString(IDS_UNDO)); menu.AppendMenu(MF_SEPARATOR); } if (!bReadOnly) menu.AppendMenu(MF_STRING, MP_CUT, GetResString(IDS_CUT)); menu.AppendMenu(MF_STRING, MP_COPYSELECTED, GetResString(IDS_COPY)); if (!bReadOnly){ menu.AppendMenu(MF_STRING, MP_PASTE, GetResString(IDS_PASTE)); menu.AppendMenu(MF_STRING, MP_REMOVESELECTED, GetResString(IDS_DELETESELECTED)); } menu.AppendMenu(MF_SEPARATOR); menu.AppendMenu(MF_STRING, MP_SELECTALL, GetResString(IDS_SELECTALL)); menu.EnableMenuItem(MP_UNDO, CanUndo() ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_CUT, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_COPYSELECTED, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_PASTE, CanPaste() ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_REMOVESELECTED, iSelEnd > iSelStart ? MF_ENABLED : MF_GRAYED); menu.EnableMenuItem(MP_SELECTALL, iTextLen > 0 ? MF_ENABLED : MF_GRAYED); if (point.x == -1 && point.y == -1) { point.x = 16; point.y = 32; ClientToScreen(&point); } // Cheap workaround for the "Text cursor is showing while context menu is open" glitch. It could be solved properly // with the RE's COM interface, but because the according messages are not routed with a unique control ID, it's not // really useable (e.g. if there are more RE controls in one window). Would to envelope each RE window to get a unique ID.. m_bForceArrowCursor = true; menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); m_bForceArrowCursor = false;}
开发者ID:HackLinux,项目名称:eMule-IS-Mod,代码行数:65,
示例26: OnUpdatePastevoid wxTextCtrl::OnUpdatePaste( wxUpdateUIEvent& rEvent ){ rEvent.Enable(CanPaste());} // end of wxTextCtrl::OnUpdatePaste
开发者ID:EdgarTx,项目名称:wx,代码行数:4,
示例27: CanPastevoid wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent& event){ event.Enable( CanPaste() );}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:4,
示例28: CanPastevoid CLeftView::OnUpdateEditPaste(CCmdUI* pCmdUI) { pCmdUI->Enable( CanPaste() );}
开发者ID:WisemanLim,项目名称:femos,代码行数:4,
注:本文中的CanPaste函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CanRead函数代码示例 C++ CanMove函数代码示例 |