[futurebasic] Re: [FB] [FB^3] non-ticking clock (New and Improved)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2000 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Mon, 24 Apr 2000 14:51:59 -0700
"Brian J. Hughes" wrote:

> New improved Appearance clock (and barber pole):

So, I've added a sound every second (depends on your sounds)
and ran it through FBII to restore the indenting, and put in a
couple of soft returns so we don't have a wrap problem - I hope!

Joe Wilkins

INCLUDE "Tlbx Appearance.Incl"
Begin GLOBALS
DIM clockH&
DIM indeProgessH&
DIM wndPtr&
END GLOBALS

LOCAL
DIM clockRect as rect
DIM progressRect as Rect
LOCAL FN buildWnd

   WINDOW #1,"clock control",(0,0)-(200,120),_docNoGrow
   clockRect.top% = 30
   clockRect.left% = 50
   clockRect.bottom% = 50
   clockRect.right% = 150

   progressRect.top% = 70
   progressRect.left% = 50
   progressRect.bottom% = 90
   progressRect.right% = 150

   wndPtr&=WINDOW(_wndPointer)
   LONG IF wndPtr& <> 0
      clockH& = FN NEWCONTROL(wndPtr&,clockrect,"",¬
      _true,3,0,0,241,0)
      indeProgessH& = FN NEWCONTROL(wndPtr&,¬
      progressRect,"",_true,3,0,0,80,0)
   END IF
END FN

LOCAL FN barberPole
   DIM OSErr
   OSErr = FN SetControlData (indeProgessH&,¬
   _kControlIndicatorPart,¬
   _kControlProgressBarIndeterminateTag,0,0)
END FN

LOCAL FN doSendIdles
   DIM evtPtr&
   evtPtr& = EVENT
   SELECT CASE evtPtr&.evtNum%
      CASE _updatEvt
         CALL IdleControls(wndPtr&)
         evtPtr&.evtNum% = _nullEvt
   END SELECT
END FN

LOCAL FN doTimer
   SOUND %1
END FN

LOCAL FN doDialog
   DIM evnt%
   DIM id%
   evnt% = DIALOG(0)
   id% = DIALOG(evnt)
   SELECT evnt%
      CASE _wndClose
         END
   END SELECT
END FN

FN buildWnd
FN barberPole

ON TIMER (1) FN doTimer
ON DIALOG FN doDialog
ON EVENT FN doSendIdles

DO
   HANDLEEVENTS
UNTIL 0