Skip to content

Commit

Permalink
Merge pull request #3 from WinMerge/sync-scroll
Browse files Browse the repository at this point in the history
Synchronize Scrolling in Web page comparison WinMerge/winmerge#2064
  • Loading branch information
sdottaka authored Nov 19, 2023
2 parents e4910ea + 10ee2c7 commit c37c739
Show file tree
Hide file tree
Showing 6 changed files with 520 additions and 63 deletions.
21 changes: 13 additions & 8 deletions src/WinWebDiff/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@
#define IDM_COMPARE_LASTDIFFERENCE 149
#define IDM_COMPARE_NEXTCONFLICT 150
#define IDM_COMPARE_PREVIOUSCONFLICT 151
#define IDM_CLEAR_DISK_CACHE 161
#define IDM_CLEAR_COOKIES 162
#define IDM_CLEAR_BROWSING_HISTORY 163
#define IDM_CLEAR_ALL_PROFILE 164
#define IDI_WINWEBDIFF 170
#define IDI_SMALL 171
#define IDC_WINWEBDIFF 172
#define IDM_SYNC_ENABLED 160
#define IDM_SYNC_SCROLL 161
#define IDM_SYNC_CLICK 162
#define IDM_SYNC_INPUT 163
#define IDM_SYNC_GOBACKFORWARD 164
#define IDM_CLEAR_DISK_CACHE 171
#define IDM_CLEAR_COOKIES 172
#define IDM_CLEAR_BROWSING_HISTORY 173
#define IDM_CLEAR_ALL_PROFILE 174
#define IDI_WINWEBDIFF 180
#define IDI_SMALL 181
#define IDC_WINWEBDIFF 182
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
Expand All @@ -55,7 +60,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 180
#define _APS_NEXT_RESOURCE_VALUE 190
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 111
Expand Down
29 changes: 29 additions & 0 deletions src/WinWebDiff/WinWebDiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ void UpdateMenuState(HWND hWnd)
CheckMenuItem(hMenu, IDM_VIEW_SPLITHORIZONTALLY, m_pWebDiffWindow->GetHorizontalSplit() ? MF_CHECKED : MF_UNCHECKED);
CheckMenuRadioItem(hMenu, IDM_VIEW_DIFF_ALGORITHM_MYERS, IDM_VIEW_DIFF_ALGORITHM_NONE,
m_pWebDiffWindow->GetDiffOptions().diffAlgorithm + IDM_VIEW_DIFF_ALGORITHM_MYERS, MF_BYCOMMAND);
CheckMenuItem(hMenu, IDM_SYNC_ENABLED, m_pWebDiffWindow->GetSyncEvents() ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SYNC_SCROLL, m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_SCROLL) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SYNC_CLICK, m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_CLICK) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SYNC_INPUT, m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_INPUT) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SYNC_GOBACKFORWARD, m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_GOBACKFORWARD) ? MF_CHECKED : MF_UNCHECKED);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Expand Down Expand Up @@ -583,6 +588,30 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case IDM_COMPARE_PREVIOUSCONFLICT:
m_pWebDiffWindow->PrevConflict();
break;
case IDM_SYNC_ENABLED:
m_pWebDiffWindow->SetSyncEvents(!m_pWebDiffWindow->GetSyncEvents());
UpdateMenuState(m_hWnd);
break;
case IDM_SYNC_SCROLL:
m_pWebDiffWindow->SetSyncEventFlag(IWebDiffWindow::EVENT_SCROLL,
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_SCROLL));
UpdateMenuState(m_hWnd);
break;
case IDM_SYNC_CLICK:
m_pWebDiffWindow->SetSyncEventFlag(IWebDiffWindow::EVENT_CLICK,
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_CLICK));
UpdateMenuState(m_hWnd);
break;
case IDM_SYNC_INPUT:
m_pWebDiffWindow->SetSyncEventFlag(IWebDiffWindow::EVENT_INPUT,
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_INPUT));
UpdateMenuState(m_hWnd);
break;
case IDM_SYNC_GOBACKFORWARD:
m_pWebDiffWindow->SetSyncEventFlag(IWebDiffWindow::EVENT_GOBACKFORWARD,
!m_pWebDiffWindow->GetSyncEventFlag(IWebDiffWindow::EVENT_GOBACKFORWARD));
UpdateMenuState(m_hWnd);
break;
case IDM_CLEAR_DISK_CACHE:
m_pWebDiffWindow->ClearBrowsingData(-1, IWebDiffWindow::BrowsingDataType::DISK_CACHE);
break;
Expand Down
Binary file modified src/WinWebDiff/WinWebDiff.rc
Binary file not shown.
Loading

0 comments on commit c37c739

Please sign in to comment.