Ollie,
with my new Tool You can get it working :
You can watch, changing the contents of the subfolder \images, how the size changes.
Changing ( delete / add files ) inside the File-browser, shows the result inside the Timer.
I changed the original field < Year > against < Dir-size >.
Download ( Exe, Prg and Images ) :
http://www.pflegeplus.com/fw_download/testsize.zip
1. getting the size of all files :
2. deleting a file, returns a new size :
The Timer-part :
Code: Select all
FUNCTION SHOW_TD()
LOCAL oTDTitle, oTime, oDate1, oDate2, oDate3, oDate4
LOCAL cTime := Time()
LOCAL cDate1 := ALLTRIM( STR( YEAR( DATE() ) ) )
LOCAL cDate2 := CMONTH( Date() )
LOCAL cDate3 := CDOW( Date() )
LOCAL cDate4 := ALLTRIM( STR( DAY(DATE()) ))
@ 50, 50 TITLE oTDTitle SIZE 350, 99 OF oWnd TRANSPARENT SHADOWSIZE 0
oTDTitle:lRound := .T.
oTDTitle:lBorder := .T.
// Shadow Tansparent-intensity ( 10 = Low / 70 = Black )
oTDTitle:nShadowIntensity = 20
// Animated Title-Image
// ----------------------------
@ 10, 10 TITLEIMG OF oTDTitle BITMAP c_path + "\Images\Clock.bmp" TRANSPARENT ;
ANIMA LEVEL 255 ;
ACTION MsgAlert( "Button with Action","Attention" )
// Time
@ 10, 68 TITLETEXT oTime OF oTDTitle TEXT cTime FONT oTimeFont ;
SHADOW BOTTOMRIGHT COLOR 65535
// Day
@ 47, 68 TITLETEXT oDate1 OF oTDTitle TEXT cDate1 FONT oTimeFont ;
SHADOW BOTTOMRIGHT COLOR 255
// Month
@ 47, 125 TITLETEXT oDate2 OF oTDTitle TEXT cDate2 FONT oDateFont ;
SHADOW BOTTOMRIGHT COLOR 65535
// Weekday
@ 66, 125 TITLETEXT oDate3 OF oTDTitle TEXT cDate3 FONT oDateFont ;
SHADOW BOTTOMRIGHT COLOR 65535
// Year
@ 47, 150.0 TITLETEXT oDate4 OF oTDTitle TEXT cDate4 FONT oTimeFont ;
SHADOW BOTTOMRIGHT COLOR 255
// Text Shadow-Color
// -------------------------
oTDTitle:nShadowTxtClr := 10461087
// Text-Shadow-Distance
// ------------------------------
oTDTitle:nShadowTxtDis := 1
DEFINE TIMER oTimer INTERVAL 500 ;
ACTION GETDATA2( oTime, oDate1, oDate2, oDate3, oDate4 ) OF oWnd
ACTIVATE TIMER oTimer
RETURN ( NIL )
// ------ YEAR replaced, using Your directory-function !!!! ---------
FUNCTION GETDATA2( oTime, oDate1, oDate2, oDate3, oDate4 )
LOCAL oTime1 := TTime():System(), adir, nfoldersize, i
cTime := oTime1:cGetTime()
cDate1 := ALLTRIM( STR( DAY(DATE()) ))
cDate2 := CMONTH( Date() )
cDate3 := CDOW( Date() )
// cDate4 := ALLTRIM( STR( YEAR( DATE() ) ) )
oTime:SetText( cTime )
oDate1:SetText( cDate1 )
oDate2:SetText( cDate2 )
oDate3:SetText( cDate3 )
// oDate4:SetText( cDate4 ) REPLACED !!!!
aDir = DIRECTORY(c_path + "\Images\*.*", "D" )
nFolderSize = 0
FOR i = 1 TO LEN( aDir )
nFolderSize += aDir[ i, 2 ]
//1 = Filename
//2 = Filesize
NEXT
oDate4:SetText( STR(nFolderSize) )
RETURN NIL
Best Regards
Uwe