Exel deviation!? Help

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Exel deviation!? Help

Postby mariocarrera » Thu Oct 04, 2007 8:04 am

I change the subject of my post because the users want that my numeric fields behave as excel cell.
when you use excel with Italian keyboard layout, excel accepts the right "." as "," because is the Italian decimal point.

I have found the method that must responds the appropriate key

there is a method
OSWidget>>#asciiKey: aKey
"Private - Answer the ASCII value of aKey or nil if no conversion exists."
| result |

"Translate aKey to ASCII using the current keyboard."
Keyboard replaceFrom: 1 to: Keyboard size withObject: 0.
OS getKeyboardState: Keyboard.
(OS
toAscii: aKey
uScanCode: aKey
lpbKeyState: Keyboard
lpdwTransKey: (result := ByteArray new: 4)
fuState: 0) == 1 ifTrue: [^(result uint32At: 0)].
^nil

this method receives aKey=110 in case I pressed the right "." key and receives aKey=190 in case I pressed the left "."
the question how to modify for numeric fields only. My application already exists and have thousands of numeric fields so subclass maybe is not the better choice
Thanks
Mario
mariocarrera
 
Posts: 17
Joined: Thu Dec 14, 2006 6:53 am

Postby mariocarrera » Wed Oct 10, 2007 1:17 am

anwer to my self

I found how to resolve my problem. It was very easy, I need just to set the italian keyboard with 142 key and then all works very fine...

Mario
mariocarrera
 
Posts: 17
Joined: Thu Dec 14, 2006 6:53 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest