How do I set the numeric format
Can I detect if the ENTER key is pressed in a GET, so I can perform an action on this
How do I detect a change of GET, like every key-stroke and perform an action.
I have a window with several GETs but don't get the desired result
Code: Select all
#DEFINE m1 CHR(109) + CHR(0185)
#DEFINE m2 CHR(109) + CHR(0178)
FUNCTION RK_InputPlantMaat(aMaat)
*to change plantsizes
*date: 20-06-2018
LOCAL oDlg, oGet1, oGet2, oGet3, oGet4, oCbxPer, oBtnOk
LOCAL nKey := 13
LOCAL aAantalPer[0]
AADD(aAantalPer, m1)
AADD(aAantalPer, m2)
/*aMaat contains the next values:
aMaat[1] > text
aMaat[2] > numeric "23.45"
aMaat[3] > text
aMaat[4] > numeric "123"
aMaat[5] > numeric "1"
*/
DEFINE DIALOG oDlg TITLE 'Plantsizes' SIZE 500, 210
@ 140, 10 SAY 'maat:' OF oDlg SIZE 100, 20
oSay:SetAlign( 2 )
@ 110, 10 SAY 'prijs:' OF oDlg SIZE 100, 20
oSay:SetAlign( 3 )
@ 80, 10 SAY 'opmerking:' OF oDlg SIZE 100, 20
oSay:SetAlign( 1 )
@ 50, 10 SAY 'plantafstand:' OF oDlg SIZE 100, 20
oSay:SetAlign( 1 )
@ 50, 225 SAY 'per:' OF oDlg SIZE 25, 20
oSay:SetAlign( 1 )
@ 140, 115 GET oGet1 VAR aMaat[1] OF oDlg TOOLTIP "tik hier in" SIZE 200, 25
oGet1:KeyDown( nKey ) && how can I make this work, what does it do?
@ 110, 115 GET oGet2 VAR aMaat[2] OF oDlg TOOLTIP "tik hier in" SIZE 100, 25
oGet2:SetNumeric()
oGet2:SetNumFormat(9999.99) &&this does not work correct, if I enter something and then a dot everything disappears
@ 80, 115 GET oGet3 VAR aMaat[3] OF oDlg TOOLTIP "tik hier in" SIZE 380, 25
@ 50, 115 GET oGet4 VAR aMaat[4] OF oDlg TOOLTIP "tik hier in" SIZE 100, 25
oGet4:SetNumeric()
oGet4:SetNumFormat("0")
@ 50, 255 COMBOBOX oCbxPer VAR aMaat[5] SIZE 50, 25 ITEMS aAantalPer
IF aMaat[5] > 0
oCbxPer:SELECT(aMaat[5])
ENDIF
@ 10, 150 BUTTON oBtnOk PROMPT "Ok" OF oDlg ACTION (aMaat[1] := oGet1:GetText, aMaat[2] := oGet2:GetText,aMaat[3] := oGet3:GetText, aMaat[4] := oGet4:GetText, oDlg:End())
oBtnOk:SetFocus() &&I don't get a focus on this button, How can I make this button allways focussed?
ACTIVATE DIALOG oDlg CENTERED
RETURN aMaat