Make the mirror panel grow with the window#61
Merged
Conversation
Nothing in the chain passed a size down. The splitter resized its pane, and CDialogContainer::OnSize threw the number away, so the two property sheets kept the size comctl32 gave them at creation and the panel just gained grey space. Since the frame starts maximized, that was the first thing a user saw. The container now fits both sheets to the pane, floored at their natural size so the form view still scrolls when the pane is smaller, and offset by the scroll position because CScrollView moves its children as it scrolls. Both sheets and not only the visible one: starting a mirror just toggles WS_VISIBLE between them, so the one left behind would come back at the old size. Wizard-mode sheets have no tab control to stretch, so CWizTab lays out its own children: the button strip and the rule above it keep to the bottom, and the active page fills what is left. comctl32 hands a page the rect it had at creation every time it shows it, so that has to be reapplied on each page change, not only on resize. CWndLayout carries the anchoring itself. Controls keep their template rect and take a percentage of the growth, which is enough for every case here and always recomputes from the template, so repeated resizes cannot drift. In the transfer rows the URL and filename columns split the new width evenly, since those are the two that clip, while the progress bar and SKIP ride along at the right edge. Height is left alone on purpose. NStatsBuffer fixes the panel at fourteen rows, so vertical space has nothing to fill it with, and spreading the rows out would be worse than leaving the margin. Only the transfer page is anchored. The five wizard pages grow without moving their contents, which is no worse than today; they can be given tables later. CI cannot see layout, so this wants a look on the VM. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019HXNEMWtyrkW7xoD8ewcR3 Signed-off-by: Xavier Roche <roche@httrack.com>
xroche
added a commit
that referenced
this pull request
Jul 26, 2026
The in-progress panel chopped every URL to 32 characters with a "..." in the middle before the UI ever saw it, and the 95-dialog-unit cell then clipped what was left. Because the cell is right-aligned, the clip ate the host end, so the row could show neither where the file came from nor what it was called. The filename cell had the same problem with no truncation marker at all. Store the URL whole and let the statics ellipsize to their own width, so the text degrades at pixel resolution instead of at an arbitrary character count, and improves on its own once the panel can grow. Hovering any cell of a row now shows the full untruncated URL, which the row already kept in url_adr/url_fil. Deriving the tooltip row from element[][] rather than from the control ID also covers rows 10 to 13: their SKIP buttons had no tooltip, the per-ID switch having stopped at 9. This does not close xroche/httrack#114 on its own. The panel still does not resize; that is PR #61. Signed-off-by: Xavier Roche <xroche@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The IDC_* macros are plain ints, so Add(this, IDC_inforun, 0, 100) matched Add(CWnd*, int, int, int) exactly on every argument while the by-ID overload needed an int to UINT conversion. It bound to the wrong one silently: the page anchored itself as one of its own controls, with a move factor of 1173 percent, and would have shot off to the right on the first resize. The neighbouring loop reached the right overload only because its table is declared const UINT[], which is what made the three broken calls look fine. Rename the by-ID entry point so the two can never be confused again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019HXNEMWtyrkW7xoD8ewcR3 Signed-off-by: Xavier Roche <roche@httrack.com>
This was referenced Jul 26, 2026
xroche
added a commit
that referenced
this pull request
Jul 26, 2026
Two real defects from #61, plus a call-site move. GetActivePage() is m_pages[GetActiveIndex()] with no bounds check outside a debug ASSERT, and GetActiveIndex() returns -1 when nothing is selected. FinalInProgress and EndInProgress both empty the array before refilling it, and RemovePage relayouts synchronously, so a WM_SIZE arriving mid-rebuild read m_pages[-1] and dereferenced whatever came back. Both call sites now go through GetActiveIndex and GetPageCount. DeferWindowPos destroys the HDWP on failure, dropping every position already queued, and the loop then carried on with SetWindowPos for the remainder so the earlier controls silently kept their old rects. It now redoes the whole pass. BuildLayout also moves to CDialogContainer::OnInitialUpdate. There is no popup-to-WS_CHILD restyle after WM_INITDIALOG, so the recorded rects are the same either way; what the move buys is that the active page has a window by then, so m_pageBase is the page rect rather than the hidden tab control standing in for it. Signed-off-by: Xavier Roche <xroche@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing in the chain passed a size down. The splitter resized its pane and
CDialogContainer::OnSizethrew the number away, so both property sheets kept the size comctl32 gave them at creation and the panel only gained grey space. The frame starts maximized, so that was the first thing a user saw.The container now fits both sheets to the pane, floored at their natural size so the form view still scrolls when the pane is smaller. Both sheets rather than just the visible one: starting a mirror only toggles
WS_VISIBLEbetween them, so the one left behind would come back at the old size. Wizard-mode sheets have no tab control to stretch, soCWizTablays out its own children, keeping the button strip at the bottom and letting the active page fill the rest. comctl32 hands a page its creation rect every time it shows it, so that has to be reapplied on every page change and not only on resize.CWndLayoutis the new piece: a control keeps its template rect and takes a percentage of the growth, always recomputed from the template so repeated resizes cannot drift. In the transfer rows the URL and filename columns split the new width, since those are the two that clip, while the progress bar and SKIP anchor right.Height is left alone deliberately.
NStatsBufferfixes the panel at fourteen rows, so there is nothing to fill vertical space with. Only the transfer page is anchored so far; the five wizard pages grow without moving their contents, which is no worse than today.Sits on top of #60. Closes xroche/httrack#114 (cross-repo, so it will need closing by hand). CI cannot see layout, so this wants a look on the VM before it lands.