Get decimal picture

Re: Get decimal picture

Postby James Bott » Fri May 17, 2013 7:47 pm

Samir,

Well this code is working fine for me.

James

Code: Select all  Expand view
/*
Purpose: Test changing picture clause
Problem: Last digit is zero regardless of what you type (oGet[2])
Date   : 5/17/2013
Source : viewtopic.php?f=3&t=26282&p=144993#p144993

*/


#include "fivewin.ch"

****************************************************************************
FUNCTION Main()
****************************************************************************

   Local oDlgMsg
   Local oGet := Array(2), cGet := Array(2)

   cGet[1] := Space(10)
   cGet[2] := 1

   DEFINE DIALOG  oDlgMsg;
          FROM    10, 20 TO 20, 60

   @ 1.6,  2.0 GET      oGet[1];
               Var      cGet[1];
               picture  "@!";
               SIZE     80, 12;
               OF       oDlgMsg;
               Valid    ChangePicture(oGet)

   @ 2.6,  2.0 GET      oGet[2];
               Var      cGet[2];
               picture  "99,999.99";
               SIZE     80, 12;
               OF       oDlgMsg;
               UPDATE

   @ 3.6, 14.0 ButtonBmp;
               SIZE      45, 13;
               ACTION    oDlgMsg:End();
               OF        oDlgMsg;
               TEXTRIGHT;
               prompt    "Exit"

   oDlgMsg:lHelpIcon := .f.

   ACTIVATE DIALOG oDlgMsg CENTERED

RETURN nil
/*------------------------------------------------------------------------*/

Function ChangePicture(oGet)
Local cPicture := "99,999.999"

   oGet[2]:cPicture := cPicture
   oGet[2]:oGet:Picture := cPicture
   oGet[2]:Refresh()
msgbeep()
Return  .T.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Get decimal picture

Postby sambomb » Fri May 17, 2013 9:12 pm

Code: Select all  Expand view

****************************************************************************
static procedure Teste()
****************************************************************************
*
*
* Parametros:
* Retorno: Nenhum
*
* Autor: Samir
* 17/05/2013 - 17:46:35
*
****************************************************************************
Local oDlgMsg
Private oGet := Array(2), cGet := Array(2), oSay

   cGet[1] := Space(10)
   cGet[2] := 1

   DEFINE DIALOG  oDlgMsg;
          FROM    10, 20 TO 20, 60

   @ 0.6,  2.0 Say      oSay;
               Prompt   "";
               SIZE     80, 12;
               OF       oDlgMsg

   @ 1.6,  2.0 GET      oGet[1];
               Var      cGet[1];
               picture  "@!";
               SIZE     80, 12;
               OF       oDlgMsg;
               Valid    ChangePicture()

   @ 2.6,  2.0 GET      oGet[2];
               Var      cGet[2];
               picture  "99,999.99";
               SIZE     80, 12;
               OF       oDlgMsg;
               UPDATE

   oGet[2]:bKeyDown := {|nKey| LogSay( nKey ) }

   @ 3.6, 14.0 ButtonBmp;
               SIZE      45, 13;
               ACTION    oDlgMsg:End();
               OF        oDlgMsg;
               TEXTRIGHT;
               prompt    "Exit"

   oDlgMsg:lHelpIcon := .f.

   ACTIVATE DIALOG oDlgMsg CENTERED

RETURN nil

/*------------------------------------------------------------------------*/

Function ChangePicture()
Local cPicture := "99,999.999"

   oGet[2]:cPicture := cPicture
   oGet[2]:oGet:Picture := cPicture
   oGet[2]:Refresh()

Return  .T.

procedure LogSay(nKey)

   If nKey >= 32 .And. nKey <= 126
      oSay:SetText( oSay:cCaption + Chr(nKey) )
   Else
      oSay:SetText( oSay:cCaption + "["+StrZero(nKey,3)+"]" )
   End

Return Nil

/*------------------------------------------------------------------------*/
 


See the video below

http://alanart.net/fivewin/index.php?/f ... e-erro.zip
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby James Bott » Fri May 17, 2013 9:48 pm

Samir,

The download link says I don't have permission.

I did compile and run your last example and it is working fine for me. I typed 12345.678 and the field shows the same thing that I typed.

I am running FWH 13.04 (the latest). Maybe you are running an older version, or I still don't understand the problem.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Get decimal picture

Postby Antonio Linares » Fri May 17, 2013 9:49 pm

I missed this thread, and now I am reading it. I tested it as James comments and it seems to work fine.

If we could see the video then we could compare their behaviors
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get decimal picture

Postby sambomb » Mon May 20, 2013 12:48 pm

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby kok joek hoa » Mon May 20, 2013 12:59 pm

Dear Sambomb

try this :

Function ChangePicture()
Local cPicture := "99,999.999" /// change this line with '9,999,999.999'

oGet[2]:cPicture := cPicture
oGet[2]:oGet:Picture := cPicture
oGet[2]:Refresh()

Return .T.

regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: Get decimal picture

Postby sambomb » Mon May 20, 2013 1:57 pm

This return:
1,234,567.89
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby Antonio Linares » Mon May 20, 2013 2:01 pm

Samir,

Your PICTURE only allows 8 digits. If you want it to accept 9 digits, then you should use 9,999,999.99
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get decimal picture

Postby James Bott » Mon May 20, 2013 2:34 pm

Samir,

Your latest code posting works fine here (with FWH 13.04). I see from your signature line you are using some very old versions of FWH. Perhaps it is time to update.

I sent a copy of the working EXE to your hotmail account.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Get decimal picture

Postby sambomb » Mon May 20, 2013 6:00 pm

Antonio Linares wrote:Samir,

Your PICTURE only allows 8 digits. If you want it to accept 9 digits, then you should use 9,999,999.99

Linares, the old picture accept 8 digits, the new one accecpt 9, it's changed in the Valid clause of the first Get.
Uwe, I alredy scheduled the migration but I can't find enough time to do it.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby James Bott » Mon May 20, 2013 6:20 pm

Samir,

I already scheduled the migration but I can't find enough time to do it.


I just did it a few weeks ago and it only took me a couple of hours.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Get decimal picture

Postby nageswaragunupudi » Mon May 20, 2013 6:31 pm

I posted a sample earlier. The samples proves beyond any doubt that changing get picture dynamically during execution works flawlessly.

Probably your problem is with older versions.
Regards

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

Re: Get decimal picture

Postby sambomb » Mon May 20, 2013 6:31 pm

James Bott wrote:Samir,

I already scheduled the migration but I can't find enough time to do it.


I just did it a few weeks ago and it only took me a couple of hours.

James


Whats the version before?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby sambomb » Mon May 20, 2013 6:35 pm

nageswaragunupudi wrote:I posted a sample earlier. The samples proves beyond any doubt that changing get picture dynamically during execution works flawlessly.

Probably your problem is with older versions.


I i'm thinking the same, did you take a look at the workaround that I found?
Remove the focus from the get and return solve the problem.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Get decimal picture

Postby Otto » Fri Jul 12, 2013 7:10 pm

Hello Samir,
can you please post the Workaround.
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests