comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Creating Panels in iTools
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Creating Panels in iTools [message #46472] Wed, 23 November 2005 09:22
David Alexander is currently offline  David Alexander
Messages: 26
Registered: August 2005
Junior Member
James,

When you create and register your own UI panel the default is to always
put it on the right, as you've seen. The location of the UI panel is
specified by the ORIENTATION keyword to CW_ITPANEL. If you set this
keyword to 0, it will place the panel on the left.

There are two ways to use panels:

1) The simple method: Just register your panel according to the docs,
and your panel shows up in the GUI (on the right). You're probably
doing it this way now.

2) The complex method: Implement your own GUI code for the iTool
interface, and specify that you want the panel on the left (with the
ORIENTATION keyword described above). Here's the deal: The default
appearance of an itool GUI is defined in the IDLitWdTool.pro routine,
which is used by all the standard RSI iTools. If you want to change the
elements or appearance of your own iTool, you have to implement your
own version of this file. This is where you would call CW_ITPANEL and
set the ORIENTATION keyword. This is explained in the section "Creating
a Custom iTools Widget Interface" in the iTool Developer's Guide.

For the mouse-click events in your panel, you'll handle mouse events on
your draw widgets like you would in any widget application (ie, use the
BUTTON_EVENTS keyword when creating your draw widget, and implement an
event handler). You'll probably need to save a reference to the tool
object and any other objects you might need in the state structure of
your panel widget. Probably the easist thing to do is to store all the
image data in the itools data manager, then when the user clicks on a
thumbnail detemine which thumbnail they clicked, then get the image
data for that image from the data manager and replace the data in the
image visualization with the new data.

If that doesn't make sense, let me know, I can go into more detail.

Dave
Re: Creating Panels in iTools [message #46476 is a reply to message #46472] Wed, 23 November 2005 07:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Richard G. French writes:

> Is this the same course in which you developed the pixmap object? Sounds
> like some course. Tell us more about it. I tried google on
>
> "David and the Dancing IDL Masters (to be)"
>
> All I got was the usual IDL admonition "Try more general keywords". What did
> I do wrong? I need this for a homework assignment due yesterday.

You have to come up with something pretty spectacular to
get astronomers to give up command line IDL programs with
15-20 positional parameters. (Something about "looking back
in time" and keywords only being invented in the past 50
years or something. I didn't really understand the arguments.)
So I hit on this idea of "smart" image objects that know
how to display themselves, set up their own coordinate systems
for data overlay, let you know if you clicked inside them, etc.
Surely that would interest an astronomer.

So, next thing you know, these images could make thumbnails
of themselves, and clone themselves, and do all manner of
neat and useful things, and these programs we were writing
just sort of took off on their own. I have to admit they
were as sophisticated as any I have ever written in an IDL
course. So much so, that I have really given some thought
the past couple of days to writing this all down and
making a book out of it.

Sometimes IDL just plain surprises you with how easy it
can be to do sophisticated things! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Creating Panels in iTools [message #46478 is a reply to message #46476] Wed, 23 November 2005 05:39 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
On 11/23/05 12:09 AM, in article MPG.1deda75b3d8370ae989aaf@news.frii.com,
"David Fanning" <davidf@dfanning.com> wrote:

> I can't help you with the iTool part, but this is *exactly*
> the program we wrote in the IDL course I taught last week.

Is this the same course in which you developed the pixmap object? Sounds
like some course. Tell us more about it. I tried google on

"David and the Dancing IDL Masters (to be)"

All I got was the usual IDL admonition "Try more general keywords". What did
I do wrong? I need this for a homework assignment due yesterday.

Dick French
Re: Creating Panels in iTools [message #46487 is a reply to message #46478] Tue, 22 November 2005 21:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
James Everton writes:

> In my panel, I have a series of draw widgets that are
> essentially thumbnails that I would like the user to be able to click
> on. However, I'm having trouble understanding how I can register a
> mouse-click on one of the thumbnails, and then how I can then replace
> the image in the main window with a blown up version of the thumbnail.

I can't help you with the iTool part, but this is *exactly*
the program we wrote in the IDL course I taught last week. We used
direct graphic image objects, but we just stuffed one of these
in the UValue of each draw widget. When we clicked on the draw
widget, we made a clone of that image object and placed that
in the large display image object in the main display draw widget.
But I don't have the foggiest idea of how to register a mouse click.
Sorry.


>> From some of your previous postings, I can tell that not many of you
> can stand iTools.

No, no. You completely misunderstand. We love iTools. We just
can't figure out how they work. And some of us, apparently,
are too damn old to learn. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Creating Panels in iTools [message #46489 is a reply to message #46487] Tue, 22 November 2005 18:02 Go to previous message
Robert Barnett is currently offline  Robert Barnett
Messages: 70
Registered: May 2004
Member
How can there be any image processing functions which are available in
iTools but not available in the generic IDL language? That seems to be
very odd to me. Surely you could just copy the iTools code for the
fantastic filtering function you like and paste it into your own GUI.

I don't think that iTools is really useful for creating completely new
user interfaces. Itools is excellent if you have a filter or some
generic function which you want to embed into the iTools UI but
anything beyond that, and the complexity seems to spin totally out of
control.

If you *have* to extend iTools for creating a new user interface then I
would recommend embedding an iTools Window into a separate widget
program. Present your tumbnails in a widget draw which is outside the
iTools context (and actually on the left hand side!). There is an
example of embeding iTools by Adam O'Connor (in the RSI codebank under
My_iTools_Program.zip).

For your application, when the user clicks on the widget draw
containing the thumbnails it will trigger and ordinary everyday event
callback. You can programatically control your iTool from within this
callback. In this case you might want to set the data in the iTools
window to match the contents of the selected tumbnail.

I've been in a similar situation when developing a GUI for use in
medical imaging. Most of my applications consist of a workflow which
the end user is supposed to follow step by step. For example:
1. Window image
2. Select begining and final image
3. Check intermediate image
4. Draw ROI on intermediate image
5. Check statistical results

ITools provides a way of throwing this at the user "all at once". This
is great, however, it adds copious complexity for both the programmer
and the end-user. If your end users are likely to require all such
features at once I guess you're in for a lot of fun, but if they won't
notice a thing then why bother?

James Everton wrote:
> Hello all,
> This is my first post using google groups, but I have found that a lot
> of your replies to other topics are extremely helpful and well thought
> out. So, I would like to pre-emptively thank you for at least reading
> this.
>
> Here is my situation right now:
> I recently started interning at a company that handles satellite
> imagery, and I have been given the job to create user interfaces (using
> iTools) that read in and output the images. In the last month, I've
> started learning IDL and the iTools libraries, so I am a bit of a
> beginner to all this, but I've been able to create a basic interface
> that does some of what I want. Unfortunately, I've having a little
> problem trying to create a UI panel.
> First of all, I'm able to make a simple panel, but I have not been able
> to find any help on how to relocate the panel. At the moment, it
> automatically shows up on the right side of the window with the "image"
> panel I need, but I would like to place it on the left side.
> Secondly, I'm having a little trouble with the event handling within
> the panel. In my panel, I have a series of draw widgets that are
> essentially thumbnails that I would like the user to be able to click
> on. However, I'm having trouble understanding how I can register a
> mouse-click on one of the thumbnails, and then how I can then replace
> the image in the main window with a blown up version of the thumbnail.
>
>> From some of your previous postings, I can tell that not many of you
> can stand iTools. It seems like there are a lot of better languages I
> could use to create this, but I need the image processing functions in
> iTools for later use.
>
> Thank you very much for any help you can give me.
> Sincerely,
> James Everton
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Assignment Time for a 3d Variable
Next Topic: Re: Assignment Time for a 3d Variable

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:44:30 PDT 2025

Total time taken to generate the page: 0.00523 seconds