Problem With Tget Numeric

Problem With Tget Numeric

Postby Silvio.Falconi » Mon May 27, 2024 8:00 am

Image

on field I set

{ "DimX" ,"N", 9,1 } ,;

Please see this small test
Code: Select all  Expand view
#include 'fivewin.ch'

function Main()
   local oDlg, oGet, oBtn
   local lTest := .t.
   local cPicture :=  "@E #######.#"
   local nDimx:= 0, nDimy:= 0, nDimz:= 0

   SET _3DLOOK ON

   DEFINE DIALOG oDlg TITLE "A simple GET" ;
      FROM 2, 2 TO 11, 40

   @ 1.5, 2 GET oGet VAR nDimX SIZE 120, 13 OF oDlg RIGHT PICTURE cPicture

 

   @ 2.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 OF oDlg ;
      ACTION ( oDlg:End(), MsgInfo( nDimX ) ) DEFAULT

   @ 2.5, 15 BUTTON "&Cancel" SIZE 45, 12 OF oDlg ;
      ACTION ( oDlg:End(), MsgInfo( nDimx ) )

   ACTIVATE DIALOG oDlg CENTERED

return nil




the test run ok and It is the picture I wish

only at init I with the get ( empty) must be 0 instead of 0.0

I tried also with FWNumFormat( "E", .t. )

How I can resolve ?
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: 6866
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem With Tget Numeric

Postby karinha » Mon May 27, 2024 12:31 pm

Mira se ayuda:

Code: Select all  Expand view

#include 'fivewin.ch'

FUNCTION Main()

   LOCAL oDlg, oGet, oBtn
   LOCAL lTest := .T.
   //LOCAL cPicture :=  "@E ##,###,###.#" // ALPHA/NUMERIC-SOLO PRUEBA
   LOCAL cPicture :=  "@E ########.#"
   LOCAL nDimx := 0, nDimy := 0, nDimz := 0

   SET _3DLOOK ON

   DEFINE DIALOG oDlg TITLE "A simple GET" ;
      FROM 2, 2 TO 11, 40

   @ 1.5, 2 GET oGet VAR nDimX SIZE 120, 13 OF oDlg RIGHT PICTURE cPicture ;
      VALID( LIMPIA_GET_SIL( oGet ) )

   @ 2.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 OF oDlg ;
      ACTION ( oDlg:End(), MsgInfo( nDimX ) ) DEFAULT

   @ 2.5, 15 BUTTON "&Cancel" SIZE 45, 12 OF oDlg ;
      ACTION ( oDlg:End(), MsgInfo( nDimx ) )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT( INIT_GET_SIL( oGet ) )

RETURN NIL

FUNCTION INIT_GET_SIL( oGet )

   LOCAL cPict := "        .0" // + SPACE(99)

   oGet:VARPUT( cPict )
   oGet:Refresh()

RETURN NIL

FUNCTION LIMPIA_GET_SIL( oGet )

   LOCAL cPict := "        .0" // + SPACE(99) GET ALPHA.

   IF GETASYNCKEY( VK_UP )

      oGet:VARPUT( cPict )
      oGet:Refresh()

      RETURN( .T. )

   ENDIF

RETURN( .F. )

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7392
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 29 guests