xbrowse change bitmap in execution

xbrowse change bitmap in execution

Postby Wanderson » Tue Jun 22, 2010 7:42 pm

Hi all,

I have a xbrowse, in firt colum i have a bitmap

oCol := oBrw:AddCol()
oCol:AddResource("CHECKOFF")
oCol:AddResource("CHECKON")
oCol:bBmpData := { || 2, 1 }

oBrw:bKeyDown := {|nKey| Seleg(nkey)}

In Seleg() i have a code to check if it marked a want to change the bitmap to unmarket and vice-versa.
I try but if i choose other bitmap the all column 1 changes, i have to change just a bitmap in select line in xbrowse.
Thanks in advance.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: xbrowse change bitmap in execution

Postby ukoenig » Tue Jun 22, 2010 9:20 pm

Hello Wanderson,

This part changes the Col-Bitmap on Cell-Mouseclick from Green to Red ( from sample TESTXBRW.prg ) :

oCol := oBrw:oCol( "Married" )
oCol:SetCheck( { "GREEN", "RED" }, {|o, v| (DBRLOCK(), _FIELD->Married := v, DBUNLOCK() ) } )
oCol:bStrData := { || If( _FIELD->Married, "Yes", "No" ) }
oCol:nDataStrAlign := AL_RIGHT


Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xbrowse change bitmap in execution

Postby Wanderson » Tue Jun 22, 2010 9:26 pm

Thanks Ukoening but i want to press key M to go a funcion. In there i want to change a bmp cause i have many others thins to do if i press M.
How i can do this?

Regars.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: xbrowse change bitmap in execution

Postby Wanderson » Tue Jun 22, 2010 10:02 pm

Ukoening my code:

oCol := oBrw:AddCol()
oCol:AddResource("CHECKON")
oCol:AddResource("CHECKOFF")
oCol:cHeader := ""
oCol:bBmpData := { || iif( _FIELD->MARK, 1, 2) }
oCol:bStrData := nil
oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
* here i need to press key M and execute the function listed below


Static Function Seleciona()
******** my others codes *********
*************************************
*************************************
here i want to save _FIELD->MARK with .t. if before .f. or .f. if before .t. and i want to change a bitmap check to uncheck or vice-versa.

Thanks.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: xbrowse change bitmap in execution

Postby nageswaragunupudi » Wed Jun 23, 2010 2:34 pm

Code: Select all  Expand view
oBrw:bKeyChar := { |nKey| If( Chr(nKey) $ "Mm" .and. oBrw:nColSel == <yourcolumnnumber>, Seleciona(), nil ) }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse change bitmap in execution

Postby Wanderson » Wed Jun 23, 2010 5:08 pm

Thanks G. N. Rao.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 94 guests