Delphi: using IInterface to restore cursor at end of mehod (prelude to a memento that executes any code at end of method).
The Wiert Corner – A long while ago, I wrote about a (then overdue post) on .NET/C#: Using IDisposable to restore temporary settrings example: TemporaryCursor class. I had been using a similar technique in Delphi since before I found out about the TRecall class and thought: I think my TTemporaryCursor is smarter, as it is based on interfaces. TRecall (and the Vcl.Graphics descendants TBrushRecall, TFontRecall, and TPenRecall) store TPersistent properies using the Assign method. They were introduced in Delphi 6. Too bad there are only very few people using TRecall as lots of TPersistent things warrant sasaving ...
Visits by Source
Users who voted for this posting