Applies to: posted in the Clarion 5.5 EE group. No version is named in the text.
Problem
A poster used FONTDIALOG() to let the end user choose a font and colour for printing. The font choices were fine but the colour choices were very limited. He asked how to give more colours, and whether there is a 32-bit font dialog, since the one called looked 16-bit.
Solution
- Replace the Clarion font dialog with your own. Set
system{PROP:FontDialogHook}=address(myNewFontDialog)and every place that calls the Clarion font dialog then calls yours. - Build the dialog on the Windows API calls ChooseFont() and ChooseColor(). ChooseFont allows a callback function; when the user goes to select a colour a message is sent to the callback, where you can call ChooseColor with all the colour choices and return a brush with the chosen colour.
- A second poster pointed to a colour-picker sample from a third-party site as another starting point.
Caveats
- The poster found this over his head and asked for an explanation; the answerer said he had done it once, for a font dialog that showed only TrueType fonts, not for colour.
- His attached class covers the font part only; the colour callback was left for the reader to study.
- The answerer had first called the property a "libhook"; the property named in his later post is PROP:FontDialogHook. The poster did not report a result.
Today (2026)
Not re-tested. Whether the hook property works the same on current builds is not known.
Sources: Eric J. (Dec 2001, the question), Jim K. (Dec 2001), Mark R. (Dec 2001) in softvelocity.products.c55ee.