FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour To Mr Rao
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
To Mr Rao
Posted: Sat Dec 15, 2018 08:32 PM
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: To Mr Rao
Posted: Sun Dec 16, 2018 11:51 PM
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBrw

   USE CUSTOMER

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST", "AGE", "SALARY" ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :nRowHeight    := 30
      WITH OBJECT :Age
         :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| oCol:VarPut( oCol:Value - 1 ) }
      END

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: To Mr Rao
Posted: Mon Dec 17, 2018 07:56 AM

Thanks Mr Rao

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: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: To Mr Rao
Posted: Mon Dec 17, 2018 03:39 PM
Nages,
the first button is transparent , the second no , why ?

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: To Mr Rao
Posted: Mon Dec 17, 2018 04:38 PM
Do not change bBmpAction.

Use
Code (fw): Select all Collapse
bCalcRow := { || oBrw:aCols[ 5 ]:VarPut( oBrw:aCols[ 3 ]:Value * oBrw:aCols[ 4 ]:Value ) }
oBrw:aCols[ 3 ]:bOnChange := bCalcRow
oBrw:aCols[ 4 ]:bOnChange := bCalcRow

XBrowse recalculates totals automatically
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: To Mr Rao
Posted: Mon Dec 17, 2018 05:11 PM
ok but there is a problem


if I press - it can go to zero and then -1

How I can to insert MIN and Max as get spinner ?
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: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: To Mr Rao
Posted: Mon Dec 17, 2018 05:32 PM

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

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