Skip to content

TBaseVirtualTree disable single letter incremental search #837

Open
@GoranDespalatovic

Description

@GoranDespalatovic

Steps to reproduce :

  1. Create grid with 1000 nodes, first column filled with record number, enable incremental search
  2. Go to node 899
  3. Count how many times you have to press key "9" before you reach node 999.

Suggested resolution:

  1. add coNoSingleLetterIncSearch to TVTColumnOption
  2. add toNoSingleLetterIncSearch to TVTMiscOption
  3. in TBaseVirtualTree.HandleIncrementalSearch add :
        // The "single letter mode" is used to advance quickly from node to node when pressing the same key several times.
        if toNoSingleLetterIncSearch in TreeOptions.MiscOptions then            // gigo
          SingleLetter := false                                                 // gigo
        else                                                                    // gigo
        if (FocusedColumn > -1) and (coNoSingleLetterIncSearch in Header.Columns[FocusedColumn].Options) then // gigo
          SingleLetter := false                                                 // gigo
        else                                                                    // gigo
        SingleLetter := (Length(FSearchBuffer) = 1) and not PreviousSearch and (FSearchBuffer[1] = NewChar);

That way we can disable single letter incremental search per column / per tree as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementOpen for DiscussionThere are several possibilites to address the issue and anyone is invited for comments.Pull Requests InvitedThere are no current plans to address the issue, but we would be happy if someone supplies a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions