| Home | SQL | PHP | HTML | Perl | PowerBuilder | C/C++ | General | Solutions | Contacts |
PowerBuilderIndexTipsDatawindow TimerExecutable Name Include Objects Is Executable? Object Exists? ObjectsDownloads |
Datawindow timer eventPurposeIt's quite possible to add a timer to a datawindow, it's just not very well documented! This page tells you how to do it. How to do itStartingCreate a new Datawindow control, declare a new event within this object and call it whatever you like (I personally use ue_timer). Map this event to the pbm_timer event id. You've just created a timer event for your datawindow control. Setting the timer intervalTo make use of the timer event, the attached Datawindow object must have the Timer Interval property set. In Powerbuilder v7, this is set in the General tab of the Properties pane, the interval is set in milliseconds. If you wish to set the value programatically, the property is "DataWindow.Timer_Interval" when using the Modify syntax, or "dw_control.Object.DataWindow.Timer_Interval" using the dot notation. Using the eventEnter code into your event, it should now run at the specified interval. Please also see the notes below. Notes
SuggestionsThis is useful stuff for a framework, it may be useful to define the event in your base datawindow class. It would also be advisable to create a function to set the timer_interval, so you have a standard interface. If you're being particularly adventurous you could also use create, within a datawindow modify, to add a field with an expression mapping to the Now() function, thereby eliminating the need to remember to add this field. DetailsAuthor: Wayne Jones Created: 12 December 2002 Works with: Should work with any version | |
| This is Code, all contents copyright - © Wayne Jones 2004. |
