xbrowse picture for string with percentual field

xbrowse picture for string with percentual field

Postby Silvio.Falconi » Thu Nov 06, 2014 12:15 pm

I wish insert a picture with "%" into a column of a xbrowse as this:

Image

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 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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse picture for string with percentual field

Postby Silvio.Falconi » Sun Nov 09, 2014 6:24 pm

Any solution ?
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse picture for string with percentual field

Postby Armando » Sun Nov 09, 2014 6:54 pm

Silvio:

Just an idea.

Using the VALID method you can do this:

Code: Select all  Expand view

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
User avatar
Armando
 
Posts: 3085
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: xbrowse picture for string with percentual field

Postby Silvio.Falconi » Sun Nov 09, 2014 8:38 pm

Armando I'm using a xbrowse
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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse picture for string with percentual field

Postby Armando » Sun Nov 09, 2014 8: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
User avatar
Armando
 
Posts: 3085
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: xbrowse picture for string with percentual field

Postby Silvio.Falconi » 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 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: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse picture for string with percentual field

Postby nageswaragunupudi » Tue Nov 11, 2014 2:32 pm

Code: Select all  Expand view

oCol:bEditValue := { |x| If( x == nil, ( oBrw:cAlias )->SCONTI, (oBrw:cAlias)->SCONTI := RemRight( x, "%" ) + "%" ) }
 
Regards

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

Re: xbrowse picture for string with percentual field

Postby Silvio.Falconi » 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: Select all  Expand view

  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 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: 6849
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests