FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse picture for string with percentual field
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
xbrowse picture for string with percentual field
Posted: Thu Nov 06, 2014 12:15 PM
I wish insert a picture with "%" into a column of a xbrowse as this:



Note : the final user inser a string (max 10 CR) not a number !!

How I can make to replace the record with percetual symbol at the end if the record is changed ?
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: xbrowse picture for string with percentual field
Posted: Sun Nov 09, 2014 06:24 PM

Any solution ?

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: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: xbrowse picture for string with percentual field
Posted: Sun Nov 09, 2014 06:54 PM
Silvio:

Just an idea.

Using the VALID method you can do this:

Code (fw): Select all Collapse
STATIC cUserVar
....
....
....

        REDEFINE GET aGets[ 2] VAR cUserVar ID 102 OF oDlg UPDATE;
            PICTURE "@K";
            VALID ChgStr(oDlg)
....
....

STATIC FUNCTION ChgStr()
   IF ! EMPTY(ALLTRIM(cUserVar))
          cUserVar := ALLTRIM(cUserVar) + "%"
   ENDIF
   oDlg:Update()
RETURN(.T.)


Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse picture for string with percentual field
Posted: Sun Nov 09, 2014 08:38 PM

Armando I'm using a xbrowse

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: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: xbrowse picture for string with percentual field
Posted: Sun Nov 09, 2014 08:57 PM

Silvio:

Ouch, I'm not expert in xBrowse class, but I remember xBrowse has POSTEDIT method
then you can use my previous idea with that method.

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse picture for string with percentual field
Posted: Mon Nov 10, 2014 12:20 AM

I tried with bOnChange method but it not run ok or I not Know how set the right variable

sample
:bOnChange := { |oCol, uOldVal| MyFuncOnChange( oCol, uOldVal ) }

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: xbrowse picture for string with percentual field
Posted: Tue Nov 11, 2014 02:32 PM
Code (fw): Select all Collapse
oCol:bEditValue := { |x| If( x == nil, ( oBrw:cAlias )->SCONTI, (oBrw:cAlias)->SCONTI := RemRight( x, "%" ) + "%" ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse picture for string with percentual field
Posted: Wed Nov 12, 2014 10:51 AM
thanks... I not Know remright .func.is xharbour ?

perhaps I made some errors because here not run also
When iinsert sample "50+30+3" it not replace the symbol % at the end

Code (fw): Select all Collapse
  aBrowse     :=  {{"PAITEM"      ,i18n("Codice")       ,nil                  ,50 },;
                        { "PADESC"      ,i18n("Descrizione")  ,nil                 ,160 },;
                        { "PAQTY"       ,i18n("Quantità")     ,"9999"               ,60 },;
                        { "PAMISURA"    ,i18n("Misura")       ,nil                  ,60 },;
                        { "PAUNITARIO"  ,i18n("Unitario")     ,pict_money_Euro      ,80 },;
                        { "PASCONTO"    ,i18n("%Sconto")       , nil                 ,80 },;
                        { "PAPROVV"     ,i18n("%Provv.")      ,'@ 999.99%'          ,60 },;
                        { "PAIVA"       ,i18n("Iva")          ,"99%"                ,40 },;
                        { "PATOTALE"    ,i18n("Importo")      ,pict_money_Euro      ,80 }}



 @ 0, 0 XBROWSE oBrw       ;
      OF oFld:adialogs[1] DATASOURCE "TB" ;
      COLUMNS aBrowse CELL LINES  FOOTERS NOBORDER



.....




 WITH OBJECT  oBrw:aCols[6]
               :nEditType := EDIT_GET
               :nDataStrAlign := AL_RIGHT
             [b]  :bEditValue := { |x| If( x == nil, ( oBrw:cAlias )->PASCONTO, (oBrw:cAlias)->PASCONTO := RemRight( x, "%" ) + "%" ) }[/b]
            END
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