At the leftt site of the window the available emf files should be shown
and an on click should show the preview on the right site.
In my case Preview opens in a maximized window.
Does someone know how to do?
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd
local oBrw, oCol
local oRes, cRes
LOCAL aInhalt := directory("*.emf","D")
LOCAL oFnt
LOCAL ob0, ob1, ob2, ob3, ob4, ob5, xRes
DEFINE FONT oFnt NAME "ARIAL" SIZE 6 ,15 BOLD
DEFINE WINDOW oWnd TITLE "EMF-Viewer" ;
FROM 0,0 TO 800,1024 PIXEL
oWnd:SetFont(oFnt)
oBrw := TXBrowse():New( oWnd )
oBrw:nTop := 10
oBrw:nLeft := 20
oBrw:nBottom := 600
oBrw:nRight := 330
oBrw:SetArray( ainHalt, .T. )
oBrw:aCols[1]:cHeader := 'Source'
oBrw:aCols[1]:nWidth := 157
oBrw:aCols[2]:cHeader := 'Size'
oBrw:aCols[3]:cHeader := 'Date'
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nRowDividerStyle := 4
oBrw:lRecordSelector := .t.
oBrw:bLDblClick := {|| CreateChild( oBrw) }
oBrw:bKeyDown := {|nkey| iF( nkey = 13, CreateChild( oBrw), ) }
oBrw:lHScroll := .f.
oBrw:CreateFromCode()
@ 650, 350 BUTTON ob0 PROMPT "&Open" OF oWnd PIXEL SIZE 80,30;
ACTION CreateChild( oBrw)
@ 650, 870 BUTTON "&Exit" OF oWnd PIXEL SIZE 80,30;
ACTION oWnd:end()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function CreateChild( oBrw)
local oPrn
local cFileName := oBrw:aArrayData[oBrw:nArrayAt,1]
PRINTER oPrn PREVIEW
PAGE
oPrn:ImportWMF( cFileName )
ENDPAGE
ENDPRINT
return nil
//----------------------------------------------------------------------------//