Can you please adapt “CoverFlow – class” to simulate
METRO - Flipview control.
Thanks in advance
Otto



Code: Select all | Expand
#include "FiveWin.Ch"
#include "xbrowse.ch"
#include "hbcompat.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, oFont, oBrush, aData
local n, m, k, cPath, aDir, aRow
SET DATE ITALIAN
SET CENTURY ON
XBrNumFormat( 'A', .t. )
aData := {}
cPath := "c:\fwh\bitmaps\pngs\"
aDir := Directory( cPath + "i*.png" )
k := 1
for n := 1 to Len( aDir ) step 3
aRow := {}
for m := 0 to 2
if k <= Len( aDir )
AAdd( aRow, cPath + aDir[ n + m, 1 ] )
AAdd( aRow, aDir[ n + m, 1 ] )
else
AAdd( aRow, nil )
AAdd( aRow, nil )
endif
k++
next
AAdd( aData, aRow )
next
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\hires\office.bmp" STRETCH
DEFINE window oWnd BRUSH oBrush
oWnd:SetFont( oFont )
@ 100,100 XBROWSE oBrw SIZE 500,-100 PIXEL OF oWnd ;
DATASOURCE aData AUTOCOLS NOBORDER ;
COLOR CLR_WHITE,RGB(77,117,225)
WITH OBJECT oBrw
:lHeader := ;
:lRecordSelector := ;
:lHScroll := ;
:lVScroll := .f.
:nDataStrAligns := AL_CENTER
:nDataBmpAligns := AL_CENTER
for n := 1 to Len( :aCols ) STEP 2
:aCols[ n ]:cDataType := 'F'
:aCols[ n ]:nWidth := 100
next
for n := 2 to Len( :aCols ) STEP 2
:aCols[ n ]:bClrStd := { || { CLR_WHITE, RGB( 115,23,26 ) } }
next
for n := 1 to Len( :aCols ) STEP 2
:aCols[ n ]:SetColsAsRows( n, n + 1 )
next
//
:CreateFromCode() // omit for resource
END
ACTIVATE WINDOW oWnd MAXIMIZED
RELEASE FONT oFont
RELEASE BRUSH oBrush
return nil
//----------------------------------------------------------------------------//