ExpandAndScroll Help

I have a scrolledpanel.ScrollPanel window with a varying number of
ExpandoTextCtrls in it.

The attached file handles most of the behavior I want, but there are a
few points

If the user types into an ExpandoTextCtrl beyond the bottom of the
screen, I can't get the window to scroll to show the current lines of
text. Is this possible? I just thought of testing the event position
and checking, but I don't know if EVT_TEXT gives me that kind of
information.

Also, if the window has to scroll, and I add a new item, the window
doesn't always scroll to the newly created ExpandoTextCtrl.

Attached is my sample file.

ExpandAndScroll.py (4.18 KB)

···

--
Josh English
Joshua.R.English@gmail.com
http://joshenglish.livejournal.com

Josh English wrote:

I have a scrolledpanel.ScrollPanel window with a varying number of
ExpandoTextCtrls in it.

The attached file handles most of the behavior I want, but there are a
few points

If the user types into an ExpandoTextCtrl beyond the bottom of the
screen, I can't get the window to scroll to show the current lines of
text. Is this possible? I just thought of testing the event position
and checking, but I don't know if EVT_TEXT gives me that kind of
information.

Try calling the scrolled panel's ScrollChildIntoView method. I'm not sure how that will behave if the expando textctrl won't entirely fit in the scrolled panel, but in general it should work well.

···

--
Robin Dunn
Software Craftsman