calling TextRectangle doesn't update the auto-wrap column

Posted by Fiendish on Sun 28 Nov 2010 08:47 PM — 10 posts, 27,148 views.

USA Global Moderator #0
With "Auto-wrap to window size" enabled, if I call TextRectangle to change the size of the output region, new text still wraps at the old location. The wrap column doesn't change unless I resize the program window. Changing the size of the whole program by, let's say 1 pixel, will then cause new text to start wrapping at the edge of the textrectangle.

The wrap column should get updated by calls to TextRectangle if auto-wrap to window size is enabled.
USA Global Moderator #1
Also, the "Adjust width to size" button should use the smaller of TextRectangle width and window width. Currently it just uses window width.
Australia Forum Administrator #2
Fixed in version 4.71.
USA Global Moderator #3
Awesome. Also, it looks like the wrap column only gets updated while the world is connected. Bug?
Australia Forum Administrator #4
It looks like by design, not sure why ...


// don't resize if not active, or minimized, or closed
if (wp.showCmd != SW_MINIMIZE &&
    pDoc->m_iConnectPhase == eConnectConnectedToMud &&
    (
    pDoc->m_pActiveOutputView == this  ||
    pDoc->m_pActiveCommandView == m_bottomview
    ))
    AutoWrapWindowWidth (pDoc);

Australia Forum Administrator #5
Probably because of this:

http://www.gammon.com.au/scripts/showrelnote.php?version=3.74&productid=0

Point 4.
Australia Forum Administrator #6
Or more likely, this:

http://www.gammon.com.au/scripts/showrelnote.php?version=3.35&productid=0

Point 4.
USA Global Moderator #7
Odd. If it stays that way, I'd update wrap columns on connect. Otherwise textrects that get sized before connection will mysteriously not adjust wrapping.
USA Global Moderator #8
Though, actually, neither of those issues has to do with mud connection. Only being backgrounded, not disconnected. So maybe remove the check for m_iConnectPhase? Updating on connect might be safer, though, given that there might be a good reason for the check that just isn't immediately obvious.
Amended on Sun 28 Nov 2010 11:55 PM by Fiendish
Australia Forum Administrator #9
I'm inclined to agree it shouldn't matter. I've taken it out and we'll see what happens.