And found, that sometimes, after pressing hotkey defined with alt key, alt activates menu too.
This is very troublesome, because thirst character of entered date is missing.
I've prepared a little sample. Try to compile it and then, try to use ALT-T key to activate textbox and enter some numbers.
Try to do it few times, because this is a lottery - sometimes works good, sometimes bad.
I've especially defined main menu to watch when it's activated.
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 240 HEIGHT 480 ;
TITLE 'HMG Demo' ;
MAIN
DEFINE MAIN MENU
POPUP "&Option"
MENUITEM 'Any Option '
END POPUP
END MENU
@ 15,10 LABEL l1 ;
VALUE "Press ALT-&T to activate textbox" ;
width 200
@ 40,10 TEXTBOX Text_1 ;
VALUE 123 ;
TOOLTIP 'Numeric TextBox' ;
NUMERIC ;
MAXLENGTH 5 ;
RIGHTALIGN
@ 80,10 TEXTBOX Text_2 ;
VALUE "another textbox..."
MAXLENGTH 55
DEFINE BUTTON Text1SetFocus
ROW 150
COL 20
WIDTH 200
HEIGHT 40
CAPTION 'Set focus to Text_1 by button'
ACTION Form_1.Text_1.SetFocus
END BUTTON
END WINDOW
Form_1.Center
ON KEY ALT+T OF FORM_1 ACTION FORM_1.TEXT_1.SETFOCUS
Form_1.Activate
Return Nil