Re: URLLINK + XBROWSE
Posted: Tue Feb 27, 2024 12:44 pm
+3
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
Code: Select all | Expand
oCol:bLDClickData := { || Shellexecute( 0, "Open", oCol:Value ) }
Code: Select all | Expand
oCol:bLDClickData := { || Shellexecute( 0, "Open", aInfo[oBrw:nArrayAt]["url"] ) }
Leandro en mi humilde opinión me parece excelente. Usted es muy inteligente. Cuando sea mayor quiero ser como tú. jajajajaja.leandro wrote:karinha, ninguno, así lo implementamos finalmente.Code: Select all | Expand
oCol:bLDClickData := { || Shellexecute( 0, "Open", aInfo[oBrw:nArrayAt]["url"] ) }
leandro wrote:karinha, ninguno, así lo implementamos finalmente.Code: Select all | Expand
oCol:bLDClickData := { || Shellexecute( 0, "Open", aInfo[oBrw:nArrayAt]["url"] ) }
Code: Select all | Expand
oCol:bCellToolTip := { |oCol| "Doble clic para abrir en enlace"}
Code: Select all | Expand
#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}}
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"
@ 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]
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:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
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)
//-------------------------------------------------//
Code: Select all | Expand
// 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