Hi,

I have a field control where user can enter integers in the range of -100 to
+100 only. If value in the field goes out of my specified range, then user
is not allowed to enter any single digit from the keyboard.

My problem is that I can not change the Field Control it to a List Box
Control. I have to do all the validations on Field Control code itself.

Is there any method available in Palm SDK API which can do this
valaditions??????????

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For achieving this, I doing the following steps:
1) Trapping "keyDownEvent"

2) WChar nKeyVal = EventPtr->data.keyDown.chr;
If key pressed is not a digit or +/- sign the return back.
Else do the validations for the key pressed.

3) Use methods GetObjectPtr, FldGetInsPtPosition, FldDelete (for backspace),
FldGetTextHandle, FldInsert (if any digit or +/- is pressed)......... etc
and also code to do validations of integer range is placed in between.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But all this comprises lot of if-else and checks. Any direct method can
reduce a lot of code.

Thanx.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to