Ed,
you can try the following:
in your .4st file, add:
<Style name="Image">
<StyleAttribute name="imageCache" value="1" />
</Style>
<Style name="Table.pflow">
<StyleAttribute name="tableType" value="pictureFlow" />
<StyleAttribute name="backgroundColor" value="#AEC9F6" />
<StyleAttribute name="border" value="none" />
</Style>
This will allow:
- to use image cache and not reload images everytime
- define a picture flow image, with a background and no border
A small .per:
LAYOUT (MINWIDTH=80, MINHEIGHT=20)
GRID
{
<T t >
[a ]
[a ]
[a ]
[a ]
[a ]
[a ]
[nm ]
}
END
END
ATTRIBUTES
IMAGE a = FORMONLY.a;
EDIT nm = FORMONLY.nm;
TABLE t : style="pflow";
END
INSTRUCTIONS
SCREEN RECORD sr(a);
And the 4gl:
IMPORT os
DEFINE files DYNAMIC ARRAY OF STRING
MAIN
DEFINE restart SMALLINT
OPEN FORM f FROM "pFLOW" DISPLAY FORM f
CALL populate( ARG_VAL(1) )
IF files.getLength() > 0 THEN
DISPLAY ARRAY files TO sr.*
BEFORE ROW
DISPLAY files[arr_curr()] TO nm
ON KEY (F5)
CALL populate( "" )
END DISPLAY
END IF
END MAIN
FUNCTION populate(path)
DEFINE path STRING
DEFINE child STRING
DEFINE h, idx INTEGER
IF path IS NULL || NOT os.Path.exists(path) || NOT os.Path.isdirectory(path)
THEN
CALL ui.Interface.frontcall("standard","opendir", ["Select directory", ""]
,[path])
END IF
call files.clear()
LET idx = 1
CALL os.Path.dirsort("name", 1)
DISPLAY "*** " , path
LET h = os.Path.diropen(path)
DISPLAY h
WHILE h > 0
LET child = os.Path.dirnext(h)
IF child IS NULL THEN EXIT WHILE END IF
IF child == "." OR child == ".." THEN CONTINUE WHILE END IF
-- DISPLAY child
LET files[idx] = path || "\\" || child
LET idx = idx + 1
END WHILE
CALL os.Path.dirclose(h)
END FUNCTION
This small test case is aimed to be run with fglrun running on the same machine as GDC.
fglrun pFlow c:\mypics
will display c:\mypics images in the pictureflow.
Let me know if it works on your side.