03-22-2006 07:24 AM
03-22-2006 08:25 AM
Perhaps what you need is something along these lines:
Will this achieve your needs?
JR
03-23-2006 08:17 AM
Hi JR,
thanks for the reply. I shall try it out and get back to you. I think it should work though
k1_ke
03-29-2006 03:34 PM
Hi,
I am still having trouble with inputting a value in the numeric box. As i mentioned earlier...the numeric boxes get updated on a timer callback. So everytime the timer ticks, it triggers the update rountine which updates the uir. Some of the boxes i can write too. so i write a value to it...it should take that value and discard the previous it had. this write and read operations are actually commucating to modbus registers via rs232...Currently when i try to even select the value that displays in the box, as soon as i try to input a number, the new number disappears and the old value is displayed...this is because i am slower than the timer tick but if i do it really quickly n press enter sometimes it wrks. is there any way i can stop the timer when a user highlights the txt in the numeric box???
Or if there is any other solution to my problem...looking forward to hearing from someone
Thanks
k1_ke
03-29-2006 04:12 PM
What you are looking for would be SetCtrlAttribute() using ATTR_ENABLED to start/stop an individual timer. SuspendTimerCallbacks() and ResumeTimerCallbacks() will do it for all timers. You would need to trap on any event that can allow data entry into your control. EVENT_LEFT_CLICK if they use the mouse, probably EVENT_KEYPRESS if they use the tab key etc. The events fired when they leave the control would be use to re-enable the timer EVENT_COMMIT, maybe EVENT_LOST_FOCUS. This would work if you want to suspend updates to all controls if the user enters any of the controls.
If you only want to stop updates to the control the user has made active, the suggestion that jr_2005 made to set an flag could be made to work. The flag value would have to indicate which control should not be updated by the timer. Just as with the timer method above, the flag must be set by anything event that makes the control active, and cleared by any event that fired when the control is no longer accepting input.
You could also use the flag, set by the same events that would enable/disable the timer, but simply not update any of the display. The flag methods have the advantage that they allow the timer to continue to clear the RS232 buffer. If the user stays in a control for a long period of time, you could run into a buffer overflow if the RS232 port is receiving unsolicited data.
03-29-2006 04:14 PM
03-30-2006 10:30 AM
03-30-2006 11:08 AM
03-30-2006 01:28 PM
03-30-2006 01:47 PM