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

Home » Public Forums » archive » Re: Resizing UI?
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: Resizing UI? [message #29625] Mon, 04 March 2002 07:16
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
B.C. Hamans (s448443@stud.tue.nl) writes:

> I am trying to code an (medical?) image viewer in IDL. The UI should consist
> of either 3 or 9 draw widgets. In other words the x,y,z projections or
> slices of a reference and float image.
> The UI would look a bit like the ascii representation below:
> ________________
> |[taskbar ]|
> |[1] [2] [3] [Controls]|
> |[4] [5] [6] [ ]|
> |[7] [8] [9] [ ]|
> |[ sliders ]________ |
>
> Where [1] is the X projection of the reference image, [2] = y projection,
> [3] = z projection
> [4,5,6] the same but for the float image.
> [7,8,9] an overlay of 1+4, 2+5, 3+6
> Hope you can follow me on this....... :-$
>
> First question: How do i create a UI which adapts itself depending on how
> much images/scans are loaded? So at t=0 no images at all draw widget at all.
> After selecting file 1 the x,y,z projection of image 1. [1,2,3]
> After selecting file 2 the x,y,z projection of image 2 and the overlay of 1
> and 2. This would be 9 draw widgets. See above [1...-9]
> This is something I would like to try but is not a necessary feature. I can
> display 9 draw widgets in the beginning if this gets awfully complicated.

I suppose it is possible to do something like this, but
it would be tedious programming and quite possibly not
worth your time. I think you would be further ahead
by loading all nine images at once, or at least having
the draw widgets on display, even if they weren't showing
images.


> Second question: How do i make the widgets resizable but still keep aspect
> ratio?? I looked at David Fannings code about resizing widgets but do not
> have an idea how to implement this in my code.

I presume you mean by this the *image* aspect ratio
(although the gyrations you go through would be the
same for draw widget aspect ratios). The simplest
way is to use my TVImage routine to display the images.
Then you could set the KEEP_ASPECT_RATIO keyword and be
done with it. The alternative is to get the TVImage code
and try to decode all that aspect ratio stuff. Good luck. :-)

> Is some more IDL source available on the web for problems like this? I found
> an awfull lot of code on David Fannings page and on a few other places but
> mathtools.net did not return much. I am starting to think a had been better
> off by chosing another programming language :-(

Oh, I'm sure it is *much* easier in another programming
language. I'd try C++. :-)

> Are their any courses on IDL in Europe? I know of one company in the
> netherlands (http://www.creaso.nl/) that provides courses.

The good folks at RSI-UK also provide programming courses.
Contact Naz Khaleque at khaleque@rsinc.com for information.

If you are looking for more personal attention, I now have
a colleague in the UK who would be able to help with training.

> Forgot to mention that only the draw widget should resize. The sliders only
> in the direction the image is resized and not in the other direction.
> Buttons shouldn't be resized but their aligning should be matched.

You will have to keep track of a lot of information (but don't
worry, this is the kind of thing computers are good at). You will
have to know just things as the size of your button base, your
slider base, your draw widget base, etc. Some of these will
change when you resize the window, some will not. How you do
this is really up to you. You can get this information using
Widget_Info and the Geometry keyword.

When your top-level base gets resized, you will have to do a lot
of computations and fiddling around, but if your interface is
designed properly (ie, col/row orientation, etc.) you should
be alright calculating the proper size for a couple of the
base widgets, and probably all of the draw widgets. There will
be the inevitable mucking about for differences in window
managers, etc. if you hope to make this portable.

Cheers,

David

P.S. You will know, if you've looked at the code on my
web page, that I try to avoid all this whenever possible
by separating resizeable windows from their control panels.
This is always another option, which has the huge advantage
that it is always easy to implement.

--
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: Resizing UI? [message #29626 is a reply to message #29625] Mon, 04 March 2002 06:22 Go to previous message
B.C. Hamans is currently offline  B.C. Hamans
Messages: 9
Registered: September 2001
Junior Member
Hi again,

Forgot to mention that only the draw widget should resize. The sliders only
in the direction the image is resized and not in the other direction.
Buttons shouldn't be resized but their aligning should be matched.

Bob
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Resizing UI?
Next Topic: sec : U Re: Resizing UI?

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

Current Time: Wed Oct 08 13:55:31 PDT 2025

Total time taken to generate the page: 0.00642 seconds