FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TIMER Question
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
TIMER Question
Posted: Wed Dec 18, 2019 12:32 AM
hi,

i have a TIMER in Main but it never reach my Function
Code (fw): Select all Collapse
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 (fw): Select all Collapse
STATIC FUNCTION ShowTime()
msginfo("ShowTime")

Syntax "seems" ok but i get no Messagebox so i never reach function ... why :-)
... does it have to do with those other 8 Dialog :-)
greeting,

Jimmy
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: TIMER Question
Posted: Wed Dec 18, 2019 08:59 AM

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

EMG

Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: TIMER Question
Posted: Wed Dec 18, 2019 11:22 AM
Try to add OF oDlg/oWnd
Code (fw): Select all Collapse
DEFINE TIMER oTimer_1 INTERVAL 1000 ACTION ShowTime() OF FORM_1
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: TIMER Question
Posted: Wed Dec 18, 2019 10:42 PM
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 (fw): Select all Collapse
      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

Continue the discussion