You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create base class for EditLink and few most used implementations #1063
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
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.
Well, I thought about extending/modifying VirtualTrees.EditLink.pas so that other links could inherit most of generic methods and implement just specific things
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?
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.
Activity
joachimmarder commentedon Sep 22, 2021
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 derivedTVirtualTreeGridcontrol and appropriate editors.Fr0sT-Brutal commentedon Sep 23, 2021
Well, I thought about extending/modifying VirtualTrees.EditLink.pas so that other links could inherit most of generic methods and implement just specific things
joachimmarder commentedon Sep 23, 2021
@Fr0sT-Brutal: That sounds good, a well designed base class for editors will be helpful.
Fr0sT-Brutal commentedon Sep 24, 2021
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?
joachimmarder commentedon Sep 26, 2021
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.
joachimmarder commentedon Sep 26, 2021
Thank you for the pull request, it is now merged, but without an extended code review.
Fr0sT-Brutal commentedon Sep 27, 2021
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.