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 ?
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.)
oCol:bEditValue := { |x| If( x == nil, ( oBrw:cAlias )->SCONTI, (oBrw:cAlias)->SCONTI := RemRight( x, "%" ) + "%" ) }
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 43 guests