Problem to assign value on Xbrowse

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Problem to assign value on Xbrowse

Post by Silvio.Falconi »

I have this row
Image

if Press "-" the value become 0 I wish the value is 1 if the value is 0
this the code

Code: Select all

 WITH OBJECT oBrowse:aCols[ 3]
          :nWidth        := 100
          :nDataStrAlign := AL_CENTER
          :AddBitmap( { FW_BmpPlus(), FW_BmpMinus() } )

          // Right Button
         :nEditType     := EDIT_BUTTON
         :bEditBlock    := { |r,c,oCol| oCol:Value + 1 }
         :nBtnBmp       := 1
         :lBtnTransparent  := .t.

         // Left Button
         :bBmpData      := { |v,lSel| If( lSel, 2, 0 ) }
         :bBmpAction    := { |oCol| IIF( oCol:Value>0,oCol:VarPut( oCol:Value - 1 ),) }

                 :bOnChange := bCalcRow

        END

I allready tried with
:bBmpAction := { |oCol| IIF( oCol:Value>0,oCol:VarPut( oCol:Value - 1 ),oCol:VarPut(1)) }

or
:bBmpAction := { |oCol| IIF( oCol:Value>0,oCol:VarPut( oCol:Value - 1 ),oCol:VarPut(oCol:Value:= 1)) }
or
:bBmpAction := { |oCol| IIF( oCol:Value>0,oCol:VarPut( oCol:Value - 1 ),1) }

with no success!!!

the value cannot be zero

any solution please ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem to assign value on Xbrowse

Post by nageswaragunupudi »

Code: Select all

:bBmpAction := { |oCol| oCol:VarPut( Max( 1, oCol:Value - 1 ) ) }
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to assign value on Xbrowse

Post by Silvio.Falconi »

thanks rao...

how adjust the btnbmp " + " do you see the white background ?

it seem more small than the other button "-"
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply