Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clock, hourglass, or other visual wait display
Message
De
22/01/2002 08:30:34
 
 
À
22/01/2002 03:28:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00608057
Message ID:
00608330
Vues:
35
Thanks Daniel (and everyone else who contributed with responses and locations to find examples). I tested your example and it works great. I've decided to implement something similar to this as your example made it very easy to understand and it works perfect.
Tracy

>Tracy,
>If you go the AVI route as others have suggested, the following code may give you some ideas. In order to display an animation form, you do the following:
>
>
>*-- display an animation form
>oAnimation = NEWOBJECT("Animation", "avi.prg", "",;
>                       "Message to display...",;
>                       "Window caption (optional)",;
>                       "YourAvi.avi")
>
>*-- processing goes here...
>
>*-- remove animation form
>RELEASE oAnimation
>
>
>If you need some more AVI files, check out the following site http://www.pjs-inc.com/vb-avi
>
>HTH
>
>
>************************************************
>*-- Class: Animation
>************************************************
>*  Author............: Daniel Gramunt
>*  Created...........: 17.05.99  17:03:36
>*) Description.......: Displays an animation (AVI) using the animation control that
>*)                   : ships with VFP.
>*)                   : Handy for processes for which you cannot use a thermometer.
>*  Calling Samples...: oAnimation = NEWOBJECT("Animation", "avi.prg", "",;
>*                    :                        "Creating PDF file",;
>*                    :                        "PDF converter",;
>*                    :                        "FileToPdf.avi")
>*  Parameter List....:
>*  Major change list.:
>*--------------------------------------------------------------------------------------------------
>DEFINE CLASS Animation AS form
>
>  DataSession = 1
>  Height = 85
>  Width = 360
>  AutoCenter = .T.
>  Caption = ""
>  ControlBox = .F.
>  Closable = .F.
>  ClipControls = .F.
>  Name = "frmAnimation"
>
>  ADD OBJECT lblMessage AS label WITH ;
>    WordWrap = .T., ;
>    Caption = "Your message goes here...", ;
>    Left = 6, ;
>    Top = 2, ;
>    Width = 355, ;
>    Name = "lblMessage"
>
>  PROCEDURE Load
>    This.AddObject("oleAnimation", "oleControl", "MsComCtl2.Animation.2")
>    WITH This.oleAnimation
>      .Top     = 28
>      .Left    = 46
>      .Visible = .f.
>    ENDWITH
>  ENDPROC
>
>  PROCEDURE Init
>    *  Parameter List....: tcMessage - Message to display. Optional.
>    *                    : tcCaption - Form caption. Optional.
>    *                    :             If omitted, the form doesn't have a title bar
>    *                    : tcAviFile - Animation file to display (default = fileCopy.avi)
>    *  Major change list.:
>    *--------------------------------------------------------------------------------------------------
>    LPARAMETER tcMessage, tcCaption, tcAviFile
>
>    WITH This
>
>       *-- check parameters ------------------------------------------------------------------------------
>       IF TYPE("tcMessage") <> "C" OR EMPTY(tcMessage)
>         tcMessage = "Processing. Please be patient..."
>       ENDIF
>       IF TYPE("tcCaption") <> "C" OR EMPTY(tcCaption)
>        *-- no caption, so we remove the title bar
>         .TitleBar = 0
>       ELSE
>         .TitleBar = 1
>         .caption = tcCaption
>       ENDIF
>       IF TYPE("tcAviFile") <> "C"
>         tcAviFile = "fileCopy.avi"
>       ENDIF
>       .lblMessage.caption = tcMessage
>       .aviPlay(tcAviFile)
>       .show()
>    ENDWITH
>  ENDPROC
>
>  PROCEDURE AviPlay
>     LPARAMETERS tcAviFile
>
>     *-- make sure file exists
>     IF FILE(tcAviFile)
>       *-- update animation
>       WITH ThisForm.oleAnimation
>         .visible = .f.
>         .stop
>         .open(FULLPATH(tcAviFile))
>         .play()
>         .Height  = 60
>         .Width   = 275
>         .visible = .t.
>       ENDWITH
>     ENDIF
>   ENDPROC
>
>ENDDEFINE
>
>
>>I would like to implement something other than a wait/nowait message to notify the user that an event is occurring. I need it to display, but not stop processing. I want to release it when the process is finished. It needs to be visual, but will not be incremented since I will not know how long the process will take and have no way of monitoring the status of the process. I'm pulling information from the com port from a Phonetree system and I will not know how much data will be received through the port. I only know when it is finished. Yet I want the user to be notified that the event is still processing and not to proceed until it is finished. Any ideas? I'd like a clock with the hands spinning, a special hourglass (to distinguish it from the typical hourglass), or something of the same type. I searched downloads and didn't find what I'd like. Is there a class out there or define/enddefine code someone's used to do this?
>>TIA,
>>Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform