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
Image DnD into Upp app [message #44168] Wed, 14 January 2015 15:28 Go to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Hi, there!

I need to drag an image file from a Windows non-Upp app (say, File Explorer, for one) and drop/show it on a StaticImage Ctrl. Is there a Upp way of doing this? How, pls?

tks!

[Updated on: Wed, 14 January 2015 15:40]

Report message to a moderator

Re: Image DnD into Upp app [message #44169 is a reply to message #44168] Wed, 14 January 2015 19:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
#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;
	bool  dnd;
	
	MyApp() { dnd = false; }
};

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

void MyApp::DragAndDrop(Point p, PasteClip& d)
{
	if(AcceptImage(d))
		img = GetImage(d);
	dnd = d.IsAccepted();
	Refresh();
}

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

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

GUI_APP_MAIN
{
	MyApp().Run();
}
Re: Image DnD into Upp app [message #44170 is a reply to message #44169] Wed, 14 January 2015 22:09 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Thank you for the code, Mirek, but I'm afraid it doesn't work. BTW, before I posted this topic I've tried something quite close to what you suggest, based on what I could learn from the IDE help and reference code, but it failed too.
I've inserted some LOGs in your code to see if any of the DnD-related virtual methods ever get called, which they don't, with the exception of CancelMode(), but obviously for other non-DnD reasons:

#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;
	bool  dnd;
	
	MyApp() { dnd = false; }
};

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

void MyApp::DragAndDrop(Point p, PasteClip& d)
{
	LOG("DragAndDrop");              // this never gets called
	if(AcceptImage(d))
		img = GetImage(d);
	dnd = d.IsAccepted();
	Refresh();
}

void MyApp::DragLeave()
{
	LOG("DragLeave");                // this never gets called
	CancelMode();
}

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

GUI_APP_MAIN
{
	MyApp().Run();
}


Aren't we missing something? There's something I do not quite fully understand here, I mean, how is our code supposed to acknowledge it should accept DnD data from other non-Upp Windows processes? Doesn't Windows require us to somehow register our Upp process as potential target of DnD events?

Thanks again!

Re: Image DnD into Upp app [message #44171 is a reply to message #44170] Thu, 15 January 2015 08:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Now that is really weird. Of course, I have tested my code before posting here (with Win8 and now Win7).

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

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

What is your OS exactly? Compiler?

As for your question, U++ does all that for you. All you need to do is to call "Accept" for format that you, ehm, accept...

Mirek
Re: Image DnD into Upp app [message #44172 is a reply to message #44170] Thu, 15 January 2015 08:51 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello kropniczki
Quote:
Aren't we missing something? There's something I do not quite fully understand here, I mean, how is our code supposed to acknowledge it should accept DnD data from other non-Upp Windows processes? Doesn't Windows require us to somehow register our Upp process as potential target of DnD events?

I copy and paste daily data as formatted texts and tables from/to U++/Microsoft applications without problems so I imagine your problem is very specific to images in some particular situation.


Best regards
Iñaki
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 next 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 758 times)
  • Attachment: table2.png
    (Size: 38.76KB, Downloaded 667 times)
Re: Image DnD into Upp app [message #44174 is a reply to message #44172] Thu, 15 January 2015 19:17 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
koldo wrote on Thu, 15 January 2015 02:51
Hello kropniczki
Quote:
Aren't we missing something? There's something I do not quite fully understand here, I mean, how is our code supposed to acknowledge it should accept DnD data from other non-Upp Windows processes? Doesn't Windows require us to somehow register our Upp process as potential target of DnD events?

I copy and paste daily data as formatted texts and tables from/to U++/Microsoft applications without problems so I imagine your problem is very specific to images in some particular situation.


Hi, Koldo!
Good for you and all other users who may not be facing the same issues, and I hope you're right about it being something specific to my situation. Nevertheless, please observe that I performed tests on two different Windows OS configurations and got mixed results as you can see in the reply I posted on Mirek's response in this topic.

Appreciate your concerns, tks!
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 next message
mirek is currently offline  mirek
Messages: 13975
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
Re: Image DnD into Upp app [message #44176 is a reply to message #44175] Thu, 15 January 2015 21:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Also please try this logging:

STDMETHODIMP UDropTarget::DragEnter(LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
	GuiLock __;
	LLOG("DragEnter " << pt);
	data = pDataObj;
	data->AddRef();
	fmt.Clear();
	IEnumFORMATETC *fe;
	if(!ctrl || pDataObj->EnumFormatEtc(DATADIR_GET, &fe) != NOERROR) {
		*pdwEffect = DROPEFFECT_NONE;
		return NOERROR;
	}
	FORMATETC fmtetc;
	while(fe->Next(1, &fmtetc, 0) == S_OK) {
		fmt.FindAdd(FromWin32CF(fmtetc.cfFormat));
		if(fmtetc.ptd)
			CoTaskMemFree(fmtetc.ptd);
	}
	fe->Release();
DUMP(fmt)
	DnD(pt, false, pdwEffect, grfKeyState);
	return NOERROR;
}


That should show formats available.

Actually, from table you have posted, only MS Word -> theide/UWord make me really worried... Note that UWord does not support gif (forgot to add plugin/gif) and bmp format is tricky...
Re: Image DnD into Upp app [message #44177 is a reply to message #44175] Thu, 15 January 2015 23:26 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Quote:
Have you tried with U++ apps as source? (E.g. UWord->MSWord)

Don't recall any Upp app example that exposes imgs to DnD operations for now, so I limited my tests just to texts.
Quote:
Actually, from table you have posted, only MS Word -> theide/UWord make me really worried...

Win8.1 - MSC10:
---------------
TEXT: UWord -> MSWord = ok.
TEXT: MSWord -> TheIDE = failed.
TEXT: MSWord -> UWord = failed, format DUMP:
* C:\upp\out\examples\MSC10.Debug.Debug_Full.Gui.Mt\UWord.exe 15.01.2015 18:19:00, user: admin

fmt = [text/QTF, Rich Text Format, text/rtf, application/rtf, wtext, text]
data = Memory at 03A71D38, size 0x10B = 267
    +0 0x03A71D38 7B 5C 72 74 66 31 5C 61 6E 73 69 5C 61 6E 73 69     {\rtf1\ansi\ansi
   +16 0x03A71D48 63 70 67 31 32 35 32 5C 64 65 66 66 30 7B 5C 66     cpg1252\deff0{\f
   +32 0x03A71D58 6F 6E 74 74 62 6C 7B 5C 66 30 5C 66 73 77 69 73     onttbl{\f0\fswis
   +48 0x03A71D68 73 5C 66 63 68 61 72 73 65 74 30 20 41 72 69 61     s\fcharset0 Aria
   +64 0x03A71D78 6C 3B 7D 7B 5C 66 31 5C 66 74 65 63 68 5C 66 63     l;}{\f1\ftech\fc
   +80 0x03A71D88 68 61 72 73 65 74 32 20 53 79 6D 62 6F 6C 3B 7D     harset2 Symbol;}
   +96 0x03A71D98 7B 5C 66 32 5C 66 63 68 61 72 73 65 74 30 20 57     {\f2\fcharset0 W
  +112 0x03A71DA8 69 6E 67 64 69 6E 67 73 3B 7D 7D 7B 5C 73 74 79     ingdings;}}{\sty
  +128 0x03A71DB8 6C 65 73 68 65 65 74 7B 5C 73 30 5C 73 62 61 73     lesheet{\s0\sbas
  +144 0x03A71DC8 65 64 6F 6E 32 32 32 20 44 65 66 61 75 6C 74 3B     edon222 Default;
  +160 0x03A71DD8 7D 7D 5C 70 61 70 65 72 77 31 31 39 30 34 5C 70     }}\paperw11904\p
  +176 0x03A71DE8 61 70 65 72 68 31 36 38 33 36 5C 6D 61 72 67 6C     aperh16836\margl
  +192 0x03A71DF8 31 31 33 33 5C 6D 61 72 67 72 31 31 33 33 5C 6D     1133\margr1133\m
  +208 0x03A71E08 61 72 67 74 31 31 33 33 5C 6D 61 72 67 62 31 31     argt1133\margb11
  +224 0x03A71E18 33 33 5C 73 30 5C 70 61 72 64 5C 66 73 32 34 5C     33\s0\pard\fs24\
  +240 0x03A71E28 6C 61 6E 67 31 30 33 33 20 66 6B 6A 66 5C 75 32     lang1033 fkjf\u2
  +256 0x03A71E38 33 31 3F 68 75 69 6F 71 72 75 7D                    31?huioqru}     

Windows 7 - MSC9:
-----------------
TEXT: UWord -> MSWord = ok.
TEXT: MSWord -> TheIDE = ok.
TEXT: MSWord -> UWord = ok.

Quote:

Note that UWord does not support gif (forgot to add plugin/gif) and bmp format is tricky...

As to what imgs are concerned, I'll be trying just jpeg's though.
Quote:

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

Windows 8.1 - MSC10:
--------------------
JPG: Firefox -> UWord = failed, no DUMP generated.
JPG: MSWord -> UWord = failed, no DUMP generated.

Windows 7 - MSC9:
-----------------
JPG: Firefox -> UWord = ok, DUMP:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 15.01.2015 19:00:32, user: admin

fmt = [text/x-moz-url, FileGroupDescriptor, FileGroupDescriptorW, FileContents, UniformResourceLocator, UniformResourceLocatorW, text/x-moz-url-data, text/x-moz-url-desc, text/uri-list, text/_moz_htmlcontext, text/_moz_htmlinfo, text/html, HTML Format, wtext, text, application/x-moz-nativeimage, ¤"_þ@ 0ó, dib, files, Preferred DropEffect, application/x-moz-file-promise-url, application/x-moz-file-promise-dest-filename, DragImageBits, DragContext]


JPG: MSWord -> UWord = failed, drops just blank image frame, DUMP:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 15.01.2015 19:04:35, user: admin

fmt = [Woozle, Object Descriptor, Rich Text Format, HTML Format, text, wtext, "Šü`û0ó, Embed Source]
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1046\deflangfe1046\themelang1046\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}.................TO LONG TO INCLUDE IN THIS MESSAGE...........


Hope it helps!
tks!
Re: Image DnD into Upp app [message #44178 is a reply to message #44177] Fri, 16 January 2015 09:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Another thing to try: Instead of DnD, please use clipboard (Copy, Paste). It is using the same file formats, will tell us whether it is file format issue or something else...

Mirek
Re: Image DnD into Upp app [message #44179 is a reply to message #44178] Fri, 16 January 2015 21:41 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Here are my test results for now, pls observe we got no issues whatsoever related to any copy/paste operations, whereas mixed results were obtained for DnD.

Windows 7 - MSC9:

Copy(JPG, MSWord) -> Paste(UWord) == ok, no DUMP created
Drag(JPG, MSWord) -> Drop(UWord) == failed, DUMP:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 16.01.2015 16:48:58, user: admin
fmt = [Art::GVML ClipFormat, n0, PNG, JFIF, GIF, yi, Object Descriptor]

Copy(TEXT, MSWord) -> Paste(UWord) == ok, big DUMP
Drag(TEXT, MSWord) -> Drop(UWord) == ok, big DUMP

Copy(JPG, Firefox) -> Paste(UWord) == ok, no DUMP generated.
Drag(JPG, Firefox) -> Drop(UWord) == ok, DUMP:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 16.01.2015 16:58:39, user: admin
fmt = [text/x-moz-url, FileGroupDescriptor, FileGroupDescriptorW, FileContents, UniformResourceLocator, UniformResourceLocatorW, text/x-moz-url-data, text/x-moz-url-desc, text/uri-list, text/_moz_htmlcontext, text/_moz_htmlinfo, text/html, HTML Format, wtext, text, application/x-moz-nativeimage, ds_@0, dib, files, Preferred DropEffect, application/x-moz-file-promise-url, application/x-moz-file-promise-dest-filename, DragImageBits, DragContext]

Copy(TEXT, Firefox) -> Paste(UWord) == ok, no DUMP generated.
Drag(TEXT, Firefox) -> Drop(UWord) == ok, DUMP:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 16.01.2015 17:08:36, user: admin
fmt = [text/_moz_htmlcontext, text/_moz_htmlinfo, text/html, HTML Format, wtext, text, DragImageBits, DragContext]

------------------------------------------------------------ ---------------------------------------------

Windows 8.1 - MSC9:

Copy(TEXT, MSWord) -> Paste(UWord) == ok, big DUMP.
Drag(TEXT, MSWord) -> Drop(UWord) == failed, no DUMP generated.

Copy(JPG, MSWord) -> Paste(UWord) == ok, no DUMP generated.
Drag(JPG, MSWord) -> Drop(UWord) == failed, no DUMP generated.

Copy(TEXT, Firefox) -> Paste(UWord) == ok, no DUMP generated.
Drag(TEXT, Firefox) -> Drop(UWord) == failed, no DUMP generated.

Copy(JPG, Firefox) -> Paste(UWord) == ok, no DUMP generated.
Drag(JPG, Firefox) -> Drop(UWord) == failed, no Dump Generated.

tks.
Re: Image DnD into Upp app [message #44180 is a reply to message #44177] Sat, 17 January 2015 16:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
As for JPG: MSWord -> UWord, from the log you have posted, it looks like the problem is that MSWord actually presents it as text (rich text) and our RTF parser does not understand JPG in RTF. I am adding RM issue to add JPG support in ParseRTF....

So it looks like copy/paste is mostly working, but DnD is not.

For now, let us concentrate just on MS Word text -> UWord in Windows 8.1. Could you please activate general logging in Win32DnD.cpp at the start of file:

#define LLOG(x) LOG(x)

(uncomment // LOG(x))

try dragging text to UWord, post result here?

Mirek
Re: Image DnD into Upp app [message #44181 is a reply to message #44180] Sat, 17 January 2015 18:10 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
mirek wrote on Sat, 17 January 2015 10:19


For now, let us concentrate just on MS Word text -> UWord in Windows 8.1. Could you please activate general logging in Win32DnD.cpp at the start of file:

#define LLOG(x) LOG(x)

(uncomment // LOG(x))

try dragging text to UWord, post result here?

Mirek


Did that, all attempts failed and no log ever gets created when dragging text from MS Word into UWord in Win 8.1.

Eddy.
Re: Image DnD into Upp app [message #44182 is a reply to message #44181] Sun, 18 January 2015 09:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Just found this:

http://www.eightforums.com/general-support/15434-drag-drop-p roblem.html

Any chances you are running theide (and AFAIK the program you launch from theide) in admin mode or something?

The pattern you show indicates right that: you can DnD between theide and uword (I supposed you started it from theide), but not between external application and theide/uword...

Might be interesting to start uword from shell, not theide...

Mirek
Re: Image DnD into Upp app [message #44183 is a reply to message #44182] Sun, 18 January 2015 11:44 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Bingo! Absolutely correct! Text DnD from MS Word to UWord works perfectly in Win8.1 when UWord starts from shell, just as you pointed out. Great!

Yet, although image copy/paste works like a charm for both, Win 8.1 and 7, can't DnD JPG from MS Word to Uword still. Dump shows:
WIN8.1 - MSC9:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui.Mt\UWord.exe 18.01.2015 07:12:54, user: admin
fmt = [Art::GVML ClipFormat, ˜íSü@
®Ìï, PNG, JFIF, GIF, ,ÿ¯ûàRÌï, Object Descriptor]

WIN 7 - MSC9:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 18.01.2015 07:21:41, user: admin
fmt = [Woozle, Object Descriptor, Rich Text Format, HTML Format, text, wtext, F...ùü 0ó, Embed Source]
{\rtf1\ad...

... FOLLOWS EXTENSIVE TEXT APPARENTLY ON FONT/TEXT FORMATTING PARAMETERS .....
... FOLLOWED BY WHAT I GUESS TO BE ABOUT PICTURE FORMATTING:

{\*\shppict
{\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fRotateText}{\sv 1}}{\sp{\sn pictureGray}{\sv 0}}{\sp{\sn pictureBiLevel}{\sv 0}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fNoFillHitTest}{\sv 0}}
{\sp{\sn fLine}{\sv 0}}{\sp{\sn wzName}{\sv Imagem 4}}{\sp{\sn fHidden}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex99\picscaley100\piccropl0\piccropr0\piccropt0\ piccropb0
\picw1194\pich1372\picwgoal677\pichgoal778\pngblip\bliptag21 44142166{\*\blipuid 7fcd0
... IMAGE HEX DATA ...
6082}}{\nonshppict
{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccrop t0\piccropb0\picw1194\pich1372\picwgoal677\pichgoal778\wmeta file8\bliptag2144142166\blipupi99{\*\blipuid 7fcd035608425ad3a4e38021e206889b}... MORE HEX DATA ...
... EOF

Note: Windows-7 UWord shows just a blank image frame after dropping operation.

Thank you!
Re: Image DnD into Upp app [message #44185 is a reply to message #44168] Sun, 18 January 2015 11:56 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Win7 MSWord -> UWord JGP DnD now dumps
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui\UWord.exe 18.01.2015 07:52:02, user: admin
fmt = [Art::GVML ClipFormat, ÜŒkýÀ"0ó, PNG, JFIF, GIF, 0'ü Ø0ó, Object Descriptor]
,instead of very extensive file (?!)

tks.
Re: Image DnD into Upp app [message #44186 is a reply to message #44185] Mon, 19 January 2015 11:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, the rest appears to be format issue.

I do not have MS Word to test, so I would like to ask for more data:

bool   PasteClip::Accept(const char *_fmt)
{
	Vector<String> f = Split(_fmt, ';');
	for(int i = 0; i < f.GetCount(); i++) {
		if(IsAccepted() && fmt == f[i])
			return paste;
		if(IsAvailable(f[i])) {
			accepted = true;
			if(paste) {
				fmt = f[i];
				DDUMP(fmt); // NEW
				data = Get(f[i]);
				SaveFile(GetHomeDirFile("data.bin"), data); // NEW, Set appropriate path here....
				return true;
			}
			break;
		}
	}
	return false;
}


then D&D JPG from MSWORD->UWORD, post format here and zipped data.bin...

Mirek
Re: Image DnD into Upp app [message #44187 is a reply to message #44186] Mon, 19 January 2015 19:59 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Mirek,

Attached files data.bin and UWord.log as requested.
Pls note that these files regard results of tests done on Win7 only. Same test does not create any log or bin file in Win8.1; checked variable 'fmt' in for-loop and it is always empty; execution never goes into scope of if(IsAvailable(fmt[i])).

Thank you!

  • Attachment: Downloads.zip
    (Size: 54.16KB, Downloaded 223 times)
Re: Image DnD into Upp app [message #44189 is a reply to message #44187] Tue, 20 January 2015 14:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks. I have fixed ParserRTF, so it is now able to load that data correctly.

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


Current Time: Tue Apr 16 21:43:13 CEST 2024

Total time taken to generate the page: 0.01384 seconds