FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse change bitmap in execution
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
xbrowse change bitmap in execution
Posted: Tue Jun 22, 2010 07: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.

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: xbrowse change bitmap in execution
Posted: Tue Jun 22, 2010 09: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 :-)
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.
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: xbrowse change bitmap in execution
Posted: Tue Jun 22, 2010 09: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.

Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: xbrowse change bitmap in execution
Posted: 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.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse change bitmap in execution
Posted: Wed Jun 23, 2010 02:34 PM
oBrw:bKeyChar := { |nKey| If( Chr(nKey) $ "Mm" .and. oBrw:nColSel == <yourcolumnnumber>, Seleciona(), nil ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: xbrowse change bitmap in execution
Posted: Wed Jun 23, 2010 05:08 PM

Thanks G. N. Rao.

Continue the discussion