xbrowse check and unckeck

xbrowse check and unckeck

Postby Wanderson » Tue May 26, 2015 2:42 pm

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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: xbrowse check and unckeck

Postby Antonio Linares » Tue May 26, 2015 5:42 pm

Here you have an example:

Code: Select all  Expand view
  WITH OBJECT oBrw:InsCol( 1 )
      :cHeader    := "Selected"
      :SetCheck( { "blackdot", nil }, .t. )
      :bKeyChar   := { |k| If( k == 32, ( oBrw:oCol( 1 ):CheckToggle(), 0 ), nil ) }
   END


But I think that it should use a logical value instead of a zero
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xbrowse check and unckeck

Postby Wanderson » Tue May 26, 2015 5:52 pm

Antonio Linares wrote:Here you have an example:

Code: Select all  Expand view
  WITH OBJECT oBrw:InsCol( 1 )
      :cHeader    := "Selected"
      :SetCheck( { "blackdot", nil }, .t. )
      :bKeyChar   := { |k| If( k == 32, ( oBrw:oCol( 1 ):CheckToggle(), 0 ), nil ) }
   END


But I think that it should use a logical value instead of a zero


Hi thank you Antonio,

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
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: xbrowse check and unckeck

Postby karinha » Tue May 26, 2015 6:42 pm

Code: Select all  Expand view

   // Testxbrw.prg y testxbrw.rc
   oCol:SetCheck( { "GREEN", "RED" }, {|o, v| (DBRLOCK(), _FIELD->Married := v, DBUNLOCK() ) } )
 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xbrowse check and unckeck

Postby Francisco Horta » Tue May 26, 2015 9:22 pm

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
____________________
Paco
Francisco Horta
 
Posts: 845
Joined: Sun Oct 09, 2005 5:36 pm
Location: la laguna, mexico.


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests