Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/02/10 12:54
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#177567 - Use String
Responding to: ???'s previous message
It appears that you are programming in C language. I would use an 16-bit integer type to capture and store the user settable parameter. I would then convert it to a four digit string just before the edit process using sprintf() with a format string as "%04d" as this is a super easy way to take care of the leading zeros. The string can then nicely be displayed as a string. I would then enter the edit procedure of your choice. As discussed before you can do this a number of ways. In C the editing if a string like this is easy because of the fact that a string is treated as a character array and each digit is very easily manipulated. With as few as three user interaction buttons or keys you can do the 0 -> 9 edit scheme at each digit position. For a seldom used adjustment parameter I like the idea of individual edit of each digit and would find buttons for the following functions to be useful - One button to select "next digit" in a move right and wrap to to the left. A second button to select the next digit value at the current position in counting order in the 0-9 range. The third button would be the Accept/Enter button. The nature of accept/enter could be somewhat variable in that it would depend upon if you had one parameter at a time on the screen or more then one. If you had more than one then the Accept could be some other button that moved the user parameter selector over to another parameter location. If you had a "screen per parameter" then the accept can be that which enters the edited value and closes the edit mode screen. After the edit is accepted the value of the string can easily be converted back to its numerical variable value using something like atoi() with little concern to the normal atoi() issues since the digit edit procedure keeps the string strictly controlled as a numerical digits string.

If you can spring for additional buttons the next one to add in this example would be a 9 -> 0 digit selector and a 2nd one after that would be the "previous digit" select.

When one is building products with user interfaces it can be attractive to consider using something like an encoder spinner wheel. One control can give you a two-bit gray code pulse sequence and five switches (up, down, left, right and enter).

Michael Karas




List of 10 messages in thread
TopicAuthorDate
User editable parameter            01/01/70 00:00      
   Don't fight too much which which alternative to use            01/01/70 00:00      
      Solved..            01/01/70 00:00      
         but you get a headache ...            01/01/70 00:00      
   Maybe a better way            01/01/70 00:00      
      Unpleasant with too large speedup steps            01/01/70 00:00      
      Fast scroll algorithm            01/01/70 00:00      
         I agree!            01/01/70 00:00      
   Use String            01/01/70 00:00      
      Exactly the way you said            01/01/70 00:00      

Back to Subject List