• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Paste函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Paste函数的典型用法代码示例。如果您正苦于以下问题:C++ Paste函数的具体用法?C++ Paste怎么用?C++ Paste使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: entry

void SFileWorker::MoveToTrash(const SFile *srcFolder, const SFileList *fileList)
{
	BEntry entry(TRASH_ENTRY);
	SFile trashFolder(&entry);

	ModifyRestoreAttribute(fileList,true);
	Cut(srcFolder, fileList);
	Paste(&trashFolder);
}
开发者ID:HaikuArchives,项目名称:Seeker,代码行数:9,代码来源:SFileWorker.cpp


示例2: Paste

bool SMatrix::Jointer_bottom(SMatrix& other)
{
	if(other.nCol()!=nCol()) return FALSE;
	
	if(!AddRows(other.nRow(),ERRORVAL))
		return FALSE;	
	
return Paste(other,nRow()-other.nRow(),0);
}
开发者ID:wsysuper,项目名称:Synthesizer,代码行数:9,代码来源:SMatrix.cpp


示例3: qWarning

	void Plugin::hookMessageWillCreated (LeechCraft::IHookProxy_ptr proxy,
			QObject*, QObject *entry, int, QString)
	{
		ICLEntry *other = qobject_cast<ICLEntry*> (entry);
		if (!other)
		{
			qWarning () << Q_FUNC_INFO
				<< "unable to cast"
				<< entry
				<< "to ICLEntry";
			return;
		}

		QString text = proxy->GetValue ("text").toString ();

		const int maxLines = XmlSettingsManager::Instance ()
				.property ("LineCount").toInt ();
		if (text.split ('\n').size () < maxLines)
			return;

		QByteArray propName;
		switch (other->GetEntryType ())
		{
		case ICLEntry::ETChat:
			propName = "EnableForNormalChats";
			break;
		case ICLEntry::ETMUC:
			propName = "EnableForMUCChats";
			break;
		case ICLEntry::ETPrivateChat:
			propName = "EnableForPrivateChats";
			break;
		default:
			return;
		}

		if (!XmlSettingsManager::Instance ().property (propName).toBool ())
			return;

		PasteDialog dia;
		dia.exec ();
		auto choice = dia.GetChoice ();
		switch (choice)
		{
		case PasteDialog::Cancel:
			proxy->CancelDefault ();
		case PasteDialog::No:
			return;
		case PasteDialog::Yes:
		{
			auto service = dia.GetCreator () (entry);
			service->Paste ({ Proxy_->GetNetworkAccessManager (), text, dia.GetHighlight () });
			proxy->CancelDefault ();
		}
		}
	}
开发者ID:aboduo,项目名称:leechcraft,代码行数:56,代码来源:autopaste.cpp


示例4: switch

void PolycodeEditor::handleEvent(Event *event) {    
    
	if(event->getDispatcher() == CoreServices::getInstance()->getCore() && enabled) {
		switch(event->getEventCode()) {

			// Only copypaste of more complex IDE entities is handled here.
			// Pure text copy/paste is handled in:
			// Modules/Contents/UI/Source/PolyUITextInput.cpp
			case Core::EVENT_SELECT_ALL:
			{
                selectAll();
            }
            break;
			case Core::EVENT_COPY:
			{
				void *data = NULL;
				String dataType = Copy(&data);
				if(data) {
					globalClipboard->setData(data, dataType, this);
				}
			}
			break;
			case Core::EVENT_PASTE:
			{
				if(globalClipboard->getData()) {
					Paste(globalClipboard->getData(), globalClipboard->getType());
				}
			}
			break;
			case Core::EVENT_UNDO:
			{
				if(editorActions.size() > 0 && currentUndoPosition >= 0) {
				doAction(editorActions[currentUndoPosition].actionName, editorActions[currentUndoPosition].beforeData);
				currentUndoPosition--;
				if(currentUndoPosition < -1) {
					currentUndoPosition = -1;
				}
				}				
			}
			break;
			case Core::EVENT_REDO:
			{
				if(editorActions.size() > 0) {			
				currentUndoPosition++;
				if(currentUndoPosition > editorActions.size()-1) {
					currentUndoPosition = editorActions.size()-1;
				} else {
					doAction(editorActions[currentUndoPosition].actionName, editorActions[currentUndoPosition].afterData);
				}
				}
			}
			break;			
		}
	}
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:55,代码来源:PolycodeEditor.cpp


示例5: Filter

void Console::Append(const String& s) {
	if(s.IsEmpty()) return;
	if(console) {
		String t = Filter(s, sCharFilterNoCr);
		if(*t.Last() == '\n')
			t.Trim(t.GetCount() - 1);
		Puts(t);
		return;
	}
	int l, h;
	GetSelection(l, h);
	if(GetCursor() == GetLength()) l = -1;
	EditPos p = GetEditPos();
	SetEditable();
	MoveTextEnd();
	WString t = Filter(s, sAppf).ToWString();
	int mg = sb.GetReducedViewSize().cx / GetFont().GetAveWidth();
	if(wrap_text && mg > 4) {
		int x = GetColumnLine(GetCursor()).x;
		WStringBuffer tt;
		const wchar *q = t;
		while(*q) {
			if(x > mg - 1) {
				tt.Cat('\n');
				tt.Cat("    ");
				x = 4;
			}
			x++;
			if(*q == '\n')
				x = 0;
			tt.Cat(*q++);
		}
		Paste(tt);
	}
	else
		Paste(t);
	SetReadOnly();
	if(l >= 0) {
		SetEditPos(p);
		SetSelection(l, h);
	}
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:42,代码来源:Console.cpp


示例6: Paste

bool GeneralMatrix::Jointer_Right(GeneralMatrix& other)
{
    if(other.nRow()!=nRow()) return FALSE;
	
	if(!AddCols(other.nCol(),ERRORVAL))
		return FALSE;

	Paste(other,0,nCol()-other.nCol());
   
return TRUE;
}
开发者ID:caomw,项目名称:sketch-based-modeling-qt,代码行数:11,代码来源:GeneralMatrix.cpp


示例7: qWarning

	void Plugin::hookMessageWillCreated (LeechCraft::IHookProxy_ptr proxy,
			QObject *chatTab, QObject *entry, int, QString)
	{
		ICLEntry *other = qobject_cast<ICLEntry*> (entry);
		if (!other)
		{
			qWarning () << Q_FUNC_INFO
				<< "unable to cast"
				<< entry
				<< "to ICLEntry";
			return;
		}

		QString text = proxy->GetValue ("text").toString ();

		const int maxLines = XmlSettingsManager::Instance ()
				.property ("LineCount").toInt ();
		if (text.split ('\n').size () < maxLines)
			return;

		QByteArray propName;
		switch (other->GetEntryType ())
		{
		case ICLEntry::ETChat:
			propName = "EnableForNormalChats";
			break;
		case ICLEntry::ETMUC:
			propName = "EnableForMUCChats";
			break;
		case ICLEntry::ETPrivateChat:
			propName = "EnableForPrivateChats";
			break;
		default:
			return;
		}

		if (!XmlSettingsManager::Instance ()
				.property (propName).toBool ())
			return;

		const bool shouldConfirm = XmlSettingsManager::Instance ()
				.property ("ConfirmPasting").toBool ();
		if (shouldConfirm &&
			QMessageBox::question (qobject_cast<QWidget*> (chatTab),
					tr ("Confirm pasting"),
					tr ("This message is too long according to current "
						"settings. Would you like to paste it on a "
						"pastebin?"),
					QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
			return;

		Paste (text, entry);
		proxy->CancelDefault ();
	}
开发者ID:dreamsxin,项目名称:leechcraft,代码行数:54,代码来源:autopaste.cpp


示例8: WaveTrack

void WaveTrack::InsertSilence(double t, double lenSecs)
{
   // Create a new track containing as much silence as we
   // need to insert, and then call Paste to do the insertion

   sampleCount len = (sampleCount) (lenSecs * rate + 0.5);

   WaveTrack *sTrack = new WaveTrack(dirManager);
   sTrack->rate = rate;

   sampleCount idealSamples = GetIdealBlockSize();
   sampleType *buffer = new sampleType[idealSamples];
   sampleCount i;
   for (i = 0; i < idealSamples; i++)
      buffer[i] = 0;

   sampleCount pos = 0;
   BlockFile *firstBlockFile = NULL;

   while (len) {
      sampleCount l = (len > idealSamples ? idealSamples : len);

      WaveBlock *w = new WaveBlock();
      w->start = pos;
      w->len = l;
      w->min = 0;
      w->max = 0;
      if (pos == 0 || len == l) {
         w->f = dirManager->NewBlockFile();
         firstBlockFile = w->f;
         bool inited = InitBlock(w);
         wxASSERT(inited);
         FirstWrite(buffer, w, l);
      } else {
         w->f = dirManager->CopyBlockFile(firstBlockFile);
         if (!w->f) {
            wxMessageBox("Could not paste!  (Out of disk space?)");
         }            
      }

      sTrack->block->Add(w);

      pos += l;
      len -= l;
   }

   sTrack->numSamples = pos;

   Paste(t, sTrack);

   delete sTrack;

   ConsistencyCheck("InsertSilence");
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:54,代码来源:WaveTrack.cpp


示例9: SetCaretLocation

void
CMHistoryText::PlaceCursorAtEnd()
{
    if (!IsEmpty())
    {
        SetCaretLocation(GetTextLength()+1);
        if (GetText().GetLastCharacter() != '\n')
        {
            Paste("\n");
        }
    }
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:12,代码来源:CMHistoryText.cpp


示例10: nRow

bool GeneralMatrix::Jointer_Diagonal(GeneralMatrix& other,ELEMTYPE Val)
{
	int iCol;
	
	iCol = nRow()==0 ? other.nCol()-1 : other.nCol();

	if(!AddRows(other.nRow(),Val))
		return FALSE;
	if(!AddCols(iCol,Val))
	    return FALSE;

return Paste(other,nRow()-other.nRow(),nCol()-other.nCol()); 
}
开发者ID:caomw,项目名称:sketch-based-modeling-qt,代码行数:13,代码来源:GeneralMatrix.cpp


示例11: Sequence

bool Sequence::InsertSilence(sampleCount s0, sampleCount len)
{
   // Create a new track containing as much silence as we
   // need to insert, and then call Paste to do the insertion
   Sequence *sTrack = new Sequence(mDirManager, mSampleFormat);

   sampleCount idealSamples = GetIdealBlockSize();

   // Allocate a zeroed buffer
   samplePtr buffer = NewSamples(idealSamples, mSampleFormat);
   ClearSamples(buffer, mSampleFormat, 0, idealSamples);

   sampleCount pos = 0;
   BlockFile *firstBlockFile = NULL;

   while (len) {
      sampleCount l = (len > idealSamples ? idealSamples : len);

      SeqBlock *w = new SeqBlock();
      w->start = pos;
      w->len = l;
      w->min = float(0.0);
      w->max = float(0.0);
      w->rms = float(0.0);
      if (pos == 0 || len == l) {
         w->f = mDirManager->NewBlockFile(mSummary->totalSummaryBytes);
         firstBlockFile = w->f;
         FirstWrite(buffer, w, l);
      } else {
         w->f = mDirManager->CopyBlockFile(firstBlockFile);
         if (!w->f) {
            // TODO set error message
            return false;
         }
      }

      sTrack->mBlock->Add(w);

      pos += l;
      len -= l;
   }

   sTrack->mNumSamples = pos;

   Paste(s0, sTrack);

   delete sTrack;
   DeleteSamples(buffer);

   return ConsistencyCheck("InsertSilence");
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:51,代码来源:Sequence.cpp


示例12: OnKeyDown

void CSequenceEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	
	short control;
	control = (GetKeyState(VK_CONTROL)&(-128));
	if ((nChar=='V'||nChar=='v')) {
		//The user pressed cntrl-V
		if (control) Paste();

	}

	
	CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}
开发者ID:DasLab,项目名称:BPPalign,代码行数:14,代码来源:SequenceEdit.cpp


示例13: BlockArray

Sequence::Sequence(const Sequence &orig)
{
   mDirManager = orig.mDirManager;
   mNumSamples = 0;
   mSampleFormat = orig.mSampleFormat;
   mSummary = new SummaryInfo;
   *mSummary = *orig.mSummary;
   mMaxSamples = orig.mMaxSamples;
   mMinSamples = orig.mMinSamples;

   mBlock = new BlockArray();

   Paste(0, &orig);
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:14,代码来源:Sequence.cpp


示例14: BlockArray

Sequence::Sequence(const Sequence &orig)
{
   mDirManager = orig.mDirManager;
   mDirManager->Ref();
   mNumSamples = 0;
   mSampleFormat = orig.mSampleFormat;
   mMaxSamples = orig.mMaxSamples;
   mMinSamples = orig.mMinSamples;
   mErrorOpening = false;

   mBlock = new BlockArray();

   Paste(0, &orig);
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:14,代码来源:Sequence.cpp


示例15: freeze

 void NativeTextfieldWin::ExecuteCommand(int command_id)
 {
     ScopedFreeze freeze(this, GetTextObjectModel());
     OnBeforePossibleChange();
     switch(command_id)
     {
     case IDS_APP_UNDO:       Undo();       break;
     case IDS_APP_CUT:        Cut();        break;
     case IDS_APP_COPY:       Copy();       break;
     case IDS_APP_PASTE:      Paste();      break;
     case IDS_APP_SELECT_ALL: SelectAll();  break;
     default:                 NOTREACHED(); break;
     }
     OnAfterPossibleChange(true);
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:15,代码来源:native_textfield_win.cpp


示例16: ExpandCutLine

bool WaveClip::ExpandCutLine(double cutLinePosition)
{
   for (WaveClipList::compatibility_iterator it = mCutLines.GetFirst(); it; it=it->GetNext())
   {
      WaveClip* cutline = it->GetData();
      if (fabs(mOffset + cutline->GetOffset() - cutLinePosition) < 0.0001)
      {
         if (!Paste(mOffset+cutline->GetOffset(), cutline))
            return false;
         delete cutline;
         mCutLines.DeleteNode(it);
         return true;
      }
   }

   return false;
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:17,代码来源:WaveClip.cpp


示例17: OnChar

	void OnChar(wxKeyEvent& event)
	{
		if (event.GetKeyCode() == WXK_TAB)
			return;
			
#ifdef __WXMAC__
		if (event.GetKeyCode() == 'v' && event.GetModifiers() == wxMOD_CMD)
		{
			Paste();
			wxTextCtrl* text = ((wxTextCtrl*)m_text);
			text->SetStyle(0, text->GetLastPosition(), GetDefaultTextCtrlStyle(text));
			return;
		}
#endif

		event.Skip();
	}
开发者ID:AbelTian,项目名称:filezilla,代码行数:17,代码来源:viewheader.cpp


示例18: PerformPaste

		void PerformPaste (ICLEntry *other, const QString& text,
				const ICoreProxy_ptr& proxy, const IUserChoiceHandler_ptr& handler,
				OkF okCont, CancelF cancelCont)
		{
			QSettings settings (QCoreApplication::organizationName (),
					QCoreApplication::applicationName () + "_Azoth_Autopaste");
			settings.beginGroup ("SavedChoices");
			settings.beginGroup (other->GetEntryID ());
			const auto guard = Util::MakeScopeGuard ([&settings]
					{
						settings.endGroup ();
						settings.endGroup ();
					});

			if (!handler->ShouldAsk (settings))
				return;

			PasteDialog dia;

			dia.SetCreatorName (settings.value ("Service").toString ());
			dia.SetHighlight (static_cast<Highlight> (settings.value ("Highlight").toInt ()));

			dia.exec ();

			switch (dia.GetChoice ())
			{
			case PasteDialog::Cancel:
				cancelCont ();
				break;
			case PasteDialog::No:
				handler->Rejected (settings);
				break;
			case PasteDialog::Yes:
			{
				auto service = dia.GetCreator () (other->GetQObject (), proxy);
				service->Paste ({ proxy->GetNetworkAccessManager (), text, dia.GetHighlight () });
				okCont ();

				handler->Accepted (settings);

				settings.setValue ("Service", dia.GetCreatorName ());
				settings.setValue ("Highlight", static_cast<int> (dia.GetHighlight ()));
				break;
			}
			}
		}
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:46,代码来源:autopaste.cpp


示例19: Cut

void Track::SyncLockAdjust(double oldT1, double newT1)
{
   if (newT1 > oldT1) {
      // Insert space within the track

      if (oldT1 > GetEndTime())
         return;

      auto tmp = Cut(oldT1, GetEndTime());

      Paste(newT1, tmp.get());
   }
   else if (newT1 < oldT1) {
      // Remove from the track
      Clear(newT1, oldT1);
   }
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:17,代码来源:Track.cpp


示例20: GetSel

void CConsoleEdit::OnMenuPlaster()
{
	int nStart,nEnd;
	GetSel(nStart,nEnd);
	if(nStart == nEnd)
	{
		// 粘贴
		MoveToEnd();
		Paste();
		CString alltext;
		GetWindowText(alltext);
		MoveToEnd();
		// 得到命令
		alltext = alltext.Mid(m_last_title_pos,m_nLength-m_last_title_pos);
		strncpy(m_cmd,alltext,alltext.GetLength()>sizeof(m_cmd)?sizeof(m_cmd):alltext.GetLength());
	}
}
开发者ID:diduoren,项目名称:youeryuan,代码行数:17,代码来源:ConsoleEdit.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PasteboardCreate函数代码示例发布时间:2022-05-30
下一篇:
C++ Pass函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap