Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » How do I cut file to the clipboard?
How do I cut file to the clipboard? [message #46976] Sat, 08 October 2016 17:18 Go to previous message
kurete is currently offline  kurete
Messages: 17
Registered: March 2016
Location: Japan
Promising Member

How do I cut file to the clipboard?

I can copy and paste file to the clipboard.

However,I can not cut file.

Source code of copy/paste

void Copy(String path)
{
       if(Upp::FileExists(path().ToStd().c_str()))
       {
          ClearClipboard();
          VectorMap<String, ClipData> data;
	  Vector<String> files;
          files.Set(0,path));
	  Upp::AppendFiles(data,files);
          Upp::AppendClipboard(data);
       }
       else
       {  
	  PromptOK(t_("Copy Error"));
       }
}

void Paste(String path)
{
	PasteClip& clip = Ctrl::Clipboard();
	PromptOK(clip.GetFormat());
	if(Upp::AcceptFiles(clip))
	{
		if(GetFiles(clip).GetCount()>=1)
		{
			String file = Upp::GetFiles(clip).At(0);
			if(Upp::GetFileExt(path)!="")
			{
				if(!Upp::FileCopy(file,Upp::GetFileDirectory(path)+Upp::GetFileName(file)))
				{
				   PromptOK(t_("Paste Error"));
				}
			}
			else
			{
				if(!Upp::FileCopy(file,path+"\\"+Upp::GetFileName(file)))
                                {
			           PromptOK(t_("Paste Error"));
				   
				}
			}
		}
		else
		{
			PromptOK(t_("Paste Error"));
		}
	}
	else
	{
	    PromptOK(t_("Paste Error"));
	}
	
}
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: System Requirements, target platforms
Next Topic: Hey,MyImages::MyImage() problem
Goto Forum:
  


Current Time: Fri May 02 17:08:41 CEST 2025

Total time taken to generate the page: 0.00670 seconds