Gustav Schubert 25 Posted December 5, 2019 On the OSX64 platform I want to use native Pickers for Color (TNsColorPanel) and Font (TNsFontPanel). The idea is that first the dialog must be shown (initialized) so that the user can select a color or font in the dialog. Then, at any time, if an action is triggered in the App, the currently selected Color or Font should be retrieved and used. It works for Color, but not for Font. I don't implement changeFont since I don't know how. But it looks as if a working handler is needed, or it won't work. Won't work means that the current Font cannot be retrieved via the convertFont method of the FontManager. https://github.com/federgraph/federgraph-meme-builder/blob/6e035f461e47ed0b30c46ceb36960cbfd528c6c2/MB/RiggVar.MB.Picker.Mac.pas#L104 - debug on Mac (F9) - press button sC (show Color Panel) - change color in panel - select App window (focus) - press button pC (pick Color), ok - press button sF (show Font Panel) - chang Font in panel - ( set breakpoint in TPickerMac.SelectFontFamilyName ) - select App window (focus) - press button pF (pick Font) - todo: make it work Should I give up at this point, and if so, why? Share this post Link to post
Gustav Schubert 25 Posted December 6, 2019 OK, done, found and example of how to implement callback for Color, extended the case for Font, this seems to work. Share this post Link to post
Gustav Schubert 25 Posted December 8, 2019 I include a minimal test project for FMX, OSX64 target only, see attachment. ( You can change TRectangle.Fill.Color and TText.Font.Family via native dialogs, see screenshot. ) This seems to work somehow, but there are at least two remaining problems: 1) Color: If you change from Apple to Developer in combo box and continue to use the dialog - it will crash the App. 2) Font: selectedFont is the value navigated from, not the value navigated to; in the example the font family of the TText should be Arial Narrow, not Arial Black. I would like to understand the reason for problem 1, any idea? ChangeColorTest.zip Share this post Link to post