Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Dec 25, 2023
1 parent b5a76dc commit 2018d52
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
11 changes: 6 additions & 5 deletions src/WinWebDiffLib/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
#define IDC_COMPARE 1021
#define IDC_ZOOM 1022
#define IDC_WIDTH 1023
#define IDC_HEIGHT 1024
#define IDC_FITTOWINDOW 1624
#define IDC_USERAGENT 1628
#define IDC_SHOWDIFFERENCES 1631
#define IDC_SYNC_EVENTS 1632
#define IDC_BY 1024
#define IDC_HEIGHT 1025
#define IDC_FITTOWINDOW 1026
#define IDC_USERAGENT 1027
#define IDC_SHOWDIFFERENCES 1028
#define IDC_SYNC_EVENTS 1029
#define ID_WEB_COMPARE_SCREENSHOTS 1633
#define ID_WEB_COMPARE_FULLSIZE_SCREENSHOTS 1634
#define ID_WEB_COMPARE_HTMLS 1635
Expand Down
24 changes: 21 additions & 3 deletions src/WinWebDiffLib/WebToolWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,11 @@ class CWebToolWindow : public IWebToolWindow, IWebDiffEventHandler
void OnSize(HWND hwnd, UINT nType, int cx, int cy)
{
static const int nIDs[] = {
0
// IDC_ZOOM,
IDC_COMPARE,
IDC_ZOOM,
IDC_USERAGENT,
IDC_SYNC_EVENTS,
IDC_SHOWDIFFERENCES,
};
HDWP hdwp = BeginDeferWindowPos(static_cast<int>(std::size(nIDs)));
RECT rc;
Expand All @@ -294,8 +297,23 @@ class CWebToolWindow : public IWebToolWindow, IWebDiffEventHandler
GetWindowRect(hwndCtrl, &rcCtrl);
POINT pt = { rcCtrl.left, rcCtrl.top };
ScreenToClient(m_hWnd, &pt);
DeferWindowPos(hdwp, hwndCtrl, nullptr, pt.x, pt.y, rc.right - pt.x * 2, rcCtrl.bottom - rcCtrl.top, SWP_NOMOVE | SWP_NOZORDER);
DeferWindowPos(hdwp, hwndCtrl, nullptr, pt.x, pt.y, rc.right - pt.x - 2, rcCtrl.bottom - rcCtrl.top, SWP_NOMOVE | SWP_NOZORDER);
}
RECT rcWidth, rcHeight, rcBy;
HWND hwndWidth = GetDlgItem(m_hWnd, IDC_WIDTH);
HWND hwndBy = GetDlgItem(m_hWnd, IDC_BY);
HWND hwndHeight = GetDlgItem(m_hWnd, IDC_HEIGHT);
GetWindowRect(hwndWidth, &rcWidth);
GetWindowRect(hwndBy, &rcBy);
GetWindowRect(hwndHeight, &rcHeight);
POINT ptWidth = { rcWidth.left, rcWidth.top };
ScreenToClient(m_hWnd, &ptWidth);
int wby = rcBy.right - rcBy.left;
int w = (rc.right - 2 - ptWidth.x - wby - 4) / 2;
int h = rcWidth.bottom - rcWidth.top;
DeferWindowPos(hdwp, hwndWidth, nullptr, ptWidth.x, ptWidth.y, w, h, SWP_NOMOVE | SWP_NOZORDER);
DeferWindowPos(hdwp, hwndBy, nullptr, ptWidth.x + w + 2, ptWidth.y, rcBy.right - rcBy.left, h, SWP_NOZORDER);
DeferWindowPos(hdwp, hwndHeight, nullptr, ptWidth.x + w + 2 + wby + 2 , ptWidth.y, w, h, SWP_NOZORDER);
EndDeferWindowPos(hdwp);

Sync();
Expand Down
6 changes: 3 additions & 3 deletions src/WinWebDiffLib/WinWebDiffLib.rc
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
CONTROL "Compare",IDC_COMPARE,"Button",BS_SPLITBUTTON | WS_TABSTOP,2,2,68,12
CONTROL "",IDC_FITTOWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,14,10,14
CONTROL "",IDC_FITTOWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,2,14,10,14
EDITTEXT IDC_WIDTH,16,16,24,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "x",IDC_STATIC,40,20,6,8
LTEXT "x",IDC_BY,40,20,6,8
EDITTEXT IDC_HEIGHT,46,16,24,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Zoom:",IDC_STATIC,2,30,34,10
COMBOBOX IDC_ZOOM,35,30,35,88,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_ZOOM,36,30,34,88,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "UA:",IDC_STATIC,2,44,16,10
EDITTEXT IDC_USERAGENT,18,44,52,14,ES_AUTOHSCROLL | WS_TABSTOP
CONTROL "&Event Sync",IDC_SYNC_EVENTS,"Button",BS_SPLITBUTTON | WS_TABSTOP,2,60,68,12
Expand Down

0 comments on commit 2018d52

Please sign in to comment.