Hi
I have a xbrowse with an empty array at any given time will fill this array with data and the first column to 0 for unchecked record. How to set this column with bitmap check and unckeck when clicked?
Thanks.
xbrowse check and unckeck
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: xbrowse check and unckeck
Here you have an example:
But I think that it should use a logical value instead of a zero
Code: Select all
WITH OBJECT oBrw:InsCol( 1 )
:cHeader := "Selected"
:SetCheck( { "blackdot", nil }, .t. )
:bKeyChar := { |k| If( k == 32, ( oBrw:oCol( 1 ):CheckToggle(), 0 ), nil ) }
END
Re: xbrowse check and unckeck
Hi thank you Antonio,Antonio Linares wrote:Here you have an example:
But I think that it should use a logical value instead of a zeroCode: Select all
WITH OBJECT oBrw:InsCol( 1 ) :cHeader := "Selected" :SetCheck( { "blackdot", nil }, .t. ) :bKeyChar := { |k| If( k == 32, ( oBrw:oCol( 1 ):CheckToggle(), 0 ), nil ) } END
I use xbrowse with resource please tell me how i do in this case:
oCol := oBrwc:AddCol()
oCol:AddResource( "UNCHECK" )
oCol:AddResource( "CHECK" )
oCol:SetCheck( { "CHECK", nil }, .t. )
oCol:lBmpStretch := .f.
oCol:lBmpTransparent := .t.
oCol:nHeadStrAlign := oCol:nDataBmpAlign := AL_CENTER
oCol:cHeader := ""
oCol:nWidth := 18
oCol:nArrayCol := 1
Re: xbrowse check and unckeck
Code: Select all
// Testxbrw.prg y testxbrw.rc
oCol:SetCheck( { "GREEN", "RED" }, {|o, v| (DBRLOCK(), _FIELD->Married := v, DBUNLOCK() ) } )
João Santos - São Paulo - Brasil
-
- Posts: 845
- Joined: Sun Oct 09, 2005 5:36 pm
- Location: la laguna, mexico.
Re: xbrowse check and unckeck
Wanderson,
myarray := { { 1, .t., "Hello" }, {2, .f., "World" } }
oBrw:aCols[2]:AddBmpHandle( "Chk_T" )
oBrw:aCols[2]:AddBmpHandle( "Chk_F" )
oCol:bBmpData := {|| IF( myArray[ oBrw:nArrayAt, 2], 1, 2) }
oCol:bStrData := { || Nil }
Regards
Paco
myarray := { { 1, .t., "Hello" }, {2, .f., "World" } }
oBrw:aCols[2]:AddBmpHandle( "Chk_T" )
oBrw:aCols[2]:AddBmpHandle( "Chk_F" )
oCol:bBmpData := {|| IF( myArray[ oBrw:nArrayAt, 2], 1, 2) }
oCol:bStrData := { || Nil }
Regards
Paco
____________________
Paco
Paco