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

Home » Public Forums » archive » Re: re-create a widget
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: re-create a widget [message #70079] Sat, 13 March 2010 07:22
Robert Moss, PhD is currently offline  Robert Moss, PhD
Messages: 29
Registered: November 2006
Junior Member
On Mar 11, 6:07 pm, titan <thunder...@inwind.it> wrote:
> On Mar 11, 4:55 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>
>
>> On Mar 10, 12:30 pm, titan <thunder...@inwind.it> wrote:
>
>>> Hi all,
>>> I'm trying to write a simple widget which permits to insert 2 values
>>> and check if the min value is less than the max value. If not a
>>> message error appears. My problem is that once the "quit" button of
>>> this error message is pressed I'm not able to re-open the first widget
>>> in order to correct the values inserted.
>>> How can I handle this aspect?
>
>>> thanks
>
>>> here you can find the code:
>
>>> PRO quit_button_event, event
>>> WIDGET_CONTROL,event.top,/DESTROY ;
>>> END
>
>>>  input_param = WIDGET_AUTO_BASE(title='Input data range')
>
>>>  p1 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
>>> DEFAULT='7.5',$
>>>                    prompt='minimum std dev of heights value',
>>> uvalue='p1')
>
>>>  p2 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
>>> DEFAULT='4.5',$
>>>                    prompt='maximum std dev of heights value',
>>> uvalue='p2')
>>>  result=AUTO_WID_MNG(input_param)
>>>  IF (result.accept eq 0) THEN return
>
>>> min_val = result.p1
>>> max_val = result.p2
>
>>> IF (min_val GT max_val)  THEN BEGIN
>>> base_err = WIDGET_BASE(TITLE = 'INPUT ERROR info', XSIZE = 500, /
>>> COLUMN, XOFFSET=500, YOFFSET=300)
>>>         row_err = WIDGET_BASE(base_err, /ROW,/FRAME)
>>>         err_label = WIDGET_LABEL(row_err,VALUE='ERROR MESSAGE ',/
>>> DYNAMIC_RESIZE)
>>>         err_msg = widget_TEXT(row_err,VALUE='Please check if the
>>> maximum/minimum order inserted is correct',XSIZE=60)
>>>         row_quit_button = WIDGET_BASE(base_err, /ROW,/FRAME, /
>>> ALIGN_CENTER)
>>>         quit_button= WIDGET_BUTTON(row_quit_button, VALUE='QUIT',
>>> UVALUE='Quit', XSIZE = 100,/ALIGN_CENTER)
>>>         WIDGET_CONTROL, base_err, /REALIZE
>>>         XMANAGER, 'wid_err',
>>> base_err,event_handler='quit_button_event'
>>>      ENDIF
>>> end
>
>> If nothing else you can always have your error message say "You need
>> to fix your values" or something to that effect, then just redisplay
>> the original widget, check it again, and repeat as necessary...
>
> Ehm the fact is that I'm having problem with how to redisplay the
> original widget..
> Could you please explain what you mean?
> I'm wondering if the problem is related to the fact that I used an
> AUTO_MANAGE widget..
> thanks

Yes, it is because you are using an auto managed widget. I advise
using a modal widget and skipping the auto_manage bits.

r
Re: re-create a widget [message #70097 is a reply to message #70079] Thu, 11 March 2010 15:07 Go to previous message
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
On Mar 11, 4:55 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
> On Mar 10, 12:30 pm, titan <thunder...@inwind.it> wrote:
>
>
>
>> Hi all,
>> I'm trying to write a simple widget which permits to insert 2 values
>> and check if the min value is less than the max value. If not a
>> message error appears. My problem is that once the "quit" button of
>> this error message is pressed I'm not able to re-open the first widget
>> in order to correct the values inserted.
>> How can I handle this aspect?
>
>> thanks
>
>> here you can find the code:
>
>> PRO quit_button_event, event
>> WIDGET_CONTROL,event.top,/DESTROY ;
>> END
>
>>  input_param = WIDGET_AUTO_BASE(title='Input data range')
>
>>  p1 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
>> DEFAULT='7.5',$
>>                    prompt='minimum std dev of heights value',
>> uvalue='p1')
>
>>  p2 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
>> DEFAULT='4.5',$
>>                    prompt='maximum std dev of heights value',
>> uvalue='p2')
>>  result=AUTO_WID_MNG(input_param)
>>  IF (result.accept eq 0) THEN return
>
>> min_val = result.p1
>> max_val = result.p2
>
>> IF (min_val GT max_val)  THEN BEGIN
>> base_err = WIDGET_BASE(TITLE = 'INPUT ERROR info', XSIZE = 500, /
>> COLUMN, XOFFSET=500, YOFFSET=300)
>>         row_err = WIDGET_BASE(base_err, /ROW,/FRAME)
>>         err_label = WIDGET_LABEL(row_err,VALUE='ERROR MESSAGE ',/
>> DYNAMIC_RESIZE)
>>         err_msg = widget_TEXT(row_err,VALUE='Please check if the
>> maximum/minimum order inserted is correct',XSIZE=60)
>>         row_quit_button = WIDGET_BASE(base_err, /ROW,/FRAME, /
>> ALIGN_CENTER)
>>         quit_button= WIDGET_BUTTON(row_quit_button, VALUE='QUIT',
>> UVALUE='Quit', XSIZE = 100,/ALIGN_CENTER)
>>         WIDGET_CONTROL, base_err, /REALIZE
>>         XMANAGER, 'wid_err',
>> base_err,event_handler='quit_button_event'
>>      ENDIF
>> end
>
> If nothing else you can always have your error message say "You need
> to fix your values" or something to that effect, then just redisplay
> the original widget, check it again, and repeat as necessary...

Ehm the fact is that I'm having problem with how to redisplay the
original widget..
Could you please explain what you mean?
I'm wondering if the problem is related to the fact that I used an
AUTO_MANAGE widget..
thanks
Re: re-create a widget [message #70112 is a reply to message #70097] Wed, 10 March 2010 19:55 Go to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On Mar 10, 12:30 pm, titan <thunder...@inwind.it> wrote:
> Hi all,
> I'm trying to write a simple widget which permits to insert 2 values
> and check if the min value is less than the max value. If not a
> message error appears. My problem is that once the "quit" button of
> this error message is pressed I'm not able to re-open the first widget
> in order to correct the values inserted.
> How can I handle this aspect?
>
> thanks
>
> here you can find the code:
>
> PRO quit_button_event, event
> WIDGET_CONTROL,event.top,/DESTROY ;
> END
>
>  input_param = WIDGET_AUTO_BASE(title='Input data range')
>
>  p1 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
> DEFAULT='7.5',$
>                    prompt='minimum std dev of heights value',
> uvalue='p1')
>
>  p2 = WIDGET_PARAM(input_param, /auto_manage, dt=4, field=3,
> DEFAULT='4.5',$
>                    prompt='maximum std dev of heights value',
> uvalue='p2')
>  result=AUTO_WID_MNG(input_param)
>  IF (result.accept eq 0) THEN return
>
> min_val = result.p1
> max_val = result.p2
>
> IF (min_val GT max_val)  THEN BEGIN
> base_err = WIDGET_BASE(TITLE = 'INPUT ERROR info', XSIZE = 500, /
> COLUMN, XOFFSET=500, YOFFSET=300)
>         row_err = WIDGET_BASE(base_err, /ROW,/FRAME)
>         err_label = WIDGET_LABEL(row_err,VALUE='ERROR MESSAGE ',/
> DYNAMIC_RESIZE)
>         err_msg = widget_TEXT(row_err,VALUE='Please check if the
> maximum/minimum order inserted is correct',XSIZE=60)
>         row_quit_button = WIDGET_BASE(base_err, /ROW,/FRAME, /
> ALIGN_CENTER)
>         quit_button= WIDGET_BUTTON(row_quit_button, VALUE='QUIT',
> UVALUE='Quit', XSIZE = 100,/ALIGN_CENTER)
>         WIDGET_CONTROL, base_err, /REALIZE
>         XMANAGER, 'wid_err',
> base_err,event_handler='quit_button_event'
>      ENDIF
> end

If nothing else you can always have your error message say "You need
to fix your values" or something to that effect, then just redisplay
the original widget, check it again, and repeat as necessary...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: rejecting a few pixel values from an array of pixel values
Next Topic: Re: rejecting a few pixel values from an array of pixel values

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

Current Time: Fri Oct 10 00:27:53 PDT 2025

Total time taken to generate the page: 0.40466 seconds