Fantastic !!!!
Thanks to Rao Nages and DAniel we have a Ribbon Gallery
the code run ok
but sometimes there is this error
Thanks to Rao Nages and DAniel we have a Ribbon Gallery
#include "fivewin.ch"
#include "ribbon.ch"
#include "xbrowse.ch"
// TEST RIBBON GALLERY
function main()
local oRBar
local oWnd, oMenu, oBrw
local oGr, oGr1
DEFINE WINDOW oWnd from 1,1 to 400,600 pixel MDI
menu oMenu Popup
menuitem "Test1"
menuitem "Test2"
menuitem "Test3"
endmenu
DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "test", "test"
ADD GROUP oGr RIBBON oRBar TO OPTION 1 PROMPT "Ribbon Gallery" width 150
Ribbon_gallery( oGr,'C:\FWH\bitmaps\*.bmp','C:\FWH\bitmaps\',oGr:nWidth -5,oGr:nHeight - oGr:nHeight/7 - 2)
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
Function Ribbon_gallery( oGroup,cfiles,cCarpeta ,SizeHeight,SizeWidth)
local aDir := Directory(cfiles )
local abmp
local n, r, c,oBrw
aBmp := Array( Int( Len( aDir ) / 5 ) + 1, 5 )
r := 1
c := 1
for n := 1 to Len( aDir )
aBmp[ r, c ] := cCarpeta + aDir[ n, 1 ]
if ++c > 5
c := 1
r++
endif
next n
@ 0,0 XBROWSE oBrw of oGroup size SizeHeight,SizeWidth pixel ;
AUTOCOLS ARRAY aBmp COLOR CLR_BLACK,RGB( 143, 172, 230 )
WITH OBJECT oBrw
:lRecordSelector := .f.
:lHeader := .f.
:lHScroll := .f.
:nRowHeight := 40
END
AEval( oBrw:aCols, { |o| o:cDataType := 'F', o:nWidth := 40 } )
oBrw:CreateFromCode()
RETURN NILthe code run ok
but sometimes there is this error
pplication
===========
Path and name: C:\work\errori\test_gal\test2.Exe (32 bits)
Size: 1,919,488 bytes
Time from start: 0 hours 0 mins 17 secs
Error occurred at: 01/19/10, 21:29:24
Error description: Error BASE/1111 Argument error: LEN
Args:
[ 1] = U
Stack Calls
===========
Called from: => LEN(0)
Called from: .\source\classes\IMAGE.PRG => FILOADFROMMEMORY(232)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(8627)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1333)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(990)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10158)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(343)
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(27)
Called from: => LEN(0)
Called from: .\source\classes\IMAGE.PRG => FILOADFROMMEMORY(232)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(8627)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1333)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(990)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10158)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(343)
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(27)
Called from: => LEN(0)
Called from: .\source\classes\IMAGE.PRG => FILOADFROMMEMORY(232)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(8627)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1333)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(990)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10158)
Called from: .\source\classes\WINDOW.PRG => _FWH(3347)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(966)
Called from: test2.prg => MAIN(36)Best Regards, Saludos
Falconi Silvio
Falconi Silvio

