Implement macOS-specific wxDataViewCheckIconTextRenderer

This implementation suffers at least from 2 problems:

1. It doesn't support icons at all.
2. It toggles the checkbox when clicking on the text and not just on the
   checkbox itself, as would be expected.

but it's still better than the current version which simply doesn't work
at all, i.e. can't be toggled in any way (and also doesn't draw itself
correctly when using dark mode under macOS 10.14+), so use it for now.

A better solution would be to fix the problem with ActivateCell() not
working at all (see #17746) and update the code to respect drawing in
dark mode.

Closes #17473.

Closes https://github.com/wxWidgets/wxWidgets/pull/904
This commit is contained in:
Stefan Csomor
2019-10-21 02:04:35 +02:00
committed by Vadim Zeitlin
parent fa3c0b1808
commit 235e61c311
4 changed files with 177 additions and 34 deletions

View File

@@ -539,6 +539,8 @@ typedef wxDataViewTextRenderer wxDataViewDateRenderer;
// wxDataViewCheckIconTextRenderer: 3-state checkbox + text + optional icon
// ----------------------------------------------------------------------------
#ifndef __WXOSX__
class WXDLLIMPEXP_CORE wxDataViewCheckIconTextRenderer
: public wxDataViewCustomRenderer
{
@@ -589,6 +591,7 @@ private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCheckIconTextRenderer);
};
#endif // !__WXOSX__
// this class is obsolete, its functionality was merged in
// wxDataViewTextRenderer itself now, don't use it any more