Animated gif as a process indicator.

Animated gif as a process indicator.

Postby Marc Venken » Wed Feb 08, 2023 8:31 pm

Based on Rao's "Transparent Window topic" I was trying to show a animated gif to be used as a processing/progress meter, so that people see the computer is processing data.

It won't work :? Somebody with more succes ?

Code: Select all  Expand view
#include "fivewin.ch"
#include "gif.ch"

function Main()
   local oDlg, oGif, i

   msginfo("Loop start")
   animation("ON")
   for i = 1 to 300
      sleep(1)
   next
   animation("OFF")
   msginfo("Loop done")

return nil

function Animation(cType)
  local oDlgA, oGif
  if cType = "ON"
     DEFINE DIALOG oDlgA SIZE 400, 300 PIXEL ;
       STYLE WS_POPUP COLOR CLR_BLACK,RGB(255,254,254)

       oDlgA:nSeeThroClr := RGB(255,254,254)

       oDlga:bInit := <||
          @ 0,140 GIF oGif SIZE 240,260 FILE "..\gifs\halo.gif" OF oDlgA ;
          ADJUST ACTION oDlgA:End()
          return nil
       >

   ACTIVATE DIALOG oDlgA CENTERED
  else
    oDlgA:End()
  endif
return nil
 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1357
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Animated gif as a process indicator.

Postby Natter » Wed Feb 08, 2023 8:53 pm

My users, a resident, have a program through which they submit applications to IT staff. If an answer is given to the request, an animated gif pops up for the user

Code: Select all  Expand view
procedure Viw_Kmt(pos) 
local oObj:='oWnd:aControls[1]:aDialogs[2]:aControls[1]'
** pos - ­аpplication number

  DEFAULT pos:=0

    if valtype(oMss)!="O"
      DEFINE DIALOG oMss FROM 0,0 TO 0,0  PIXEL ;
         STYLE nOR(WS_POPUP)  COLOR CLR_BLACK, CLR_WHITE

      oMss:nSeeThroClr:=CLR_WHITE

      ACTIVATE DIALOG oMss  NOWAIT

      oMss:Move(GetSysMetrics(17)+GetSysMetrics(SM_CYCAPTION)-82, ;
                                          a_win[1]-102, 100, 80)
      SetWindowPos(oMss:hWnd,-1,0,0,0,0,3)

      oMss:oClient:=TGif():New( oMss,, 0, 0, 80, 100,, .T.)
      oMss:oClient:lTransparent:=.T.
      oMss:oClient:SetFile(pth+"SUPP\pochta.gif")
      oMss:oClient:bLClicked:=&('{||oMss:Hide(),'+oObj+':nArrayAt:='+ ;
                                 ltrim(str(pos))+', W_Shw(),'+oObj+ ;
                                                   ':DrawSelect()}')
      oMss:oClient:cToolTip:=OemToAnsi("ЋвўҐв ­  § пўЄг")

  else
    oMss:oClient:bLClicked:=&('{||oMss:Hide(),'+oObj+':nArrayAt:='+ ;
                                 ltrim(str(pos))+', W_Shw(),'+oObj+ ;
                                                   ':DrawSelect()}')
    oMss:Show()
  endif

return
Natter
 
Posts: 1137
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 36 guests