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 #44173 is a reply to message #44171] Thu, 15 January 2015 19:06 Go to previous messageGo to previous message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
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!


  • Attachment: table1.png
    (Size: 37.62KB, Downloaded 812 times)
  • Attachment: table2.png
    (Size: 38.76KB, Downloaded 733 times)
 
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 Oct 31 23:52:14 CET 2024

Total time taken to generate the page: 0.02806 seconds