Problem to assign value on Xbrowse

Problem to assign value on Xbrowse

Postby Silvio.Falconi » Sun Jun 09, 2019 4:19 pm

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  Expand view  RUN
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to assign value on Xbrowse

Postby nageswaragunupudi » Sun Jun 09, 2019 5:03 pm

Code: Select all  Expand view  RUN
:bBmpAction := { |oCol| oCol:VarPut( Max( 1, oCol:Value - 1 ) ) }
 
Regards

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

Re: Problem to assign value on Xbrowse

Postby Silvio.Falconi » Sun Jun 09, 2019 9:07 pm

thanks rao...

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

it seem more small than the other button "-"
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, Surasak and 33 guests