Multiline wxTextCtrl event for new line Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
virious
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon May 08, 2017 7:51 pm
Location: Poland

Multiline wxTextCtrl event for new line

Post by virious »

Hello :),

is there any event emitted by a multiline wxTextCtrl when text is wrapped to new line?

Cheers!
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Multiline wxTextCtrl event for new line

Post by jgrzybowski »

You can try to catch change text event (EVT_TEXT) and then read current number of lines: textctrlYourTextCtrl->GetNumberOfLines();
and compare new number of lines with prevoius one (if it has been increased). Regards, Jarek
virious
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon May 08, 2017 7:51 pm
Location: Poland

Re: Multiline wxTextCtrl event for new line

Post by virious »

That was the solution which I was initially trying out, so your answer assured me that this is correct way of solving my problem. Thanks :).