TIMER Question

TIMER Question

Postby Jimmy » Wed Dec 18, 2019 12:32 am

hi,

i have a TIMER in Main but it never reach my Function
Code: Select all  Expand view  RUN
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  Expand view  RUN
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
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: TIMER Question

Postby Enrico Maria Giordano » Wed Dec 18, 2019 8:59 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TIMER Question

Postby hua » Wed Dec 18, 2019 11:22 am

Try to add OF oDlg/oWnd
Code: Select all  Expand view  RUN
DEFINE TIMER oTimer_1 INTERVAL 1000 ACTION ShowTime() OF FORM_1
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: TIMER Question

Postby Jimmy » 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: Select all  Expand view  RUN
     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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests