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

Home » Public Forums » archive » widget_text editable and all_events
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
widget_text editable and all_events [message #65837] Wed, 25 March 2009 11:10
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
It's always bugged me the way widget_text handles events. Namely, I
have two choices:
1- set editable and unset all_events: then I have to deliver a CR to
get the value to "take".
2- set editable and set all_events: then the event handler fires every
time something is typed.

What I'd really like is something in between. The reason being that I
like to validate the input to make sure it's a number before I accept
it. Then if it is jibberish, I put the old value back, something like
this:

'GOODENOUGH': begin
holdge = (*info).data.goodenough
widget_control, (*info).widgets.goodenough_text, get_value=val
if is_number(val) gt 0 then begin
if long(val) ne holdge then begin
(*info).data.goodenough = long(val)
widget_control, (*info).widgets.goodenough_text,
set_value=strtrim(long(val),2)
endif
endif else begin
widget_control, (*info).widgets.goodenough_text,
set_value=strtrim(holdge,2)
endelse
end

Well, scenario 2- makes it so that you cannot just backspace out the
whole thing then start typing. What I would like is for the
validation to occur if either (1) the user hits CR or (2) the text box
loses focus (aha!)

Thanks for your ideas.
Vince
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: filling multi spectral image
Next Topic: Re: widget_text editable and all_events

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

Current Time: Fri Oct 10 22:51:35 PDT 2025

Total time taken to generate the page: 0.96513 seconds