// C:\FWH\SAMPLES\SILVIURL.PRG
#include "FiveWin.ch"
FUNCTION Inicio()
LOCAL oDlg, oBrw, oFont[ 2 ]
LOCAL aData := { { "xHarbour", "http://www.xharbour.org/", 1 }, ;
{ "Cualquier cosa", "Ejecuta proceso Tres", 3 }, ;
{ "Fivetech", "www.fivetechsoft.com", 1 }, ;
{ "Forum Fivetecht", "https://forums.fivetechsupport.com", 1 }, ;
{ "Tarea adicional", "Ejecuta proceso Dos", 2 } }
LOCAL oCursorBtn := TCursor():New(, 'HAND' )
DEFINE FONT oFont[ 1 ] NAME "TAHOMA" SIZE 0, - 14
DEFINE FONT oFont[ 2 ] NAME "TAHOMA" SIZE 0, - 14 UNDERLINE
DEFINE DIALOG oDlg SIZE 537, 300 PIXEL TRUEPIXEL ;
TITLE "xBrowse con UrlLink"
oDlg:lHelpIcon := .F.
@ 20, 20 XBROWSE oBrw DATASOURCE aData OF oDlg PIXEL SIZE 500, 200 ;
AUTOSORT AUTOCOLS LINES CELL ;
HEADERS "Empresa / Mensaje", "URL / Acción" COLSIZES { 150, 300 } ;
FONT oFont[ 1 ]
oBrw:cTooltip := { "Click-Me", ;
"Silvio Falconi", 1, CLR_WHITE, CLR_CYAN }
BrwColors( oBrw, .T. )
WITH OBJECT oBrw:aCols[ 2 ]
:bLDClickData := {|| Opciones( aData, oBrw ) }
:oDataFont := {|| iif( aData[ oBrw:nArrayAt, 3 ] == 1, oFont[ 2 ], oFont[ 1 ] ) }
:aClrText := {|| iif( aData[ oBrw:nArrayAt, 3 ] == 1, nRGB( 50, 50, 200 ), nRGB( 0, 0, 0 ) ) }
:bCellToolTip := {| oCol | { "Doble clic para abrir enlace o ejecutar Proceso", "Selecciona:" } }
END
oBrw:oCursor := oCursorBtn
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION BrwColors( oBrw, lFoot )
local cClrBack
DEFAULT lFoot := .F.
oBrw:l2007 := .F.
oBrw:nRowHeight := 24
oBrw:nHeaderHeight := 24
oBrw:lFooter := lFoot
//oBrw:lRecordSelector := .F.
//oBrw:lColDividerComplete := .F.
//oBrw:lRowDividerComplete := .F.
oBrw:lFlatStyle := .T.
oBrw:bClrHeader := { || { CLR_BLACK, CLR_WHITE, CLR_WHITE } } //RGB( 232, 255, 232 ), RGB( 232, 255, 232 ) }}
oBrw:lFullGrid := .F.
oBrw:nRowDividerStyle := LINESTYLE_NOLINES //DARKGRAY //LINESTYLE_LIGHTGRAY //
oBrw:nColDividerStyle := LINESTYLE_NOLINES //LIGHTGRAY // LINESTYLE_NOLINES
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:bClrStd = { || If( oBrw:KeyNo() % 2 == 0, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLUE ),;
RGB( 198, 255, 198 ) }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLUE ),;
RGB( 232, 255, 232 ) } ) }
oBrw:bClrSel = { || { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_WHITE ),;
RGB( 34, 177, 76 ) } } //RGB( 0x33, 0x66, 0xCC ) } }
cClrBack = Eval( oBrw:bClrSelFocus )[ 2 ]
oBrw:bClrSelFocus := { || { If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_WHITE ),;
cClrBack } }
oBrw:SetColor( CLR_BLUE, RGB( 232, 255, 232 ) )
RETURN NIL
FUNCTION Opciones( aData, oBrw )
LOCAL nOpcion := aData[ oBrw:nArrayAt, 3 ]
DO CASE
CASE nOpcion == 1
Shellexecute( 0, "Open", aData[ oBrw:nArrayAt, 2 ] )
CASE nOpcion == 2
Dos()
CASE nOpcion == 3
Tres()
ENDCASE
RETURN NIL
FUNCTION Dos()
MsgInfo( "Opción Dos" )
RETURN NIL
FUNCTION Tres()
MsgInfo( "Opción Tres" )
RETURN NIL
// FIN / END