PDA

View Full Version : Are there event handlers for entry controls?



NewsArchive
02-27-2010, 03:23 AM
Friedrich,

I've the following script snippet:

! If user pressed the network update button
If %_SB_CONTROLID% Equals "NETWORK_BUTTON" Then
Set Variable %NET_UPDATE_DIR% to FUNCTION:Browse for Folder()
If %_SB_ERRORCODE% Equals "0" Then
Set Text "%NET_UPDATE_DIR%" to ControlID "ID_NETWORK_UPDATE"
Display Message Box "You pressed the network update button." --
"Network Update Location (Button)"
End
End
! Process user typing in an network update path
If %_SB_CONTROLID% Equals "ID_NETWORK_UPDATE" Then
Set Text "%NET_UPDATE_DIR%" to ControlID "ID_NETWORK_UPDATE"
Display Message Box "You entered a network update path." --
"Network Update Location (entry)"
End

If I enter something ID_NETWORK_UPDATE entry control, I never get the
message. If I press the NETWORK_BUTTON, I do see the message. I want to
ensure that I grab the value regardless of how a user creates a network
path. Must be a forest and trees issue here as I can't see to get the hand
entry to work.

Can you spot something I did incorrectly?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
02-27-2010, 08:38 AM
Russ,

> If I enter something ID_NETWORK_UPDATE entry control, I never get the
> message. If I press the NETWORK_BUTTON, I do see the message. I want to
> ensure that I grab the value regardless of how a user creates a network
> path. Must be a forest and trees issue here as I can't see to get the
> hand entry to work.

The Edit Control and the IP Control do not fire any events.

You can use the $EVENT:ONUPDATE$ event to verify the value:

If %_SB_EVENTID% Equals "$EVENT:ONUPDATE$" Then
If %NET_UPDATE_DIR% Length Equal To "0" Then
Display Message Box "Please set the network folder yada" -- ""
Cycle Loop
End
End

What do you think?

Friedrich

NewsArchive
02-27-2010, 08:39 AM
OK, color me confused. The same code works fine on my other two entry
controls. What I was trying to find out is why this one entry control
cannot accept anything typed into it. Nothing is ever passed to its
variable, but the button and other two entries work.

This is from a custom dialog (inspired by your examples <g>), which still
works perfectly. They can accept hand entered paths. But this 3rd entry I
just added does not. That is what I don't understand.

But your example is worth a shot, thank you.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
02-28-2010, 02:49 AM
Hi Russ,

> OK, color me confused. The same code works fine on my other two entry
> controls. What I was trying to find out is why this one entry control
> cannot accept anything typed into it. Nothing is ever passed to its
> variable, but the button and other two entries work.
>
> This is from a custom dialog (inspired by your examples <g>), which still
> works perfectly. They can accept hand entered paths. But this 3rd entry
> I just added does not. That is what I don't understand.

Only the list, combo, check and radio controls fire events because it's
possible that, based on the changed values in these controls, you manipulate
other controls on your dialog. For example, you mark [X] a checkbox and
this displays an edit control. Or you unmark [ ] a checkbox and this hides
other controls.

But the IP and the Edit Control only "store" values. So when the "Next"
button is pressed ($EVENT:ONUPDATE$ event) and the values are not as
expected, you can display a message and CYCLE so the user can do whatever
you request.

Does this make sense?

Friedrich

NewsArchive
02-28-2010, 02:50 AM
Yes, its coming together <g>. I'll play with this. Perhaps I could offer a
feature request for a future build that something like an EVENT:Accepted
fire when a user changes a value in an entry control?

I've been testing this new install in areas I know that work and so far, so
good!

Thank you for the feedback!

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
02-28-2010, 02:51 AM
Hi Russ,

> Yes, its coming together <g>. I'll play with this. Perhaps I could offer
> a feature request for a future build that something like an EVENT:Accepted
> fire when a user changes a value in an entry control?

I'll see what we can do :)

> I've been testing this new install in areas I know that work and so far,
> so good!
>
> Thank you for the feedback!

You are very welcome :)

Friedrich