Re: wxGrid, is there any way to get the DC?
Vadim Zeitlin <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 6 Sep 2023 00:48:55 -0700 (PDT) Tony Kennedy wrote:
TK> I've got a grid, and in the label, I've got something like
TK>
TK> some text[a,b,c,d]
TK>
TK> What I need to do is find the exact character a user clicks on when they
TK> click in a label cell.
TK>
TK> I know I can do a hittest to get the exact point, but I cannot seem to find
TK> a way to get the wxDC of the grid so that I can use GetPartialTextExtents.
You can use wxClientDC for wxGrid::GetGridWindow() to do what you want.
This is one of the cases where using wxClientDC is (and will continue to
be) supported, unlike actually drawing on it.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCZPhvlQAKCRAG6kHeT2we hoUpAKClhvdHpG5NnHEe8MXl9abRoFRNrgCfZRerMknt9ht85E+pLriQcrIz7E8= =bmpK -----END PGP SIGNATURE-----