Skip to content

Create base class for EditLink and few most used implementations #1063

Description

@Fr0sT-Brutal

Somewhat related to #799. Would be nice to have basic EditLink class to inherit from and few ready-to-use most used implementations (plain edit, combobox, mask edit, spin edit...).
I could do it but first I want to be sure changes will be applied

Activity

  1. joachimmarder commented on Sep 22, 2021

    @joachimmarder
    Contributor

    I could do it but first I want to be sure changes will be applied

    If they come in new, separate units I don't see why not. My concerns in #799 were mainly about a read/write Data[] property in the base class. I will be happy to accpet a derived TVirtualTreeGrid control and appropriate editors.

  2. added
    Pull Requests InvitedThere are no current plans to address the issue, but we would be happy if someone supplies a PR.
    on Sep 22, 2021
  3. Fr0sT-Brutal commented on Sep 23, 2021

    @Fr0sT-Brutal
    ContributorAuthor

    Well, I thought about extending/modifying VirtualTrees.EditLink.pas so that other links could inherit most of generic methods and implement just specific things

  4. joachimmarder commented on Sep 23, 2021

    @joachimmarder
    Contributor

    @Fr0sT-Brutal: That sounds good, a well designed base class for editors will be helpful.

  5. Fr0sT-Brutal commented on Sep 24, 2021

    @Fr0sT-Brutal
    ContributorAuthor

    Done.
    Combobox/datetimepicker/etc editlinks are probably to come.
    @joachimmarder I've inspected TStringEditLink.SetBounds but it contains too much black magic so I left it for now but I guess some of that code will be needed for classes with controls of other types. In the same time Advanced demo only has 2 lines for this.

    Is it really necessary to reset FStopping on exception in TStringEditLink.EndEdit?

  6. joachimmarder commented on Sep 26, 2021

    @joachimmarder
    Contributor

    Is it really necessary to reset FStopping on exception in TStringEditLink.EndEdit?

    Sorry, I can't comment much on that, I never worked on that code after taking over the project. But it looks strange. I wonder which kind of exceptions are to be expected here? Catching untyped exceptions isn't best practice anyway, and the covered code block seems to be too large. Maybe in case FEdit.Hide() fails, the edit process should not be considered as ended because the editor may still be visible.

    I would prefer to catch expected exceptions here only.

  7. joachimmarder commented on Sep 26, 2021

    @joachimmarder
    Contributor

    Thank you for the pull request, it is now merged, but without an extended code review.

  8. Fr0sT-Brutal commented on Sep 27, 2021

    @Fr0sT-Brutal
    ContributorAuthor

    I'm a little puzzled here too... FStopping looks like mechanism to avoid reentrance but I guess the tree itself won't let it happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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