PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD75 Keyboard, which key? and MAX / MIN
WD75 Keyboard, which key? and MAX / MIN
Débuté par Daniel Ramirez, 11 juil. 2003 20:54 - 2 réponses
Posté le 11 juillet 2003 - 20:54
Hi again!
Yesterday I tried for several hours to get to know which key the user press in a control (A, 1, p, etc.) and did not find a way to do it, only for system keys I found something in the help, but I feel sure it should be a function for that.
I also have declared a Max and Min values to a numeric control and it works fine in preventing the user enters values outside the fixed range, the trouble is that when one attempts to insert numbers out of range, WD displays a message telling the user whats wrong, but I would like to translate the message to other language (english by default), is there a way to do so?
Thanks again for your time...
Posté le 12 juillet 2003 - 00:47
Hi Daniel

Capturing keys have to do with Windows Events, you can read about it in the help file under Events. It is quit easy once you know it.
To capture character keys pushed in a control:

1 - add the Key-down (WM-CHAR) event to the control
This control event will capture character keys pushed in the control.
2 - add the statement Charact(_EVE.wParam) to the Key-down (WM-CHAR) event.
The '_EVE.wparam' is the windows-event param that returns the code of the key pushed. The 'Charact' function gives you the character of it. Together this will give you the result you want. E.g. trace(Charact(_EVE.wParam)) will show you what you typed in the trace window.

Alternative solution:
1- use the 'Event' function in the declarations of the window to capture the WM-CHAR event and fire a certain procedure. E.g.: Event(lpCatchEvent,edControl,258) will fire the procedure 'lpCatchEvent' whenever a character in control 'edControl' is pushed.
2. This procedure uses parameters: Procedure lpCatchEvent(Message, wParam, IParam). wParam is the one that will return the key-code of the key pushed and Charact(wParam) will give you the character pushed.

I am not aware of a possibility to translate the default WinDev validation message. But with what you now now, you can write your own validation routine.
HTH,
Marco

http://www.appenta.nl
Posté le 22 juillet 2003 - 14:58
Re: the English default message for out-of-range entries on fields
We were told by the manufacturer of the system that if you want French messages, you'd
have to get/use the French version of the system.
Of course there's no Italian etc. version, so if you want multilingual messages in this case
there seems to be no way but to hand-code a routine to do that....
If enough people this problem to PCSoft, it might convince them that this is a problem:
Italians don't like to see English messages coming up, nor do others - it would be
important to be able to use the MessTranslate function for this.
Best regards,
Joe

Hi again!
Yesterday I tried for several hours to get to know which key the user press in a control (A, 1, p, etc.) and did not find a way to do it, only for system keys I found something in the help, but I feel sure it should be a function for that.
I also have declared a Max and Min values to a numeric control and it works fine in preventing the user enters values outside the fixed range, the trouble is that when one attempts to insert numbers out of range, WD displays a message telling the user whats wrong, but I would like to translate the message to other language (english by default), is there a way to do so?
Thanks again for your time...