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 » U++ Library support » U++ Library : Other (not classified elsewhere) » Image DnD into Upp app
Re: Image DnD into Upp app [message #44175 is a reply to message #44173] Thu, 15 January 2015 20:58 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
kropniczki wrote on Thu, 15 January 2015 19:06
Hi, Mirek, tks for your help, it's weird indeed, I've run a number of tests on both of my systems and here's my feedback on some of the points you raised:

Quote:
What is your OS exactly? Compiler?

Windows 7 - MSC9 and Windows 8.1 - MSC9 and MSC10

Quote:
As first quick test, does DnD of text to theide work for you?

No, it doesn't work in Win 8.1, but it does work in Win 7.

Quote:
Alternatively, you can test with examples/UWord, with Image.

Did that, pls review code posted below, which I used to run tests, along with attached table pics summarizing results:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyApp : TopWindow {
	virtual void CancelMode();
	virtual void Paint(Draw& w);
	virtual void DragAndDrop(Point p, PasteClip& d);
	virtual void DragLeave();

	Image img;
	String txt;
	bool  dnd;
	
	MyApp() { dnd = false; }
};

void MyApp::Paint(Draw& w)
{
	Size sz = GetSize();
	w.DrawRect(sz, dnd ? SColorInfo() : SColorFace());
	w.DrawImage(0, 0, img);
	w.DrawText(10, 10, txt);
}

void MyApp::DragAndDrop(Point p, PasteClip& d)
{
	LOG("DragAndDrop");
	if(AcceptImage(d)) {
		img = GetImage(d);
		txt = "";
	} else if(AcceptText(d)) {
		txt = GetString(d);
		img.Clear();
	}
	dnd = d.IsAccepted();
	Refresh();
}

void MyApp::DragLeave()
{
	LOG("DragLeave");
	CancelMode();
}

void MyApp::CancelMode()
{
	LOG("CancelMode");
	dnd = false;
	Refresh();
}

GUI_APP_MAIN
{
	MyApp().Run();
}

index.php?t=getfile&id=4706&private=0

index.php?t=getfile&id=4707&private=0

Could these erratic results be due to non-standardized Windows DnD obj formatting from one version to another?
Tks!




I would not read too much into File Explorer source - these are expected - UWord expects (now) that you are dropping qtf formated files, which these images are not.... (of course, would be nice to automatically open images too...)

Have you tried with U++ apps as source? (E.g. UWord->MSWord)

Another: please try e.g. Firefox or Chrome as source of images.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Context Menu request
Next Topic: rounding to decimals implementation
Goto Forum:
  


Current Time: Thu May 16 11:00:44 CEST 2024

Total time taken to generate the page: 0.01933 seconds