[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Where's 'wxDataFormat("Link")' implemented?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Where's 'wxDataFormat("Link")' implemented? |
Date: |
Sat, 23 Feb 2008 15:15:34 +0000 |
User-agent: |
Thunderbird 2.0.0.9 (Windows/20071031) |
On 2008-02-23 14:17Z, Vadim Zeitlin wrote:
> On Sat, 23 Feb 2008 12:29:16 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> Usually I can find anything in wx quite easily, but I haven't
> GC> been able to find where the "Link" data format is implemented:
>
> It's not implemented anywhere in wxMSW sources because it's just a custom
> format used by Excel and other Microsoft applications (and hence ubiquitous
> enough to make it a de facto standard). We could support it, of course, as
> this would be both useful and not especially difficult (see the description
> in the paragraph entitled "Initiating a Data Link with the Paste Link
> Command" at http://msdn2.microsoft.com/en-us/library/ms648775(VS.85).aspx).
> However as often the question is whether other systems (Unix, Mac...) have
> anything similar. If they don't, or at least until we find about how they
> handle this, it would probably be better to keep the code dealing with this
> format in LMI itself.
Ah. I had thought "Link" was some specialized format that
would require support code in wx. But it's really just a
bit of generic glue that binds three strings together to
represent DDE via the msw clipboard. And in 'main_wx.cpp',
Skeleton::UponPaste() isn't using anything like the full
capabilities of DDE; it's just saying
- if data looks like DDE (because it has "Link" data),
- then read the clipboard as wxDF_TEXT (and invoke some
special '\r' reformatting inside lmi)
So this is more generic and less msw-specific than I had
imagined.
And, I hypothesize, it would actually be an improvement
to ignore the "Link" stuff and do the '\r' reformatting
unconditionally. Here's why:
- open ms 'excel'; enter a column of data; copy it
- paste it into lmi
It's reformatted when it's pasted. But now...
- close ms 'excel'
- paste into lmi again
Now it's not reformatted. E.g., "X\rY\rZ\r" is pasted as
the single character "X". I guess closing the spreadsheet
ended the DDE conversation and removed the "Link" format
from the clipboard, leaving only the text there. A user
could be puzzled by that, so I think I'll just simplify
the paste handler to do the '\r' reformatting always.