Skip to content

Commit 2018d52

Browse files
committed
WIP
1 parent b5a76dc commit 2018d52

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

src/WinWebDiffLib/Resource.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
#define IDC_COMPARE 1021
1616
#define IDC_ZOOM 1022
1717
#define IDC_WIDTH 1023
18-
#define IDC_HEIGHT 1024
19-
#define IDC_FITTOWINDOW 1624
20-
#define IDC_USERAGENT 1628
21-
#define IDC_SHOWDIFFERENCES 1631
22-
#define IDC_SYNC_EVENTS 1632
18+
#define IDC_BY 1024
19+
#define IDC_HEIGHT 1025
20+
#define IDC_FITTOWINDOW 1026
21+
#define IDC_USERAGENT 1027
22+
#define IDC_SHOWDIFFERENCES 1028
23+
#define IDC_SYNC_EVENTS 1029
2324
#define ID_WEB_COMPARE_SCREENSHOTS 1633
2425
#define ID_WEB_COMPARE_FULLSIZE_SCREENSHOTS 1634
2526
#define ID_WEB_COMPARE_HTMLS 1635

src/WinWebDiffLib/WebToolWindow.hpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,11 @@ class CWebToolWindow : public IWebToolWindow, IWebDiffEventHandler
281281
void OnSize(HWND hwnd, UINT nType, int cx, int cy)
282282
{
283283
static const int nIDs[] = {
284-
0
285-
// IDC_ZOOM,
284+
IDC_COMPARE,
285+
IDC_ZOOM,
286+
IDC_USERAGENT,
287+
IDC_SYNC_EVENTS,
288+
IDC_SHOWDIFFERENCES,
286289
};
287290
HDWP hdwp = BeginDeferWindowPos(static_cast<int>(std::size(nIDs)));
288291
RECT rc;
@@ -294,8 +297,23 @@ class CWebToolWindow : public IWebToolWindow, IWebDiffEventHandler
294297
GetWindowRect(hwndCtrl, &rcCtrl);
295298
POINT pt = { rcCtrl.left, rcCtrl.top };
296299
ScreenToClient(m_hWnd, &pt);
297-
DeferWindowPos(hdwp, hwndCtrl, nullptr, pt.x, pt.y, rc.right - pt.x * 2, rcCtrl.bottom - rcCtrl.top, SWP_NOMOVE | SWP_NOZORDER);
300+
DeferWindowPos(hdwp, hwndCtrl, nullptr, pt.x, pt.y, rc.right - pt.x - 2, rcCtrl.bottom - rcCtrl.top, SWP_NOMOVE | SWP_NOZORDER);
298301
}
302+
RECT rcWidth, rcHeight, rcBy;
303+
HWND hwndWidth = GetDlgItem(m_hWnd, IDC_WIDTH);
304+
HWND hwndBy = GetDlgItem(m_hWnd, IDC_BY);
305+
HWND hwndHeight = GetDlgItem(m_hWnd, IDC_HEIGHT);
306+
GetWindowRect(hwndWidth, &rcWidth);
307+
GetWindowRect(hwndBy, &rcBy);
308+
GetWindowRect(hwndHeight, &rcHeight);
309+
POINT ptWidth = { rcWidth.left, rcWidth.top };
310+
ScreenToClient(m_hWnd, &ptWidth);
311+
int wby = rcBy.right - rcBy.left;
312+
int w = (rc.right - 2 - ptWidth.x - wby - 4) / 2;
313+
int h = rcWidth.bottom - rcWidth.top;
314+
DeferWindowPos(hdwp, hwndWidth, nullptr, ptWidth.x, ptWidth.y, w, h, SWP_NOMOVE | SWP_NOZORDER);
315+
DeferWindowPos(hdwp, hwndBy, nullptr, ptWidth.x + w + 2, ptWidth.y, rcBy.right - rcBy.left, h, SWP_NOZORDER);
316+
DeferWindowPos(hdwp, hwndHeight, nullptr, ptWidth.x + w + 2 + wby + 2 , ptWidth.y, w, h, SWP_NOZORDER);
299317
EndDeferWindowPos(hdwp);
300318

301319
Sync();

src/WinWebDiffLib/WinWebDiffLib.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
128128
FONT 8, "MS Shell Dlg", 400, 0, 0x0
129129
BEGIN
130130
CONTROL "Compare",IDC_COMPARE,"Button",BS_SPLITBUTTON | WS_TABSTOP,2,2,68,12
131-
CONTROL "",IDC_FITTOWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,14,10,14
131+
CONTROL "",IDC_FITTOWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,14,10,14
132132
EDITTEXT IDC_WIDTH,16,16,24,12,ES_AUTOHSCROLL | WS_TABSTOP
133-
LTEXT "x",IDC_STATIC,40,20,6,8
133+
LTEXT "x",IDC_BY,40,20,6,8
134134
EDITTEXT IDC_HEIGHT,46,16,24,12,ES_AUTOHSCROLL | WS_TABSTOP
135135
LTEXT "Zoom:",IDC_STATIC,2,30,34,10
136-
COMBOBOX IDC_ZOOM,35,30,35,88,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
136+
COMBOBOX IDC_ZOOM,36,30,34,88,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
137137
LTEXT "UA:",IDC_STATIC,2,44,16,10
138138
EDITTEXT IDC_USERAGENT,18,44,52,14,ES_AUTOHSCROLL | WS_TABSTOP
139139
CONTROL "&Event Sync",IDC_SYNC_EVENTS,"Button",BS_SPLITBUTTON | WS_TABSTOP,2,60,68,12

0 commit comments

Comments
 (0)