FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem to assign value on Xbrowse
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem to assign value on Xbrowse
Posted: Sun Jun 09, 2019 04:19 PM
I have this row


if Press "-" the value become 0 I wish the value is 1 if the value is 0
this the code
Code (fw): Select all Collapse
 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:= 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 March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem to assign value on Xbrowse
Posted: Sun Jun 09, 2019 05:03 PM
Code (fw): Select all Collapse
:bBmpAction := { |oCol| oCol:VarPut( Max( 1, oCol:Value - 1 ) ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem to assign value on Xbrowse
Posted: Sun Jun 09, 2019 09: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 March-April 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

Continue the discussion