FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get decimal picture
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Get decimal picture
Posted: Fri May 17, 2013 07:47 PM
Samir,

Well this code is working fine for me.

James

Code (fw): Select all Collapse
/*
Purpose: Test changing picture clause
Problem: Last digit is zero regardless of what you type (oGet[2])
Date   : 5/17/2013
Source : <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=26282&p=144993#p144993">viewtopic.php?f=3&t=26282&p=144993#p144993</a><!-- l -->

*/

#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.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Fri May 17, 2013 09:12 PM
Code (fw): Select all Collapse
****************************************************************************
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Get decimal picture
Posted: Fri May 17, 2013 09: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Get decimal picture
Posted: Fri May 17, 2013 09: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
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 12:48 PM
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: Get decimal picture
Posted: 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

Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 01:57 PM

This return:
1,234,567.89

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Get decimal picture
Posted: Mon May 20, 2013 02: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Get decimal picture
Posted: Mon May 20, 2013 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 06: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Get decimal picture
Posted: Mon May 20, 2013 06: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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 06: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
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 06: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
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Get decimal picture
Posted: Mon May 20, 2013 06: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Get decimal picture
Posted: Fri Jul 12, 2013 07:10 PM

Hello Samir,
can you please post the Workaround.
Thanks in advance
Otto