#include 'fivewin.ch'
#include 'xbrowse.ch'
Static oWnd
Static aCat
Static oBar
/*----------------------------------------------------------------------------*/
Function Main()
aCat := { { 'UNO' }, { 'DOS' }, { 'TRES' } }
Define Window oWnd MDI
Activate Window oWnd Maximized On Init NuevaVentana()
Return 0
/*----------------------------------------------------------------------------*/
Function NuevaVentana()
Local oBmp
Local oChild
Define Window oChild MdiChild Of oWnd
Define ButtonBar oBar Size 45, 32 Of oChild _3D
oBar : bRClicked := { || .f. }
@ 05, oWnd : nWidth - 40 Bitmap oBmp File '..\bitmaps\32x32\app.bmp' Size 20, 20 Pixel Of oBar NoBorder On Click MuestraLasCategorias( oBmp ) Adjust
oBmp : lTransparent := .t.
Activate Window oChild Maximized
Return 0
/*----------------------------------------------------------------------------*/
Function MuestraLasCategorias( oBmp )
Local i
Local oDlg
Local oFont
Local oBrowse
Local nPixAlto
Local aRowGrad := { { .5, nRGB( 255, 255, 255 ), nRGB( 255, 255, 255 ) }, ;
{ .5, nRGB( 255, 255, 255 ), nRGB( 255, 255, 255 ) } }
Local aSelGrad := { { .5, RGB( 0, 191, 255 ), RGB( 0, 191, 255 ) }, ;
{ .5, RGB( 0, 191, 255 ), RGB( 0, 191, 255 ) } }
Memvar oVarGlobales
nPixAlto := Len( aCat ) * 17
Define Font oFont Name "Arial" Size 0, -10
Define Dialog oDlg Of oBar From oBmp : nBottom + 300 - nPixAlto, oBmp : nLeft() - 100 To oBmp : nBottom + 300, oBmp : nLeft() Pixel Style nOr( WS_POPUP, WS_BORDER )
@ 0, 0 xBrowse oBrowse Size oDlg : nWidth, oDlg : nHeight Array aCat Columns 1 Pixel Of oDlg NoBorder
With Object oBrowse
:aCols[ 1 ] : oDataFont := oFont
:lHeader := .f.
:lVScroll := .f.
:lHScroll := .f.
:nColDividerStyle := 5
:nMarqueeStyle := 5 //MARQSTYLE_HIGHLCELL
:nColorPen := Rgb( 225, 225, 225 )
:nRecSelColor := nRGB( 240, 240, 240 )
:bRClicked := { || oDlg : End() }
:bClrSel := { || { CLR_BLACK, RGB( 255, 255, 255 ) } }
:bClrSelFocus := { || { CLR_WHITE, aSelGrad } }
:bClrRowFocus := { || { CLR_WHITE, aRowGrad } }
:bClrGrad := { | lInvert | If( !lInvert, { { 0.5, nRGB( 255, 255, 255 ), nRGB( 240, 240, 240 ) }, ;
{ 0.5, nRGB( 240, 240, 240 ), nRGB( 232, 232, 232 ) } },;
{ { 0.50, 12961221, 16777215 }, { 0.50, 16777215, 12961221 } } ) }
:bClrHeader := {|| { CLR_BLUE, nRGB( 245, 245, 245 ) } }
:bClrFooter := {|| { CLR_BLUE, 16777215 } }
:bKeyDown := { | nKey | If( nKey == VK_RETURN, ( MsgAlert( aCat[ oBrowse : nArrayAt ][ 1 ] ), oDlg : End() ), ) }
:bLDblClick := { || MsgAlert( aCat[ oBrowse : nArrayAt ][ 1 ] ), oDlg : End() }
:nStretchCol := STRETCHCOL_LAST
:lKinetic := .f.
:lRecordSelector := .f.
:lColDividerComplete := .t.
:oWnd : bKeyDown := { | nKey | If( nKey == VK_ESCAPE, oDlg : End(), ) }
EndWith
Activate Dialog oDlg On Init( oBrowse : CreateFromCode(), oBrowse : SetFocus(), oBrowse : bLostFocus := { || oDlg : End() } ) Valid( oFont : End(), .t. ) NoWait
Return 0