Gracias por tu interés.
Aqui dejo un ejemplo funcional sobre el avance que he logrado hasta el momento.
Talvez el resto de colegas quiera colaborar en perfeccionarlo. Recuerden hacer las pequeñas modificaciones a Class TxBrowse expuestas mas arriba.
Code: Select all | Expand
//PROBANDO
//-----------------------Pruebas Clr Row when mouse over
Function ClrRowMOver()
local oDlg, oBrw, oCbx, oBt2
local nWidthRes := GetSysMetrics(SM_CXSCREEN)
local nHeightRes := GetSysMetrics(SM_CYSCREEN)
local aInfo:={}, aTitCols:={}, aWMIscan, bMonitoring
local cVar, nPos:=1, n, oSayPrueba,cSayPrueba:=" "
local nFONDO1 := RGB(215, 215, 215)
local nFONDO2 := RGB(235, 235, 235)
local nAZUL := RGB( 0, 0, 128)
local oLoc, oWMI
TRY
oLoc:= CreateObject( "wbemScripting.SwbemLocator" )
CATCH
MsgStop("No se pudo crear objeto 'wbemScripting.SwbemLocator'","Alto")
Quit
END
TRY
oWMI := oLoc:ConnectServer()
CATCH
MsgStop("No se pudo conectar a WMI","Alto")
Quit
END
bMonitoring := {|| aWMIscan:=Monitoring(oWMI,18) ,;
aInfo:=aWMIscan[1], aTitCols:=aWMIscan[2],;
oBrw:SetArray(aInfo,.t.,1,.t.),;
oBrw:cHeaders := aTitCols, ;
oBrw:nHeadStrAligns := AL_CENTER, ;
AEval(oBrw:aCols,{|o,n,oCol| if(ValType(o:Value) =="N", o:nWidth := Max( 40, oBrw:aCols[n]:HeaderWidth() ), o:nWidth:=160) }),;
oBrw:nColSel := 1, oBrw:Refresh(.t.),;
oBrw:SetFocus() }
DEFINE DIALOG oDlg SIZE nWidthRes-100, nHeightRes-100 TITLE "FapSoftScan" TRANSPARENT
@oDlg:nTop+5,200 SAY oSayPrueba VAR cSayPrueba OF oDlg SIZE 100,20 PIXEL
@1,1 XBROWSE oBrw OF oDlg ;
ARRAY {} CELL LINES FOOTERS AUTOSORT
WITH OBJECT oBrw
:l2007 := .f.
:nRecSelColor := nFONDO1
:nStyle := nAnd( :nStyle, nNot( WS_BORDER ) )
:nMarqueeStyle := MARQSTYLE_HIGHLROW //ilumina toda la linea
:bClrHeader := {|| { nAZUL, nFONDO1, } }
:bClrFooter := :bClrHeader // Colores texto de footers
:bClrStd := {|| IF( oBrw:nArrayAt() % 2 == 0, {nAZUL, nFONDO1}, {nAZUL, nFONDO2} ) }
:bClrSel := {|| { nAZUL, CLR_WHITE } } // para barra de linea selecc cuando el control no tiene el foco
:bClrSelFocus := { || { CLR_WHITE, nAZUL } } // para barra de linea selecc cuando el control tiene el foco
:lKinetic := .f.
:lContrastClr := .f. //para que no cambie color de texto automaticamente segun intensidad del fondo
:nRowHeight := 20
:nHeaderHeight := 34
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
END
oBrw:CreateFromCode()
Eval(bMonitoring)
oBrw:bMMoved := {|nRow,nCol| ClrRowMouseOver(oBrw,nRow,nCol,oSayPrueba) }
@ oDlg:nTop+245,380 BUTTONBMP oBt2 PROMPT "Salir/Cancelar" OF oDlg ;
SIZE 60, 12 PIXEL ;
BITMAP "SALIR16x16" TEXTRIGHT ;
ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oBrw:nHeight:=oDlg:nHeight-118, oBrw:nWidth:=oDlg:nWidth-34, oBrw:nTop:=oDlg:nTop+50 ,;
oBrw:SetFocus() )
Return nil
//-------------------------------------------------------------
Function Monitoring(oWMI)
local oPC, oQry
local aInfo:={}, aTitCols, n,nLen
oQry := oWMI:ExecQuery( "Select * FROM Win32_LogicalProgramGroup" )
aTitCols:= {"Caption","Description","GroupName","Name","UserName","InstallDate","Status"}
for each oPC in oQry
aadd(aInfo, {oPC:Caption, oPC:Description, oPC:GroupName, oPC:Name, oPc:UserName, oPc:InstallDate, oPc:Status} )
next
//Agregar columna para numerar consecutivo
Aadd(aTitCols,nil)
AIns(aTitCols,1)
aTitCols[1]:="No. "
For n := 1 to len(aInfo)
Aadd(aInfo[n],nil)
AIns(aInfo[n],1)
aInfo[n,1] := n
Next
RETURN {aInfo,aTitCols}
//---------------------------------------
Function ClrRowMouseOver(oBrw,nRow,nCol,oSayPrueba)
local n
local nRowMPos := oBrw:MouseRowPos(nRow) //linea en que esta el mouse en display actual
local bClrStd := oBrw:bClrStd
local oCol
oSayPrueba:SetText("Lin: "+Str(nRowMPos,4))
if nRowMPos > 0
For n := 1 to len(oBrw:aCols)
oCol:= oBrw:aCols[n]
oCol:bClrStd := CellClrMOver( oCol, nRowMPos, bClrStd, oBrw )
Next
oBrw:Refresh()
endif
Return nil
//------------------------------------
STATIC function CellClrMOver( oCol, nRowMPos, bClrStd, oBrw )
local nRow
RETURN { || nRow := oBrw:aCols[1]:Value ,;
If( nRow == nRowMPos ,;
{ CLR_BLUE, CLR_YELLOW }, Eval(bClrStd) ) }
Saludos.