Warm tip: This article is reproduced from stackoverflow.com, please click
delphi firemonkey

Firemonkey Checkbox : Is there a tristate option usable on Windows and MacOS platform?

发布于 2020-03-31 23:00:09

I am looking for a way to create a checkbox that has the status undefined as well as the status on and off. Is such a third state common on the Mac and if not, how do you solve it there understandably?

Questioner
Schneider Infosystems Ltd
Viewed
77
Hans 2020-01-31 20:00

Yes, a third state is supported natively by MacOS. Quote from Apples Human Interface Guideline:

Use a mixed state when it makes sense. A checkbox should accurately reflect its state. If a checkbox is used to globally enable and disable multiple child checkboxes, it should show a mixed state—reflected by a dash—when those children are not all in the same state.

You will need to create your own button class to achieve this. Either using a FMX styled button that adds the tri-state option. Or a FMX wrapper around a native button. If you want to go native, you can use the TMS mCL component suite, which is not free though.