Page 1 of 1

TIMER Question

Posted: Wed Dec 18, 2019 12:32 am
by Jimmy
hi,

i have a TIMER in Main but it never reach my Function

Code: Select all

PROCEDURE Main()

   DEFINE DIALOG Form_1 ;
      TITLE "" ;
      SIZE 0,0

      DEFINE TIMER oTimer_1 INTERVAL 1000 ACTION ShowTime()
      ACTIVATE TIMER oTimer_1
      ACTIVATE DIALOG Form_1 CENTERED ;
                             ON INIT CreateForms() ;  // here my 8 x Dialog create
                             ON CLICK HideShow()
   RELEASE TIMER oTimer_1
   DoRelease()
RETURN

Code: Select all

STATIC FUNCTION ShowTime()
msginfo("ShowTime")
Syntax "seems" ok but i get no Messagebox so i never reach function ... why :idea:
... does it have to do with those other 8 Dialog :?:

Re: TIMER Question

Posted: Wed Dec 18, 2019 8:59 am
by Enrico Maria Giordano
Try to move the timer activation to the ON INIT clause (oTimer_1:Activate()).

EMG

Re: TIMER Question

Posted: Wed Dec 18, 2019 11:22 am
by hua
Try to add OF oDlg/oWnd

Code: Select all

DEFINE TIMER oTimer_1 INTERVAL 1000 ACTION ShowTime() OF FORM_1

Re: TIMER Question

Posted: Wed Dec 18, 2019 10:42 pm
by Jimmy
hi

thx for help.

YES you are right TIMER was running in "Main" DIALOG but i want it for "Childs"
now i have move TIMER to "Child" Section and now it fired Event

Code: Select all

      cOnPaintProc := "{|| PBW( '" + str(oForm:hwnd) + ;
                            "', '" + str(i)          + ;
                            "', '" + str(wide)       + ;
                            "', '" + str(height)     + ;
                            "', '" + str(hBitmap)    + "' )}"

      oForm:bPainted := &(cOnPaintProc)

   NEXT

   DEFINE TIMER oTimer INTERVAL 1000 ACTION ShowTime()
   ACTIVATE TIMER oTimer

RETURN NIL