TIMER Question

Post Reply
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

TIMER Question

Post 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 :?:
greeting,
Jimmy
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: TIMER Question

Post by Enrico Maria Giordano »

Try to move the timer activation to the ON INIT clause (oTimer_1:Activate()).

EMG
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: TIMER Question

Post by hua »

Try to add OF oDlg/oWnd

Code: Select all

DEFINE TIMER oTimer_1 INTERVAL 1000 ACTION ShowTime() OF FORM_1
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: TIMER Question

Post 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
greeting,
Jimmy
Post Reply