Forum > LCL

OnSelect for TFontDialog ?

(1/2) > >>

Aidex:
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?

lucamar:
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).

Aidex:
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.

lucamar:
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.

AlexTP:
You can try ATExtendedDialogs package- it is in OnlinePackageManager, and can add event there. http://wiki.freepascal.org/ATExtendedDialogs

Navigation

[0] Message Index

[#] Next page

Go to full version