Re: wxGrid, is there any way to get the DC?
Tony Kennedy <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Brilliant, thanks for that. I'll give it a go tomorrow. On Wednesday, 6 September 2023 at 13:24:57 UTC+1 Vadim Zeitlin wrote: > 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/ > -- Please read https://www.wxwidgets.org/support/mlhowto.htm before posting. --- You received this message because you are subscribed to the Google Groups "wx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/173464f6-7e8a-4d99-b448-8437fb8a8ccan%40googlegroups.com.