Thread: Bacspacing tab

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    129

    Bacspacing tab

    If the user presses TAB the cursor will go forward (8-(CURRENT_COLUMN_IN_THE_SCREEN%8)) spaces. Now, when I press TAB and then backspace what would be the ideal thing to count how many columns should the cursor go back (the string that the user is typing is in memory)?

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    114
    you should count the number of '\t' (note not "\t") there is before the test cursor, and the beginning of the line. How to count these? Find the beginning of the line, check next char, if its a '\t', check the next, and so on. If there is another charachter than '\t' you could say that the action (backspace+tab) isn't valid. well how you define the rules for that is up to you.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    114
    But this might not be the answer you seek, if you don't use '\t'. (which I just realised you might not!)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tab Ordering of GUI Controls
    By cloudy in forum Windows Programming
    Replies: 2
    Last Post: 04-22-2006, 09:13 AM
  2. Tab order in Tab Control
    By Halloko in forum Windows Programming
    Replies: 2
    Last Post: 05-08-2005, 11:08 PM
  3. Visual C++
    By Golffor1 in forum C++ Programming
    Replies: 1
    Last Post: 08-04-2003, 04:30 PM
  4. Disable a tab in control tab?
    By Iron Mike in forum Windows Programming
    Replies: 1
    Last Post: 07-23-2003, 10:50 AM
  5. Replies: 5
    Last Post: 06-30-2003, 12:52 PM