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 next 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"));
	}
	
}
Re: How do I cut file to the clipboard? [message #46979 is a reply to message #46976] Sun, 09 October 2016 19:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
That is actually pretty interesting issue Smile

I understand your question as "how could I reproduce windows shell behavior where Ctrl+X on file makes it 'gray' and eventual paste will remove it from the original location", right?

Re: How do I cut file to the clipboard? [message #46984 is a reply to message #46979] Mon, 10 October 2016 00:28 Go to previous messageGo to next message
kurete is currently offline  kurete
Messages: 17
Registered: March 2016
Location: Japan
Promising Member

Quote:
I understand your question as "how could I reproduce windows shell behavior where Ctrl+X on file makes it 'gray' and eventual paste will remove it from the original location", right?


Yes
Re: How do I cut file to the clipboard? [message #47017 is a reply to message #46984] Sun, 06 November 2016 08:37 Go to previous message
kurete is currently offline  kurete
Messages: 17
Registered: March 2016
Location: Japan
Promising Member

I use InvokeCommand. Thank you.
Previous Topic: System Requirements, target platforms
Next Topic: Hey,MyImages::MyImage() problem
Goto Forum:
  


Current Time: Sat Apr 20 08:42:01 CEST 2024

Total time taken to generate the page: 4.05216 seconds