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

Home » Public Forums » archive » CW_FORM
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
CW_FORM [message #21332] Tue, 22 August 2000 00:00 Go to next message
<hom is currently offline  <hom
Messages: 5
Registered: August 2000
Junior Member
I want to create a widget that will allow the user to input several
strings into various fields, and then have a 'Quit' button that when
pressed will destroy the widget and retain the inputed values.

Below is my code. So far I am unsuccessful at getting CW_FORM to work. Is
CW_FORM what I should be using? If so, could anyone tell me what I am
missing in my code?

I would appreciate any help!!

Thanks,
Aimy

;*********************************************************** *****
pro CmpndWidget

BaseWidget=WIDGET_BASE(Title='Base',/COLUMN)

desc=['1,TEXT,File Name, WIDTH=12, TAG=Name',$
'0, BUTTON, OK, QUIT, TAG=OK', $
'2, BUTTON, Cancel, QUIT']

FormWidget=CW_FORM(BaseWidget,desc,/COLUMN)

; Making the widget visible on the screen
WIDGET_CONTROL, /REALIZE, BaseWidget

REPEAT BEGIN
event=widget_event(BaseWidget)
ENDREP UNTIL (event.quit EQ 1)

print, event.VALUE

end
Re: CW_FORM [message #21408 is a reply to message #21332] Wed, 23 August 2000 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Aimy (hom@sask.usask.ca) writes:

> Would using the conventional XMANAGER event handling procedure prevent me
> from obtaining all of this data? I do not want to execute a procedure each
> time a field is changed; rather, I would like to store all the changed
> fields and use that information together somewhere else.
>
> Pavel, the code you gave me works, but I don't know how to obtain the
> string I inputed in the "File Name" field after I press the "OK" button.

Is doesn't matter what you use to collect
the data (although I wouldn't use CW_FORM
either). The important thing is that you store
the information on the form *outside* the program
so you can collect and return the data from the
widget definition module (after the XManager
command). By "outside" I mean in some kind of
pointer location.

You can either read my book on the subject of
writing dialog form widgets (:-)), or you can
look at a simple example of such a program. Here is
one that goes with the book:

ftp://ftp.dfanning.com/pub/dfanning/outgoing/idl_course/getd ata.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: CW_FORM [message #21409 is a reply to message #21332] Wed, 23 August 2000 00:00 Go to previous messageGo to next message
<hom is currently offline  <hom
Messages: 5
Registered: August 2000
Junior Member
Pavel and Paul,

Thank you for your help! I want to use the CW_FORM because I want to
create several fields, from which I need to obtain all the inputed values.

Would using the conventional XMANAGER event handling procedure prevent me
from obtaining all of this data? I do not want to execute a procedure each
time a field is changed; rather, I would like to store all the changed
fields and use that information together somewhere else.

Pavel, the code you gave me works, but I don't know how to obtain the
string I inputed in the "File Name" field after I press the "OK" button.

Thanks again,
Aimy
Re: CW_FORM [message #21425 is a reply to message #21332] Tue, 22 August 2000 00:00 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
hom@sask.usask.ca wrote:
>
> I want to create a widget that will allow the user to input several
> strings into various fields, and then have a 'Quit' button that when
> pressed will destroy the widget and retain the inputed values.

This is not addressing the question you asked but I would expect "Quit"
to destroy both the widget and the values entered. Use something like
"Apply" to use the values and not destroy the widget and "Done" to
destroy the widget AND retain the values.

If the application is just for you it doesn't matter, but if othger
people want to use they may get confused.

paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
Re: CW_FORM [message #33033 is a reply to message #21332] Wed, 27 November 2002 11:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
miki (miki.guglie@virgilio.it) writes:

> I developed a GUI using CW_FORM to build forms with several columns of
> buttons and test fields, but when I tested the software under different OS I
> realized that with some OS the forms built with CW_FORM are not aligned
> (i.e., the third button of the first column is lower than the third text
> field on the second column and the last button is muche lower than the last
> field). How could I fix that?

I think you have two choices for fixing this:

1. Lower your expectations (easiest)
2. Build your own forms by hand (hardest)

RSI's engineers, bless them, are very, very good.
But most of them have never been to art school,
and apparently most engineering departments are
still scrimping on Aesthetics 101. So the chance
that something like alignment would be addressed
in a compound widget from RSI is not as good as
we would like it to be, probably.

And, to be fair, when you try to do something
as ambitious as CW_FORM *AND* you want to make
it cross-platform, the challenges are formidable,
if not impossible to solve.

I always build my own forms because I am...well...
nuts. But even that is not a perfect solution because
every time someone runs the code on a platform other
than mine (and cares enough to report it to me) I end
up tweaking it here and there. Some days it seems an
endless task. :-(

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CW_FORM
Next Topic: Speedy way to get compare array elements. . .

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

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

Total time taken to generate the page: 0.04681 seconds