This simple solution will allow you to get a calendar popup or calculator when in a browse layout (or infact in any form window) , by simply pressing F11 or F12
See Attached image for example
Instructions:
STEP1 - Create a new function (via Code Tab) called Define_Hotkeys() with the following code
STEP 2 - For each form that you wish to assign the new hotkeys to , goto Forms/Events/Onkey and add the following line of code
Define_Hotkeys()
That's it - you now have popup calendar and calculator
F11 = Calendar
F12 = Calculator
Please Note: There is also a piece of code in the function which disables the use opf CTRL-D - which I find is a nuisance in Browses because it tries to delet the parent record, when mostly you just want to delete the current line in the browse. If you require CTRL-D to work as before , just uncomment the lines as noted in the function.
Regards
Mike Thomson
Alpha One Software
See Attached image for example
Instructions:
STEP1 - Create a new function (via Code Tab) called Define_Hotkeys() with the following code
Code:
function Define_Hotkeys as C () IF a_user.key.value = "{F11}" THEN sDate=popup.calendar ("Enter Date",dtoc(date())) a_user.key.handled = .T. IF a_user.key.event = "down" THEN sys_send_keys(sDate) END IF else IF a_user.key.value = "{F12}" THEN sNum=popup.calculator ("Enter Date",dtoc(date())) a_user.key.handled = .T. IF a_user.key.event = "down" THEN sys_send_keys(sNum) END IF '**** Take This section Out if you do not want to siable control-D (Delete Shortcut) ***** else IF a_user.key.value = "{^d}" THEN '**** Ignore Control D **** a_user.key.handled = .T. '**** End of Section to Take out for Control D **** END IF end function
Define_Hotkeys()
That's it - you now have popup calendar and calculator
F11 = Calendar
F12 = Calculator
Please Note: There is also a piece of code in the function which disables the use opf CTRL-D - which I find is a nuisance in Browses because it tries to delet the parent record, when mostly you just want to delete the current line in the browse. If you require CTRL-D to work as before , just uncomment the lines as noted in the function.
Regards
Mike Thomson
Alpha One Software
Comment