Problem with tget numeric

Problem with tget numeric

Postby Silvio.Falconi » Tue Jan 16, 2024 8:53 am

I have 4 get numeric where I must insert the measure on cm
but each time I have problem because the user wrong the digit and must i use the mouse to return on get and erase the data

probably picture variable is not set to the best

on the dbf I have

{ "Top", "N", 6, 2 },;
{ "Left", "N", 6, 2 },;
{ "Width", "N", 6, 2 },;
{ "Height", "N", 6, 2 },;

and on source I have

Code: Select all  Expand view
@ 70, 20  GET aGet[5] VAR nTop     OF oDlg SIZE 28, 12 PIXEL  FONT oFont   PICTURE "@Z 999.99"  UPDATE
      @ 70, 82  GET aGet[6] VAR nLeft    OF oDlg SIZE 28, 12 PIXEL  FONT oFont    PICTURE "@Z 999.99"  UPDATE
      @ 70, 245 GET aGet[7] VAR nWidth   OF oDlg SIZE 28, 12 PIXEL  FONT oFont    PICTURE "@Z 999.99"  UPDATE
      @ 70, 245 GET aGet[8] VAR nHeight  OF oDlg SIZE 28, 12 PIXEL  FONT oFont    PICTURE "@Z 999.99"  UPDATE


I must digit measure as 0,01 or 0,1 or 0,2 or 1,2 or 20,03

the small test

Code: Select all  Expand view

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

      local oDlg, aGet:= array(4), oBtn,oFont
      local nWd  := GetSysMetrics(0) * .58
      local nHt  := (GetSysMetrics(1) / 3 )


    local nTop    := 0
    local nLeft   := 0
    local nWidth  := 0
    local nHeight := 0
    local cPic  := "@Z 999.99"

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg TITLE "numeric get fast" ;
     SIZE nWd,nHt

   @ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 28, 12 PIXEL FONT oFont PICTURE cPic UPDATE  
   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 28, 12 PIXEL FONT oFont PICTURE cPic UPDATE  
   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 28, 12 PIXEL FONT oFont PICTURE cPic UPDATE  
   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 28, 12 PIXEL FONT oFont PICTURE cPic UPDATE  
   

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

   @ 120.5, 65 BUTTON "&Cancel" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End(), MsgInfo( nTest ) )

   ACTIVATE DIALOG oDlg CENTERED

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

Re: Problem with tget numeric

Postby karinha » Tue Jan 16, 2024 12:29 pm

Correct me, so I can better understand what you want to do.

Corrígeme para que pueda entender mejor lo que quieres hacer.

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, aGet := Array( 5 ), oBtn, oFont
   LOCAL nWd     := GetSysMetrics( 0 ) * .58
   LOCAL nHt     := ( GetSysMetrics( 1 ) / 3 )
   LOCAL nTop    := 0.01
   LOCAL nLeft   := 0.10
   LOCAL nWidth  := 0.20
   LOCAL nHeight := 1.20
   LOCAL cPict   := "@KR 999.99"

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg TITLE "numeric get fast" SIZE nWd, nHt

   @ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
     PICTURE cPict UPDATE

   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 120.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() ) // , MsgInfo( nTest ) ) DEFAULT QUE ES nTest?

   @ 120.5, 65 BUTTON "&Cancel" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() ) // , MsgInfo( nTest ) )

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL
 


// FIN / END
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7825
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Problem with tget numeric

Postby Silvio.Falconi » Tue Jan 16, 2024 1:07 pm

karinha wrote:Correct me, so I can better understand what you want to do.

Corrígeme para que pueda entender mejor lo que quieres hacer.

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, aGet := Array( 5 ), oBtn, oFont
   LOCAL nWd     := GetSysMetrics( 0 ) * .58
   LOCAL nHt     := ( GetSysMetrics( 1 ) / 3 )
   LOCAL nTop    := 0.01
   LOCAL nLeft   := 0.10
   LOCAL nWidth  := 0.20
   LOCAL nHeight := 1.20
   LOCAL cPict   := "@KR 999.99"

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg TITLE "numeric get fast" SIZE nWd, nHt

   @ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
     PICTURE cPict UPDATE

   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 120.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() ) // , MsgInfo( nTest ) ) DEFAULT QUE ES nTest?

   @ 120.5, 65 BUTTON "&Cancel" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() ) // , MsgInfo( nTest ) )

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL
 


// FIN / END

The measure i insert on my message are only a test
On get the user must see nothing , the get must be empty
The user can insert also1,23
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby karinha » Tue Jan 16, 2024 1:18 pm

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILVGETN.PRG

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, aGet := Array( 5 ), oBtn, oFont
   LOCAL nWd     := GetSysMetrics( 0 ) * .58
   LOCAL nHt     := ( GetSysMetrics( 1 ) / 3 )
   LOCAL nTop    := 0.00
   LOCAL nLeft   := 0.00
   LOCAL nWidth  := 0.00
   LOCAL nHeight := 0.00
   LOCAL cPict   := "@KR 999.99"

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg TITLE "numeric get fast" SIZE nWd, nHt

   @ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE                                                ;
      VALID( QUAL_ES_EL_ERRO( aGet, nTop ) )

   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
     PICTURE cPict UPDATE

   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE cPict UPDATE

   @ 120.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() )

   @ 120.5, 65 BUTTON "&Cancel" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL

FUNCTION QUAL_ES_EL_ERRO( aGet, nTop )

   ? "correct me: ", nTop

RETURN( .T. )

FIN / END
 


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

Re: Problem with tget numeric

Postby Silvio.Falconi » Tue Jan 16, 2024 4:23 pm

Here i see 0.00 on the tget
But i asked another question
On the get the user must see nothing , the tget must be empty and the user can digit a number until two decimals
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby karinha » Tue Jan 16, 2024 4:54 pm

Tell me what I have to modify in this program to make it what your user wants. Please respond in Portuguese and Spanish, as I cannot understand your English, Google Translate does not show me the reality.

Dime qué tengo que modificar en este programa para que sea lo que tu usuario quiere. Por favor responda en portugués y español, como no puedo entender su inglés, Google Translate no me muestra la realidad.

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, aGet := Array( 5 ), oBtn, oFont
   LOCAL nWd     := GetSysMetrics( 0 ) * .58
   LOCAL nHt     := ( GetSysMetrics( 1 ) / 3 )
   LOCAL nTop
   LOCAL nLeft
   LOCAL nWidth
   LOCAL nHeight
   LOCAL cAlias

   IF .NOT. FILE( "SILVGETN.DBF" )

      DbCreate( "SILVGETN.DBF", { { "TOP",    "N", 06, 02 }, ;
                                  { "LEFT",   "N", 06, 02 }, ;
                                  { "WIDTH",  "N", 06, 02 }, ;
                                  { "HEIGHT", "N", 06, 02 } } )

      CLOSE DATABASE

   ENDIF

   USE SILVGETN NEW
   GO TOP

   cAlias := ALIAS()

   nTop    := ( cAlias )->TOP
   nLeft   := ( cAlias )->LEFT
   nWidth  := ( cAlias )->WIDTH
   nHeight := ( cAlias )->HEIGHT

   SET _3DLOOK ON

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg TITLE "numeric get fast" SIZE nWd, nHt

   @ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE "@KR 999.99" UPDATE                                                ;
      VALID( QUAL_ES_EL_ERRO( aGet, nTop ) )

   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE "@KR 999.99" UPDATE

   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
     PICTURE "@KR 999.99" UPDATE

   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
      PICTURE "@KR 999.99" UPDATE

   @ 120.5, 4 BUTTON oBtn PROMPT "&Ok" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() )

   @ 120.5, 65 BUTTON "&Cancel" SIZE 45, 12 PIXEL OF oDlg ;
      ACTION ( oDlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL

FUNCTION QUAL_ES_EL_ERRO( aGet, nTop )

   ? "correct me: ", nTop

RETURN( .T. )
 


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

Re: Problem with tget numeric

Postby Otto » Tue Jan 16, 2024 5:35 pm

Chance to character:
local cTop := " "
@ 70, 20 GET aGet[1] VAR cTop OF oDlg SIZE 32, 12 PIXEL FONT oFont PICTURE "99.99"
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Problem with tget numeric

Postby Silvio.Falconi » Tue Jan 16, 2024 9:21 pm

Otto wrote:Chance to character:
local cTop := " "
@ 70, 20 GET aGet[1] VAR cTop OF oDlg SIZE 32, 12 PIXEL FONT oFont PICTURE "99.99"


I need the tget controls to enter data quickly, in a bread wholesale application where the operator must enter orders for each shop, supermarket, department store in the city and 4 codes are connected for each order because there are many types of bread and imagine for each shop the operator has to insert as many lines as the types of bread ordered, so the operation must be very fast and this operation is done every day now it is still done by hand with a pen on a paper model. It is not easy to understand the problem
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby Otto » Tue Jan 16, 2024 11:57 pm

Which device do you use for input? Touch or keboard?
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 8:03 am

Otto wrote:Which device do you use for input? Touch or keboard?


I had already created a small touch sale with categories and subcategories but the customer didn't like this type of insertion, he wants to be faithful to the old insertion he did with his pen and paper model. moreover, since the operator has to work in the oven his hands are always dirty with flour and my touch cashier is the only solution but the customer doesn't want it, what should I do?
he wants a simple table made with xbrowse and inserting for each line with the dialog takes the customer, fills in the types of bread and makes the delivery note
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 8:25 am

KArinha,
podría mostrar solo un cero a la derecha en el get y luego, si el usuario escribe un número, por ejemplo 1, y luego presiona el punto decimal, el procedimiento debe colocar hasta dos números después del punto decimal y luego pasar al otro get. No uso dbf. Obtengo los datos de un navegador y una matriz.

Otto
you could display only a zero on the right in the get and then if the user types a number for example 1 and then presses the decimal point the procedure must put up to two numbers after the decimal point and then move on to the other get

type
@ 70, 20 GET aGet[1] VAR nTop OF oDlg SIZE 28, 12 PIXEL FONT oFont ;
picture "@Z 99.99" UPDATE RIGHTTOLEFT

If I press
1
,
2
3
I must have on get "1,23" then the user must pree tab to jump to another tget

I explain good
the user press 01245 the procedure must convert into 012,45 or
the user press 12,45 and cursor must be stop on get then the user can prem tab button to jump to another tget

another sample

the user press

1
2
3
9
8
the procedure must converte it into 123,98 and stop on the tget
if the operatore press another number for a sample 7 it change the last number 123,97

I hope you understood now

How I can make it ?
at init on the get I must see " 0"
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 8:47 am

perhaps

@ 70, 20 GET aGet[1] VAR nTop OF oDlg SIZE 40, 14 PIXEL FONT oFont ;
PICTURE "@ ###,99" UPDATE RIGHT



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

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 8:53 am

Code: Select all  Expand view
@ 70, 20  GET aGet[1] VAR nTop    OF oDlg SIZE 40, 14 PIXEL FONT oFont ;
      PICTURE "@ ###,99" UPDATE RIGHT
   @ 70, 82  GET aGet[2] VAR nLeft   OF oDlg SIZE 40, 14 PIXEL FONT oFont ;
       PICTURE "@ ###,99" UPDATE RIGHT
   @ 70, 205 GET aGet[3] VAR nWidth  OF oDlg SIZE 40, 14 PIXEL FONT oFont ;
      PICTURE "@ ###,99" UPDATE RIGHT
   @ 70, 265 GET aGet[4] VAR nHeight OF oDlg SIZE 40, 14 PIXEL FONT oFont ;
       PICTURE "@ ###,99" UPDATE RIGHT


IT SEEM RUN OK NOW

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

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 9:08 am

la solución que encontré no es buena porque cuando retomo los datos fivewin se actualiza al máximo
entonces, si los datos son 0,75 |0,20|3,60|0,50, los convierte a
1|0|4|1 y eso no es bueno

the solution I found is not good because when I resume the data fivewin updates to the full
so if the data is 0.75 |0.20|3.60|0.50 he converts to
1|0|4|1 and that's not good



If I made "@E 9,999.99" then it good when return 0.75 |0.20|3.60|0.50 but at new add I see 0.00 on get and no good
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with tget numeric

Postby Silvio.Falconi » Wed Jan 17, 2024 10:09 am

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oGet
   local nVar :=0 // 0.75
   local aGet:= array(2)

   SetGetColorFocus()

   DEFINE DIALOG oDlg SIZE 400,150 PIXEL TRUEPIXEL TITLE FWVERSION

   @ 20,20 GET aGet[1] VAR nVar   SIZE 100,24 PIXEL OF oDlg RIGHT  ;
    VALID   ChangePic( oDlg, aGet )


   ACTIVATE DIALOG oDlg CENTERED

   return nil

   
   static function ChangePic( oDlg, aGet )

   WITH OBJECT aGet[ 2 ]
      if !( ".99" $ :cPicture )
         :cPicture := ;
         :oGet:picture := "999.999"
         :Refresh()
      endif
   END

return .t.







 



at init go good but then non put the comma after 3 if I digit 12345
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests