Page 1 of 1

How can I Resize a dialog to FIT a GIF File display

Posted: Sat Jun 01, 2013 4:43 am
by unixkd
SampleScr.jpg
SampleScr.jpg (66.14 KiB) Viewed 5395 times
How can I Resize a dialog to FIT a GIF File display as in the following code and screen:

*
Function GIFwait(lFlag,cMessage,nFontPoint,nColor)
STATIC aBusyDlg[2]
SETDEFAULT cMessage := "Please wait ...", lFlag := .T.
If ValType(aBusyDlg[1]) == "O"
aBusyDlg[1]:destroy()
DC_PointerArrow( AppDesktop() )
EndIf
If lFlag
aBusyDlg := GIFCreateBusyWindow(cMessage,nFontPoint,nColor)
DC_PointerWait( AppDesktop() )
Else
aBusyDlg[2]:pause()
Release aBusyDlg
EndIf
RETURN nil
* -------------
STATIC FUNCTION GIFCreateBusyWindow(cMessage,nFontPoint,nColor)
LOCAL GetList[0], GetOptions, oDlg, oGif
SETDEFAULT nFontPoint := 16, nColor := GRA_CLR_YELLOW
@ 0,0 DCACTIVEXCONTROL oGif SIZE 0,0 CLSID "PLAYGIF.PlayGifCtrl.1"

DCGETOPTIONS NOTITLEBAR BORDER XBPDLG_NO_BORDER
DCREAD GUI FIT MODAL EVAL {|o| oDlg := o, setAppWindow(o), _ConfigGIF(oGif)} EXIT OPTIONS GetOptions

RETURN( {oDlg,oGif} )
*
Static Function _ConfigGIF(oGif)
Local aSize[2]
oGif:AutoSize := .t.
oGif:loadGif(DC_Path(AppName(.t.))+'Globe5.gif')
aSize[1] := oGif:GetWidth()
aSize[2] := oGif:GetHeight()
oGif:play()
Return nil

Re: How can I Resize a dialog to FIT a GIF File display

Posted: Sat Jun 01, 2013 6:29 am
by rdonnay
Try this:

Code: Select all

oDlg:setSize({oGif:getWidth(),oGif:getHeight})

Re: How can I Resize a dialog to FIT a GIF File display

Posted: Sat Jun 01, 2013 8:16 am
by unixkd
With your code this is what I get. There is still frame at top and left sides.
SampleScr2.jpg
SampleScr2.jpg (58.09 KiB) Viewed 5388 times