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


C++ Paste函数代码示例

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


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


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