Can you drag and drop a Windows file into a Draw Widget? [message #26376] |
Tue, 04 September 2001 08:19  |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
It would be nice if I could drag an image file from Windows explorer
and drop it into a Draw Widget and have it display automatically.
I've looked around a bit and doubt this is possible, but thought I'd
ask first before I gave up on the idea. Can IDL capture the name of a
file dropped into a display window?
Thanks,
Steve Hartmann
|
|
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26904 is a reply to message #26376] |
Tue, 02 October 2001 12:45   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Richard Younger (younger@ll.mit.edu) writes:
> Hopefully one of these days, I'll actually know what I'm talking about.
Uh, right. But don't let that stop you from
posting more articles. :-)
Cheers,
David
P.S. Let's just say hitting that Send button
has been know to result in great insight into IDL
programming. (In addition to great humility, of
course, but that goes without saying. We all wish
the cause and effect was the other way around, but
alas, it ain't so.)
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26906 is a reply to message #26376] |
Tue, 02 October 2001 12:13   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Richard Younger (younger@ll.mit.edu) writes:
> *mumble* *mumble* ... Liam's recent post ... *mumble* IDL 5.5 *mumble
> mumble* ... http://www.rsinc.com/newsletter/#IDLCS ... *mumble mumble*
> ... ActiveX container ... *mumble* ... might be able to do what you want
> ... *mumble* ... don't really know ... *mumble* ... sounds promising.
Oh, I agree, these things always *sound* promising.
ION and Active X components via the IDL draw widget
sounded promising, too. But in practice, alas, they
are often less promising than one would have hoped.
But, then again, some of us are eternal optimists. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26911 is a reply to message #26376] |
Tue, 02 October 2001 10:08   |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
>> Thanks for the answer. I appreciate it.
>
> I just hope the answer is right. No one likes to
> answer that something is "impossible" because,
> inevitably, that kind of answer encourages the
> folks with time on their hands and almost before
> you can get back to your desk with the fresh coffee
> someone has figured out a way to do it. :-(
>
> But no one has ever said I'm not willing to make
> a fool of myself, so there you go.
>
> Cheers,
>
> David
Well then I'm glad you say it can't be done. My experience with this
newsgroup the last several years is that whenever you (dwf) say
something can't be done, it often gets done by one of the other stars.
Often, as in this case, that works out great for me. As I can always
(and do) browse for an image file, it would be neat to just drag and
drop into a window.
Thanks again,
Steve
|
|
|
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26933 is a reply to message #26376] |
Thu, 04 October 2001 08:27   |
Richard Younger
Messages: 43 Registered: November 2000
|
Member |
|
|
Peter Mason wrote:
>
> Duty calls.
> In a renewed attempt to maintain my reputation of d.o.d.c, I hereby
> post my nomination for "daddy's job of the year". Personally, I
> think it makes J.D.'s text-widget subterfuge (of a couple of years
> back) look as much a part of IDL as, say, a piston looks like a part
> of an internal combustion engine. I'm particularly proud of my
> method of getting "HWND"s for IDL widgets and challenge anyone to beat
> it on the grounds of "ultra-risky platform-specific code that's sure
> to break one day".
>
> Cheers
> Peter Mason
> CSIRO DEM MMTG
> mailto://peter.mason@csiro.au
I'm impressed.
There aren't many good windows programmers who are regular posters, so
it's good to see one chime in.
David was right, there isn't a way to do it in IDL. The solution isn't
really an IDL solution at all, but subclasses ... er, excuse me,
politely hijacks ... the IDL Widget window on an OS level (it's polite
because it gives the window back). I had to spend a little quality time
with my Big Thick Windows Programming(tm) book to figure out what was
going on.
Thanks for the solution and the interesting code!
Back to what I should be doing.
Best,
Rich
--
Richard Younger
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26940 is a reply to message #26376] |
Wed, 03 October 2001 19:57   |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
On 3 Oct 2001 17:26:13 -0700, peter.mason@csiro.au (Peter Mason)
wrote:
> Duty calls.
> In a renewed attempt to maintain my reputation of d.o.d.c, I hereby
> post my nomination for "daddy's job of the year". Personally, I
> think it makes J.D.'s text-widget subterfuge (of a couple of years
> back) look as much a part of IDL as, say, a piston looks like a part
> of an internal combustion engine. I'm particularly proud of my
> method of getting "HWND"s for IDL widgets and challenge anyone to beat
> it on the grounds of "ultra-risky platform-specific code that's sure
> to break one day".
>
> Anyway, it works. Or to be precise, it worked today on my PC running
> IDL 5.4 on WinNT4 SP 6.
> It can be had via anonymous FTP:
> Server: ftp.syd.dem.csiro.au
> File: dropfile.zip
> You won't be able to get a directory listing of this server. If you
> want a copy of this thing and the FTP doesn't work for you then email
> me and I'll send it to you.
>
> Cheers
> Peter Mason
> CSIRO DEM MMTG
> mailto://peter.mason@csiro.au
>
>
Very nice! It works on my Win2k machine as well. Thanks alot - I think
this will be very handy. I'm glad I re-posted the question.
I knew that someone on this group *could* do this, and I'm greatful
that you actually *did* do it.
Thanks,
-Steve
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #26947 is a reply to message #26912] |
Wed, 03 October 2001 17:26   |
peter.mason
Messages: 4 Registered: October 2001
|
Junior Member |
|
|
Duty calls.
In a renewed attempt to maintain my reputation of d.o.d.c, I hereby
post my nomination for "daddy's job of the year". Personally, I
think it makes J.D.'s text-widget subterfuge (of a couple of years
back) look as much a part of IDL as, say, a piston looks like a part
of an internal combustion engine. I'm particularly proud of my
method of getting "HWND"s for IDL widgets and challenge anyone to beat
it on the grounds of "ultra-risky platform-specific code that's sure
to break one day".
Anyway, it works. Or to be precise, it worked today on my PC running
IDL 5.4 on WinNT4 SP 6.
It can be had via anonymous FTP:
Server: ftp.syd.dem.csiro.au
File: dropfile.zip
You won't be able to get a directory listing of this server. If you
want a copy of this thing and the FTP doesn't work for you then email
me and I'll send it to you.
Cheers
Peter Mason
CSIRO DEM MMTG
mailto://peter.mason@csiro.au
David Fanning <david@dfanning.com> wrote in message news:<MPG.16239cb2159420379896e2@news.frii.com>...
> Steve Hartmann (s.l.h@badspam.home.com) writes:
>
>> Thanks for the answer. I appreciate it.
>
> I just hope the answer is right. No one likes to
> answer that something is "impossible" because,
> inevitably, that kind of answer encourages the
> folks with time on their hands and almost before
> you can get back to your desk with the fresh coffee
> someone has figured out a way to do it. :-(
>
> But no one has ever said I'm not willing to make
> a fool of myself, so there you go.
>
> Cheers,
>
> David
|
|
|
Re: Can you drag and drop a Windows file into a Draw Widget? [message #27067 is a reply to message #26940] |
Thu, 04 October 2001 16:11  |
peter.mason
Messages: 4 Registered: October 2001
|
Junior Member |
|
|
Steve Hartmann <s.l.h@badspam.home.com> wrote in message news:<qMy7OzIFFyK8iM2YsV9wosPVF5oc@4ax.com>...
>
> Very nice! It works on my Win2k machine as well. Thanks alot - I think
> this will be very handy. I'm glad I re-posted the question.
>
> I knew that someone on this group *could* do this, and I'm greatful
> that you actually *did* do it.
>
> Thanks,
> -Steve
I'm glad that you found it useful. It's sort-of cringeworthy,
though, isn't it?
Once again I under-estimated the power of the "send" button and
yesterday, after posting, I began to worry about how hard-coded
"dropfile" is. I have since opened it up a bit so that it can be
used on something more complicated than the simplest base+draw_widget
program. The update's on "my" FTP server.
My apologies to those who tried to access the FTP server and couldn't
- I think there's still some kind of security block on the thing. It
would probably be best to email me if you want the program.
Cheers
Peter Mason
mailto://peter.mason@csiro.au
|
|
|