Forum > LCL

OnSelect for TFontDialog ?

(1/2) > >>

Hi there!
TFontDialog comes with a NotifyEvent for OnApplyClicked.
Unfortunately, OnApplyClicked is not triggered until the user has clicked the Apply button (which works as described).
I would like an event when the user selects an entry in the font list (without clicking Apply or Ok).
I would then like to use the temporarily selected font to apply it as an extended preview to the parent window.
Is there a trick how I could derive an OnSelect event from the existing TFontDialog component?

To use the OnApplyClicked event you have to add fdApplyButton to the dialog's Options. It then will show an "Apply" button that triggers the event without closing the dialog.

Note: It may or may not work on all widgetsets (I haven't tested).

Yes, the Apply button and OnApplyClicked are quite good for my intention.
It would be nice if there would be an additional option "applyOnSelect" - this would make the preview even more responsive for the user.

Font lists can be quite large; having it trigger an event each time a font is selected (which happens very frequently when navigating with the keyboard) would induce quite a lot of overhead for, usually, very little gain. And the dialog itself already has a preview box which you can customize with your own message.

Using the "Apply" button also has the advantage that it allows to delay the "live preview" until all the font properties are selected.

You can try ATExtendedDialogs package- it is in OnlinePackageManager, and can add event there.


[0] Message Index

[#] Next page

Go to full version