help for xbrowse

help for xbrowse

Postby Silvio » Sat Nov 20, 2010 12:00 pm

I want click with mouse on a record of xbrowse and change the bitmap

oCol:= oApp():oGrid3:AddCol()
oCol:AddBmpFile(".\BITMAPS\GRID\hand.BMP")
oCol:AddBmpFile(".\BITMAPS\GRID\handno.BMP")
oCol:bBmpData := { || Desp_Per()}
*oCol:bStrData := { || Desp_Per()}
oCol:cHeader := "Permesso"
oCol:nWidth := 100
oCol:oDataFont := oFontGrid

...

oApp():oGrid3:bLDblClick:={|| Asigna()}


STAT FUNC Desp_Per(cbmp)
LOCAL cPer:=IF((oDPer)->Permesso,1,2)
RETURN (cPer)

STAT FUNC Asigna()
IF lABC .AND. !Occupato(oDPer)
(oDPer)->Permesso:=!(oDPer)->Permesso
IF (oDPer)->Permesso
(oDPer)->ABC:=(oDPer)->Tipo
ELSE
(oDPer)->ABC:=""
ENDIF
(oDPer)->(DbUnlock())
Refr_Btn()
ENDIF
oApp:oGrid3:SetFocus()
RETURN (NIL)




Sometimes run sometimes not run ok why ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: help for xbrowse

Postby jll-fwh » Sat Nov 20, 2010 6:23 pm

Hola Silvio:

oGrid:aCols[1]:AddResource("ON")
oGrid:aCols[1]:AddResource("OFF")
oGrid:aCols[1]:cHeader := ""+CRLF+"Est"
oGrid:aCols[1]:nHeadStrAlign := 2 // Alineacion: 1.- derecha 2.- centrado 3.- izquierda
oGrid:aCols[1]:nHeadBmpAlign := 2
oGrid:aCols[1]:nWidth := 25
oGrid:aCols[1]:bBmpData := {|| IIF( oGrid:aRow[10] == 1, 1, 2 ) }

En este ejemplo haria lo siguiente, se le asiganan dos BMP, en funcion si la columna 10, pondria el ON o el OFF.

Un saludo
JLL
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia

Re: help for xbrowse

Postby Silvio » Sat Nov 20, 2010 9:36 pm

sorry but
I must make a procedure to set access user login
i need the procedure to click with mouse to set if the user have a access free or not

oApp():oGrid3:bLDblClick:={|| Asigna()}
oApp():oGrid3:bKeyDown:={|nKey| IF(nKey=VK_RETURN,Asigna(),IF(nKey=VK_F5,Cambia(),))}


STAT FUNC Asigna()
IF lABC .AND. !Occupato(oDPer)
(oDPer)->Permesso:=!(oDPer)->Permesso
IF (oDPer)->Permesso
(oDPer)->ABC:=(oDPer)->Tipo
ELSE
(oDPer)->ABC:=""
ENDIF
(oDPer)->(DbUnlock())
Refr_Btn()
oApp:oGrid3:DrawSelect()
ENDIF
oApp:oGrid3:SetFocus()
RETURN (NIL)






this sometimes run sometimes not
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 41 guests